28 #ifndef V8_MIPS_CODE_STUBS_ARM_H_
29 #define V8_MIPS_CODE_STUBS_ARM_H_
40 class TranscendentalCacheStub:
public CodeStub {
49 : type_(type), argument_type_(argument_type) { }
57 int MinorKey() {
return type_ | argument_type_; }
62 class StoreBufferOverflowStub:
public CodeStub {
65 : save_doubles_(save_fp) { }
76 Major MajorKey() {
return StoreBufferOverflow; }
77 int MinorKey() {
return (save_doubles_ ==
kSaveFPRegs) ? 1 : 0; }
81 class UnaryOpStub:
public CodeStub {
88 operand_type_(operand_type) {
100 class ModeBits:
public BitField<UnaryOverwriteMode, 0, 1> {};
101 class OpBits:
public BitField<Token::Value, 1, 7> {};
102 class OperandTypeInfoBits:
public BitField<UnaryOpIC::TypeInfo, 8, 3> {};
104 Major MajorKey() {
return UnaryOp; }
106 return ModeBits::encode(mode_)
107 | OpBits::encode(op_)
108 | OperandTypeInfoBits::encode(operand_type_);
113 void Generate(MacroAssembler* masm);
115 void GenerateTypeTransition(MacroAssembler* masm);
117 void GenerateSmiStub(MacroAssembler* masm);
118 void GenerateSmiStubSub(MacroAssembler* masm);
119 void GenerateSmiStubBitNot(MacroAssembler* masm);
120 void GenerateSmiCodeSub(MacroAssembler* masm, Label* non_smi, Label* slow);
121 void GenerateSmiCodeBitNot(MacroAssembler* masm, Label* slow);
123 void GenerateHeapNumberStub(MacroAssembler* masm);
124 void GenerateHeapNumberStubSub(MacroAssembler* masm);
125 void GenerateHeapNumberStubBitNot(MacroAssembler* masm);
126 void GenerateHeapNumberCodeSub(MacroAssembler* masm, Label* slow);
127 void GenerateHeapNumberCodeBitNot(MacroAssembler* masm, Label* slow);
129 void GenerateGenericStub(MacroAssembler* masm);
130 void GenerateGenericStubSub(MacroAssembler* masm);
131 void GenerateGenericStubBitNot(MacroAssembler* masm);
132 void GenerateGenericCodeFallback(MacroAssembler* masm);
134 virtual int GetCodeKind() {
return Code::UNARY_OP_IC; }
140 virtual void FinishCode(Handle<Code>
code) {
141 code->set_unary_op_type(operand_type_);
146 class BinaryOpStub:
public CodeStub {
161 : op_(OpBits::decode(key)),
162 mode_(ModeBits::decode(key)),
163 use_fpu_(FPUBits::decode(key)),
164 operands_type_(operands_type),
165 result_type_(result_type) { }
168 enum SmiCodeGenerateHeapNumberResults {
169 ALLOW_HEAPNUMBER_RESULTS,
170 NO_HEAPNUMBER_RESULTS
181 virtual void PrintName(StringStream* stream);
184 class ModeBits:
public BitField<OverwriteMode, 0, 2> {};
185 class OpBits:
public BitField<Token::Value, 2, 7> {};
186 class FPUBits:
public BitField<bool, 9, 1> {};
187 class OperandTypeInfoBits:
public BitField<BinaryOpIC::TypeInfo, 10, 3> {};
188 class ResultTypeInfoBits:
public BitField<BinaryOpIC::TypeInfo, 13, 3> {};
190 Major MajorKey() {
return BinaryOp; }
192 return OpBits::encode(op_)
193 | ModeBits::encode(mode_)
194 | FPUBits::encode(use_fpu_)
195 | OperandTypeInfoBits::encode(operands_type_)
196 | ResultTypeInfoBits::encode(result_type_);
199 void Generate(MacroAssembler* masm);
200 void GenerateGeneric(MacroAssembler* masm);
201 void GenerateSmiSmiOperation(MacroAssembler* masm);
202 void GenerateFPOperation(MacroAssembler* masm,
206 void GenerateSmiCode(MacroAssembler* masm,
209 SmiCodeGenerateHeapNumberResults heapnumber_results);
210 void GenerateLoadArguments(MacroAssembler* masm);
211 void GenerateReturn(MacroAssembler* masm);
212 void GenerateUninitializedStub(MacroAssembler* masm);
213 void GenerateSmiStub(MacroAssembler* masm);
214 void GenerateInt32Stub(MacroAssembler* masm);
215 void GenerateHeapNumberStub(MacroAssembler* masm);
216 void GenerateOddballStub(MacroAssembler* masm);
217 void GenerateStringStub(MacroAssembler* masm);
218 void GenerateBothStringStub(MacroAssembler* masm);
219 void GenerateGenericStub(MacroAssembler* masm);
220 void GenerateAddStrings(MacroAssembler* masm);
221 void GenerateCallRuntime(MacroAssembler* masm);
223 void GenerateHeapResultAllocation(MacroAssembler* masm,
225 Register heap_number_map,
229 void GenerateRegisterArgsPush(MacroAssembler* masm);
230 void GenerateTypeTransition(MacroAssembler* masm);
231 void GenerateTypeTransitionWithSavedArgs(MacroAssembler* masm);
233 virtual int GetCodeKind() {
return Code::BINARY_OP_IC; }
239 virtual void FinishCode(Handle<Code>
code) {
240 code->set_binary_op_type(operands_type_);
241 code->set_binary_op_result_type(result_type_);
248 class StringHelper :
public AllStatic {
308 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
325 class StringAddStub:
public CodeStub {
330 Major MajorKey() {
return StringAdd; }
331 int MinorKey() {
return flags_; }
333 void Generate(MacroAssembler* masm);
335 void GenerateConvertArgument(MacroAssembler* masm,
348 class SubStringStub:
public CodeStub {
354 int MinorKey() {
return 0; }
356 void Generate(MacroAssembler* masm);
360 class StringCompareStub:
public CodeStub {
383 virtual Major MajorKey() {
return StringCompare; }
384 virtual int MinorKey() {
return 0; }
385 virtual void Generate(MacroAssembler* masm);
387 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
394 Label* chars_not_equal);
401 class WriteInt32ToHeapNumberStub :
public CodeStub {
408 the_heap_number_(the_heap_number),
411 ASSERT(IntRegisterBits::is_valid(the_int_.
code()));
412 ASSERT(HeapNumberRegisterBits::is_valid(the_heap_number_.
code()));
413 ASSERT(ScratchRegisterBits::is_valid(scratch_.
code()));
414 ASSERT(SignRegisterBits::is_valid(sign_.
code()));
427 class IntRegisterBits:
public BitField<int, 0, 4> {};
428 class HeapNumberRegisterBits:
public BitField<int, 4, 4> {};
429 class ScratchRegisterBits:
public BitField<int, 8, 4> {};
430 class SignRegisterBits:
public BitField<int, 12, 4> {};
432 Major MajorKey() {
return WriteInt32ToHeapNumber; }
435 return IntRegisterBits::encode(the_int_.
code())
436 | HeapNumberRegisterBits::encode(the_heap_number_.
code())
437 | ScratchRegisterBits::encode(scratch_.
code())
438 | SignRegisterBits::encode(sign_.
code());
441 void Generate(MacroAssembler* masm);
445 class NumberToStringStub:
public CodeStub {
464 Major MajorKey() {
return NumberToString; }
465 int MinorKey() {
return 0; }
467 void Generate(MacroAssembler* masm);
471 class RecordWriteStub:
public CodeStub {
481 remembered_set_action_(remembered_set_action),
482 save_fp_regs_mode_(fp_mode),
560 class RegisterAllocation {
567 scratch0_(scratch0) {
569 scratch1_ = GetRegThatIsNotOneOf(object_, address_, scratch0_);
572 void Save(MacroAssembler* masm) {
576 masm->push(scratch1_);
579 void Restore(MacroAssembler* masm) {
580 masm->pop(scratch1_);
586 void SaveCallerSaveRegisters(MacroAssembler* masm,
SaveFPRegsMode mode) {
589 CpuFeatures::Scope scope(
FPU);
594 inline void RestoreCallerSaveRegisters(MacroAssembler*masm,
597 CpuFeatures::Scope scope(
FPU);
603 inline Register object() {
return object_; }
604 inline Register address() {
return address_; }
605 inline Register scratch0() {
return scratch0_; }
606 inline Register scratch1() {
return scratch1_; }
614 Register GetRegThatIsNotOneOf(Register
r1,
619 if (candidate.is(r1))
continue;
620 if (candidate.is(r2))
continue;
621 if (candidate.is(r3))
continue;
630 enum OnNoNeedToInformIncrementalMarker {
631 kReturnOnNoNeedToInformIncrementalMarker,
632 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
635 void Generate(MacroAssembler* masm);
636 void GenerateIncremental(MacroAssembler* masm,
Mode mode);
637 void CheckNeedsToInformIncrementalMarker(
638 MacroAssembler* masm,
639 OnNoNeedToInformIncrementalMarker on_no_need,
641 void InformIncrementalMarker(MacroAssembler* masm,
Mode mode);
643 Major MajorKey() {
return RecordWrite; }
646 return ObjectBits::encode(object_.
code()) |
647 ValueBits::encode(value_.
code()) |
648 AddressBits::encode(address_.
code()) |
649 RememberedSetActionBits::encode(remembered_set_action_) |
650 SaveFPRegsModeBits::encode(save_fp_regs_mode_);
653 void Activate(Code* code) {
654 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
657 class ObjectBits:
public BitField<int, 0, 5> {};
658 class ValueBits:
public BitField<int, 5, 5> {};
659 class AddressBits:
public BitField<int, 10, 5> {};
660 class RememberedSetActionBits:
public BitField<RememberedSetAction, 15, 1> {};
661 class SaveFPRegsModeBits:
public BitField<SaveFPRegsMode, 16, 1> {};
669 RegisterAllocation regs_;
676 class RegExpCEntryStub:
public CodeStub {
683 Major MajorKey() {
return RegExpCEntry; }
684 int MinorKey() {
return 0; }
686 bool NeedsImmovableCode() {
return true; }
694 class DirectCEntryStub:
public CodeStub {
699 ExternalReference
function);
703 Major MajorKey() {
return DirectCEntry; }
704 int MinorKey() {
return 0; }
706 bool NeedsImmovableCode() {
return true; }
709 class FloatingPointHelper :
public AllStatic {
851 class StringDictionaryLookupStub:
public CodeStub {
878 static const int kInlinedProbes = 4;
879 static const int kTotalProbes = 20;
881 static const int kCapacityOffset =
885 static const int kElementsStartOffset =
889 Major MajorKey() {
return StringDictionaryLookup; }
892 return LookupModeBits::encode(mode_);
895 class LookupModeBits:
public BitField<LookupMode, 0, 1> {};
903 #endif // V8_MIPS_CODE_STUBS_ARM_H_
static Mode GetMode(Code *stub)
static void Patch(Code *stub, Mode mode)
static const int kElementsStartIndex
RecordWriteStub(Register object, Register value, Register address, RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode)
friend class CodeGenerator
virtual bool SometimesSetsUpAFrame()
static void GenerateFixedRegStubsAheadOfTime()
void instr_at_put(int pos, Instr instr)
static void GenerateCopyCharacters(MacroAssembler *masm, Register dest, Register src, Register count, Register scratch, bool ascii)
UnaryOpStub(Token::Value op, UnaryOverwriteMode mode, UnaryOpIC::TypeInfo operand_type=UnaryOpIC::UNINITIALIZED)
static void LoadNumberAsInt32Double(MacroAssembler *masm, Register object, Destination destination, DwVfpRegister double_dst, DwVfpRegister double_scratch, Register dst1, Register dst2, Register heap_number_map, Register scratch1, Register scratch2, SwVfpRegister single_scratch, Label *not_int32)
virtual ~RegExpCEntryStub()
static void DoubleIs32BitInteger(MacroAssembler *masm, Register src1, Register src2, Register dst, Register scratch, Label *not_int32)
static void GenerateCopyCharactersLong(MacroAssembler *masm, Register dest, Register src, Register count, Register scratch1, Register scratch2, Register scratch3, Register scratch4, Register scratch5, int flags)
void Generate(MacroAssembler *masm)
static void GenerateHashGetHash(MacroAssembler *masm, Register hash)
static bool IsSupported(CpuFeature f)
virtual bool SometimesSetsUpAFrame()
bool AreAliased(Register r1, Register r2, Register r3, Register r4)
#define ASSERT(condition)
static void LoadOperands(MacroAssembler *masm, FloatingPointHelper::Destination destination, Register heap_number_map, Register scratch1, Register scratch2, Label *not_number)
const RegList kJSCallerSaved
static void GenerateCompareFlatAsciiStrings(MacroAssembler *masm, Register left, Register right, Register scratch1, Register scratch2, Register scratch3, Register scratch4)
BinaryOpStub(Token::Value op, OverwriteMode mode)
static State ToState(TypeInfo type_info)
static void GenerateNegativeLookup(MacroAssembler *masm, Label *miss, Label *done, Register receiver, Register properties, Handle< String > name, Register scratch0)
Handle< String > SubString(Handle< String > str, int start, int end, PretenureFlag pretenure)
const RegList kCallerSavedFPU
StringDictionaryLookupStub(LookupMode mode)
static void GenerateFlatAsciiStringEquals(MacroAssembler *masm, Register left, Register right, Register scratch1, Register scratch2, Register scratch3)
byte * instruction_start()
static void LoadSmis(MacroAssembler *masm, Destination destination, Register scratch1, Register scratch2)
virtual bool IsPregenerated()
static void CallCCodeForDoubleOperation(MacroAssembler *masm, Token::Value op, Register heap_number_result, Register scratch)
static Register FromAllocationIndex(int index)
WriteInt32ToHeapNumberStub(Register the_int, Register the_heap_number, Register scratch, Register scratch2)
static void ConvertNumberToInt32(MacroAssembler *masm, Register object, Register dst, Register heap_number_map, Register scratch1, Register scratch2, Register scratch3, DwVfpRegister double_scratch, Label *not_int32)
static State ToState(TypeInfo type_info)
static void LoadNumberAsInt32(MacroAssembler *masm, Register object, Register dst, Register heap_number_map, Register scratch1, Register scratch2, Register scratch3, DwVfpRegister double_scratch0, DwVfpRegister double_scratch1, Label *not_int32)
static void PatchBranchIntoNop(MacroAssembler *masm, int pos)
static void GenerateHashAddCharacter(MacroAssembler *masm, Register hash, Register character)
void Generate(MacroAssembler *masm)
static const int kHeaderSize
void Generate(MacroAssembler *masm)
void GenerateCall(MacroAssembler *masm, ExternalReference function)
static void GenerateFixedRegStubsAheadOfTime()
static void ConvertIntToDouble(MacroAssembler *masm, Register int_scratch, Destination destination, DwVfpRegister double_dst, Register dst1, Register dst2, Register scratch2, SwVfpRegister single_scratch)
void Generate(MacroAssembler *masm)
static void GeneratePositiveLookup(MacroAssembler *masm, Label *miss, Label *done, Register elements, Register name, Register r0, Register r1)
BinaryOpStub(int key, BinaryOpIC::TypeInfo operands_type, BinaryOpIC::TypeInfo result_type=BinaryOpIC::UNINITIALIZED)
static const int kCapacityIndex
static const int kNumAllocatableRegisters
TranscendentalCacheStub(TranscendentalCache::Type type, ArgumentType argument_type)
static void PatchNopIntoBranch(MacroAssembler *masm, int pos)
static bool IsBne(Instr instr)
static void GenerateLookupNumberStringCache(MacroAssembler *masm, Register object, Register result, Register scratch1, Register scratch2, Register scratch3, bool object_is_smi, Label *not_found)
static bool IsBeq(Instr instr)
static const int kInstrSize
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
static void GenerateFixedRegStubsAheadOfTime()
static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler *masm, Register c1, Register c2, Register scratch1, Register scratch2, Register scratch3, Register scratch4, Register scratch5, Label *not_found)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static void FlushICache(void *start, size_t size)
static const int kTranscendentalTypeBits
virtual bool SometimesSetsUpAFrame()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including flags
StringAddStub(StringAddFlags flags)
StoreBufferOverflowStub(SaveFPRegsMode save_fp)
virtual bool IsPregenerated()
static void GenerateHashInit(MacroAssembler *masm, Register hash, Register character)
void Generate(MacroAssembler *masm)