diff options
Diffstat (limited to 'deps/v8/src/x64/macro-assembler-x64.h')
-rw-r--r-- | deps/v8/src/x64/macro-assembler-x64.h | 100 |
1 files changed, 57 insertions, 43 deletions
diff --git a/deps/v8/src/x64/macro-assembler-x64.h b/deps/v8/src/x64/macro-assembler-x64.h index cc057ac54..df5215991 100644 --- a/deps/v8/src/x64/macro-assembler-x64.h +++ b/deps/v8/src/x64/macro-assembler-x64.h @@ -35,18 +35,6 @@ namespace v8 { namespace internal { -// Flags used for the AllocateInNewSpace functions. -enum AllocationFlags { - // No special flags. - NO_ALLOCATION_FLAGS = 0, - // Return the pointer to the allocated already tagged as a heap object. - TAG_OBJECT = 1 << 0, - // The content of the result register already contains the allocation top in - // new space. - RESULT_CONTAINS_TOP = 1 << 1 -}; - - // Default scratch register used by MacroAssembler (and other code that needs // a spare register). The register isn't callee save, and not used by the // function calling convention. @@ -385,7 +373,7 @@ class MacroAssembler: public Assembler { void InitializeSmiConstantRegister() { movq(kSmiConstantRegister, reinterpret_cast<uint64_t>(Smi::FromInt(kSmiConstantRegisterValue)), - RelocInfo::NONE); + RelocInfo::NONE64); } // Conversions between tagged smi values and non-tagged integer values. @@ -895,7 +883,8 @@ class MacroAssembler: public Assembler { Register elements, Register index, XMMRegister xmm_scratch, - Label* fail); + Label* fail, + int elements_offset = 0); // Compare an object's map with the specified map and its transitioned // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. FLAGS are set with @@ -920,6 +909,7 @@ class MacroAssembler: public Assembler { // specified target if equal. Skip the smi check if not required (object is // known to be a heap object) void DispatchMap(Register obj, + Register unused, Handle<Map> map, Handle<Code> success, SmiCheckType smi_check_type); @@ -933,6 +923,15 @@ class MacroAssembler: public Assembler { Register map, Register instance_type); + // Check if the object in register heap_object is a name. Afterwards the + // register map contains the object map and the register instance_type + // contains the instance_type. The registers map and instance_type can be the + // same in which case it contains the instance type afterwards. Either of the + // registers map and instance_type can be the same as heap_object. + Condition IsObjectNameType(Register heap_object, + Register map, + Register instance_type); + // FCmp compares and pops the two values on top of the FPU stack. // The flag results are similar to integer cmp, but requires unsigned // jcc instructions (je, ja, jae, jb, jbe, je, and jz). @@ -976,6 +975,9 @@ class MacroAssembler: public Assembler { // Abort execution if argument is not a string, enabled via --debug-code. void AssertString(Register object); + // Abort execution if argument is not a name, enabled via --debug-code. + void AssertName(Register object); + // Abort execution if argument is not the root value with the given index, // enabled via --debug-code. void AssertRootValue(Register src, @@ -1023,22 +1025,22 @@ class MacroAssembler: public Assembler { // --------------------------------------------------------------------------- // Allocation support - // Allocate an object in new space. If the new space is exhausted control - // continues at the gc_required label. The allocated object is returned in - // result and end of the new object is returned in result_end. The register - // scratch can be passed as no_reg in which case an additional object - // reference will be added to the reloc info. The returned pointers in result - // and result_end have not yet been tagged as heap objects. If - // result_contains_top_on_entry is true the content of result is known to be - // the allocation top on entry (could be result_end from a previous call to - // AllocateInNewSpace). If result_contains_top_on_entry is true scratch + // Allocate an object in new space or old pointer space. If the given space + // is exhausted control continues at the gc_required label. The allocated + // object is returned in result and end of the new object is returned in + // result_end. The register scratch can be passed as no_reg in which case + // an additional object reference will be added to the reloc info. The + // returned pointers in result and result_end have not yet been tagged as + // heap objects. If result_contains_top_on_entry is true the content of + // result is known to be the allocation top on entry (could be result_end + // from a previous call). If result_contains_top_on_entry is true scratch // should be no_reg as it is never used. - void AllocateInNewSpace(int object_size, - Register result, - Register result_end, - Register scratch, - Label* gc_required, - AllocationFlags flags); + void Allocate(int object_size, + Register result, + Register result_end, + Register scratch, + Label* gc_required, + AllocationFlags flags); void AllocateInNewSpace(int header_size, ScaleFactor element_size, @@ -1165,6 +1167,7 @@ class MacroAssembler: public Assembler { // Load the global function with the given index. void LoadGlobalFunction(int index, Register function); + void LoadArrayFunction(Register function); // Load the initial map from the global function. The registers // function and map can be the same. @@ -1326,6 +1329,15 @@ class MacroAssembler: public Assembler { void CheckEnumCache(Register null_value, Label* call_runtime); + // AllocationSiteInfo support. Arrays may have an associated + // AllocationSiteInfo object that can be checked for in order to pretransition + // to another type. + // On entry, receiver_reg should point to the array object. + // scratch_reg gets clobbered. + // If allocation info is present, condition flags are set to equal + void TestJSArrayForAllocationSiteInfo(Register receiver_reg, + Register scratch_reg); + private: // Order general registers are pushed by Pushad. // rax, rcx, rdx, rbx, rsi, rdi, r8, r9, r11, r14, r15. @@ -1377,9 +1389,12 @@ class MacroAssembler: public Assembler { void LoadAllocationTopHelper(Register result, Register scratch, AllocationFlags flags); + // Update allocation top with value in result_end register. // If scratch is valid, it contains the address of the allocation top. - void UpdateAllocationTopHelper(Register result_end, Register scratch); + void UpdateAllocationTopHelper(Register result_end, + Register scratch, + AllocationFlags flags); // Helper for PopHandleScope. Allowed to perform a GC and returns // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and @@ -1413,9 +1428,9 @@ class MacroAssembler: public Assembler { return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1; } - // Needs access to SafepointRegisterStackIndex for optimized frame + // Needs access to SafepointRegisterStackIndex for compiled frame // traversal. - friend class OptimizedFrame; + friend class StandardFrame; }; @@ -1484,17 +1499,16 @@ extern void LogGeneratedCodeCoverage(const char* file_line); #define CODE_COVERAGE_STRINGIFY(x) #x #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) -#define ACCESS_MASM(masm) { \ - byte* x64_coverage_function = \ - reinterpret_cast<byte*>(FUNCTION_ADDR(LogGeneratedCodeCoverage)); \ - masm->pushfd(); \ - masm->pushad(); \ - masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ - masm->call(x64_coverage_function, RelocInfo::RUNTIME_ENTRY); \ - masm->pop(rax); \ - masm->popad(); \ - masm->popfd(); \ - } \ +#define ACCESS_MASM(masm) { \ + Address x64_coverage_function = FUNCTION_ADDR(LogGeneratedCodeCoverage); \ + masm->pushfq(); \ + masm->Pushad(); \ + masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ + masm->Call(x64_coverage_function, RelocInfo::EXTERNAL_REFERENCE); \ + masm->pop(rax); \ + masm->Popad(); \ + masm->popfq(); \ + } \ masm-> #else #define ACCESS_MASM(masm) masm-> |