diff options
Diffstat (limited to 'deps/v8/src/mips64/assembler-mips64.h')
-rw-r--r-- | deps/v8/src/mips64/assembler-mips64.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/deps/v8/src/mips64/assembler-mips64.h b/deps/v8/src/mips64/assembler-mips64.h index 93323e3dd6..f94db35974 100644 --- a/deps/v8/src/mips64/assembler-mips64.h +++ b/deps/v8/src/mips64/assembler-mips64.h @@ -394,20 +394,21 @@ constexpr uint64_t kSmiShiftMask = (1UL << kSmiShift) - 1; class Operand BASE_EMBEDDED { public: // Immediate. - INLINE(explicit Operand(int64_t immediate, - RelocInfo::Mode rmode = RelocInfo::NONE)) + V8_INLINE explicit Operand(int64_t immediate, + RelocInfo::Mode rmode = RelocInfo::NONE) : rm_(no_reg), rmode_(rmode) { value_.immediate = immediate; } - INLINE(explicit Operand(const ExternalReference& f)) + V8_INLINE explicit Operand(const ExternalReference& f) : rm_(no_reg), rmode_(RelocInfo::EXTERNAL_REFERENCE) { value_.immediate = static_cast<int64_t>(f.address()); } - INLINE(explicit Operand(const char* s)); - INLINE(explicit Operand(Object** opp)); - INLINE(explicit Operand(Context** cpp)); + V8_INLINE explicit Operand(const char* s); + V8_INLINE explicit Operand(Object** opp); + V8_INLINE explicit Operand(Context** cpp); explicit Operand(Handle<HeapObject> handle); - INLINE(explicit Operand(Smi* value)) : rm_(no_reg), rmode_(RelocInfo::NONE) { + V8_INLINE explicit Operand(Smi* value) + : rm_(no_reg), rmode_(RelocInfo::NONE) { value_.immediate = reinterpret_cast<intptr_t>(value); } @@ -415,10 +416,10 @@ class Operand BASE_EMBEDDED { static Operand EmbeddedCode(CodeStub* stub); // Register. - INLINE(explicit Operand(Register rm)) : rm_(rm) {} + V8_INLINE explicit Operand(Register rm) : rm_(rm) {} // Return true if this is a register operand. - INLINE(bool is_reg() const); + V8_INLINE bool is_reg() const; inline int64_t immediate() const; @@ -498,9 +499,7 @@ class Assembler : public AssemblerBase { // buffer for code generation and assumes its size to be buffer_size. If the // buffer is too small, a fatal error occurs. No deallocation of the buffer is // done upon destruction of the assembler. - Assembler(Isolate* isolate, void* buffer, int buffer_size) - : Assembler(IsolateData(isolate), buffer, buffer_size) {} - Assembler(IsolateData isolate_data, void* buffer, int buffer_size); + Assembler(const AssemblerOptions& options, void* buffer, int buffer_size); virtual ~Assembler() { } // GetCode emits any pending (non-emitted) code and fills the descriptor @@ -574,18 +573,19 @@ class Assembler : public AssemblerBase { // Read/Modify the code target address in the branch/call instruction at pc. // The isolate argument is unused (and may be nullptr) when skipping flushing. static Address target_address_at(Address pc); - INLINE(static void set_target_address_at( + V8_INLINE static void set_target_address_at( Address pc, Address target, - ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { + ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) { set_target_value_at(pc, target, icache_flush_mode); } // On MIPS there is no Constant Pool so we skip that parameter. - INLINE(static Address target_address_at(Address pc, Address constant_pool)) { + V8_INLINE static Address target_address_at(Address pc, + Address constant_pool) { return target_address_at(pc); } - INLINE(static void set_target_address_at( + V8_INLINE static void set_target_address_at( Address pc, Address constant_pool, Address target, - ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { + ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) { set_target_address_at(pc, target, icache_flush_mode); } @@ -622,6 +622,11 @@ class Assembler : public AssemblerBase { // Difference between address of current opcode and target address offset. static constexpr int kBranchPCOffset = 4; + // Difference between address of current opcode and target address offset, + // when we are generatinga sequence of instructions for long relative PC + // branches + static constexpr int kLongBranchPCOffset = 12; + // Here we are patching the address in the LUI/ORI instruction pair. // These values are used in the serialization process and must be zero for // MIPS platform, as Code, Embedded Object or External-reference pointers @@ -655,7 +660,8 @@ class Assembler : public AssemblerBase { // Max offset for compact branch instructions with 26-bit offset field static constexpr int kMaxCompactBranchOffset = (1 << (28 - 1)) - 1; - static constexpr int kTrampolineSlotsSize = 2 * kInstrSize; + static constexpr int kTrampolineSlotsSize = + kArchVariant == kMips64r6 ? 2 * kInstrSize : 8 * kInstrSize; RegList* GetScratchRegisterList() { return &scratch_register_list_; } @@ -1845,6 +1851,7 @@ class Assembler : public AssemblerBase { static bool IsJ(Instr instr); static bool IsLui(Instr instr); static bool IsOri(Instr instr); + static bool IsMov(Instr instr, Register rd, Register rs); static bool IsJal(Instr instr); static bool IsJr(Instr instr); @@ -1950,6 +1957,9 @@ class Assembler : public AssemblerBase { void EndBlockTrampolinePool() { trampoline_pool_blocked_nesting_--; + if (trampoline_pool_blocked_nesting_ == 0) { + CheckTrampolinePoolQuick(1); + } } bool is_trampoline_pool_blocked() const { @@ -1985,7 +1995,11 @@ class Assembler : public AssemblerBase { } } - inline void CheckTrampolinePoolQuick(int extra_instructions = 0); + void CheckTrampolinePoolQuick(int extra_instructions = 0) { + if (pc_offset() >= next_buffer_check_ - extra_instructions * kInstrSize) { + CheckTrampolinePool(); + } + } private: // Avoid overflows for displacements etc. @@ -2250,23 +2264,9 @@ class Assembler : public AssemblerBase { RegList scratch_register_list_; - // The following functions help with avoiding allocations of embedded heap - // objects during the code assembly phase. {RequestHeapObject} records the - // need for a future heap number allocation or code stub generation. After - // code assembly, {AllocateAndInstallRequestedHeapObjects} will allocate these - // objects and place them where they are expected (determined by the pc offset - // associated with each request). That is, for each request, it will patch the - // dummy heap object handle that we emitted during code assembly with the - // actual heap object handle. - protected: - // TODO(neis): Make private if its use can be moved out of TurboAssembler. - void RequestHeapObject(HeapObjectRequest request); - private: void AllocateAndInstallRequestedHeapObjects(Isolate* isolate); - std::forward_list<HeapObjectRequest> heap_object_requests_; - friend class RegExpMacroAssemblerMIPS; friend class RelocInfo; friend class BlockTrampolinePoolScope; |