28 #ifndef V8_ARM64_CODE_STUBS_ARM64_H_
29 #define V8_ARM64_CODE_STUBS_ARM64_H_
40 class StoreBufferOverflowStub:
public PlatformCodeStub {
43 : save_doubles_(save_fp) { }
53 Major MajorKey() {
return StoreBufferOverflow; }
54 int MinorKey() {
return (save_doubles_ ==
kSaveFPRegs) ? 1 : 0; }
58 class StringHelper :
public AllStatic {
76 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
83 : save_doubles_(with_fp) {}
88 Major MajorKey() {
return StoreRegistersState; }
89 int MinorKey() {
return (save_doubles_ ==
kSaveFPRegs) ? 1 : 0; }
92 void Generate(MacroAssembler* masm);
99 : save_doubles_(with_fp) {}
103 Major MajorKey() {
return RestoreRegistersState; }
104 int MinorKey() {
return (save_doubles_ ==
kSaveFPRegs) ? 1 : 0; }
107 void Generate(MacroAssembler* masm);
111 class RecordWriteStub:
public PlatformCodeStub {
124 remembered_set_action_(remembered_set_action),
125 save_fp_regs_mode_(fp_mode),
185 patcher.
adr(xzr, offset_to_incremental_noncompacting);
186 patcher.
adr(xzr, offset_to_incremental_compacting);
191 patcher.
adr(xzr, offset_to_incremental_compacting);
195 patcher.
adr(xzr, offset_to_incremental_noncompacting);
205 class RegisterAllocation {
220 CPURegList pool_available = GetValidRegistersForAllocation();
221 CPURegList used_regs(
object, address, scratch);
222 pool_available.
Remove(used_regs);
229 saved_regs_.Remove(ip0);
230 saved_regs_.Remove(ip1);
234 saved_regs_.Remove(scratch0_);
235 saved_regs_.Remove(scratch1_);
236 saved_regs_.Remove(scratch2_);
239 void Save(MacroAssembler* masm) {
242 masm->Push(scratch1_, scratch2_);
245 void Restore(MacroAssembler* masm) {
246 masm->Pop(scratch2_, scratch1_);
254 masm->PushCPURegList(saved_regs_);
260 void RestoreCallerSaveRegisters(MacroAssembler*masm,
SaveFPRegsMode mode) {
266 masm->PopCPURegList(saved_regs_);
269 Register object() {
return object_; }
270 Register address() {
return address_; }
271 Register scratch0() {
return scratch0_; }
272 Register scratch1() {
return scratch1_; }
273 Register scratch2() {
return scratch2_; }
281 CPURegList saved_regs_;
284 static CPURegList GetValidRegistersForAllocation() {
313 static const int kAheadOfTime[];
315 void Generate(MacroAssembler* masm);
316 void GenerateIncremental(MacroAssembler* masm,
Mode mode);
318 enum OnNoNeedToInformIncrementalMarker {
319 kReturnOnNoNeedToInformIncrementalMarker,
320 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
323 void CheckNeedsToInformIncrementalMarker(
324 MacroAssembler* masm,
325 OnNoNeedToInformIncrementalMarker on_no_need,
327 void InformIncrementalMarker(MacroAssembler* masm);
329 Major MajorKey() {
return RecordWrite; }
332 return MinorKeyFor(object_, value_, address_, remembered_set_action_,
336 static int MinorKeyFor(Register
object,
341 ASSERT(
object.Is64Bits());
343 ASSERT(address.Is64Bits());
344 return ObjectBits::encode(
object.
code()) |
345 ValueBits::encode(value.code()) |
346 AddressBits::encode(address.code()) |
347 RememberedSetActionBits::encode(action) |
348 SaveFPRegsModeBits::encode(fp_mode);
351 void Activate(Code*
code) {
352 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
355 class ObjectBits:
public BitField<int, 0, 5> {};
356 class ValueBits:
public BitField<int, 5, 5> {};
357 class AddressBits:
public BitField<int, 10, 5> {};
358 class RememberedSetActionBits:
public BitField<RememberedSetAction, 15, 1> {};
359 class SaveFPRegsModeBits:
public BitField<SaveFPRegsMode, 16, 1> {};
367 RegisterAllocation regs_;
373 class DirectCEntryStub:
public PlatformCodeStub {
380 Major MajorKey() {
return DirectCEntry; }
381 int MinorKey() {
return 0; }
383 bool NeedsImmovableCode() {
return true; }
387 class NameDictionaryLookupStub:
public PlatformCodeStub {
414 static const int kInlinedProbes = 4;
415 static const int kTotalProbes = 20;
417 static const int kCapacityOffset =
421 static const int kElementsStartOffset =
425 Major MajorKey() {
return NameDictionaryLookup; }
428 return LookupModeBits::encode(mode_);
431 class LookupModeBits:
public BitField<LookupMode, 0, 1> {};
437 class SubStringStub:
public PlatformCodeStub {
442 Major MajorKey() {
return SubString; }
443 int MinorKey() {
return 0; }
445 void Generate(MacroAssembler* masm);
449 class StringCompareStub:
public PlatformCodeStub {
472 virtual Major MajorKey() {
return StringCompare; }
473 virtual int MinorKey() {
return 0; }
474 virtual void Generate(MacroAssembler* masm);
476 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
482 Label* chars_not_equal);
486 struct PlatformCallInterfaceDescriptor {
489 : storage_mode_(storage_mode) { }
500 #endif // V8_ARM64_CODE_STUBS_ARM64_H_
const unsigned kInstructionSizeLog2
bool IsPCRelAddressing() const
const RegList kCallerSaved
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)
bool IsUncondBranchImm() const
virtual bool SometimesSetsUpAFrame()
const unsigned kXRegSizeInBits
void b(int branch_offset, Condition cond=al)
static void GenerateHashGetHash(MacroAssembler *masm, Register hash)
#define ASSERT(condition)
void Generate(MacroAssembler *masm)
static void GenerateAheadOfTime(Isolate *isolate)
static void GenerateCompareFlatAsciiStrings(MacroAssembler *masm, Register left, Register right, Register scratch1, Register scratch2, Register scratch3, Register scratch4)
RestoreRegistersStateStub(SaveFPRegsMode with_fp)
CPURegister PopLowestIndex()
static void GenerateAheadOfTime(Isolate *isolate)
void GenerateCall(MacroAssembler *masm, Register target)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_string(expose_natives_as
static void GenerateFlatAsciiStringEquals(MacroAssembler *masm, Register left, Register right, Register scratch1, Register scratch2, Register scratch3)
byte * instruction_start()
const unsigned kInstructionSize
StoreRegistersStateStub(SaveFPRegsMode with_fp)
Instruction * InstructionAt(int offset) const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static void GenerateHashAddCharacter(MacroAssembler *masm, Register hash, Register character)
void Generate(MacroAssembler *masm)
static Register to_be_pushed_lr()
static void GenerateNegativeLookup(MacroAssembler *masm, Label *miss, Label *done, Register receiver, Register properties, Handle< Name > name, Register scratch0)
static const int kHeaderSize
void ArrayNativeCode(MacroAssembler *masm, Label *call_generic_code)
virtual bool SometimesSetsUpAFrame()
V8_INLINE Instruction * following(int count=1)
static const int kCapacityIndex
void Remove(const CPURegList &other)
virtual bool SometimesSetsUpAFrame()
static void GenerateFixedRegStubsAheadOfTime(Isolate *isolate)
void adr(const Register &rd, Label *label)
static void GeneratePositiveLookup(MacroAssembler *masm, Label *miss, Label *done, Register elements, Register name, Register r0, Register r1)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing 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 statistics of the maximum memory committed for the heap in name
StoreBufferOverflowStub(SaveFPRegsMode save_fp)
NameDictionaryLookupStub(LookupMode mode)
static void GenerateHashInit(MacroAssembler *masm, Register hash, Register character)
bool AreAliased(const CPURegister ®1, const CPURegister ®2, const CPURegister ®3=NoReg, const CPURegister ®4=NoReg, const CPURegister ®5=NoReg, const CPURegister ®6=NoReg, const CPURegister ®7=NoReg, const CPURegister ®8=NoReg)
void Generate(MacroAssembler *masm)