diff options
Diffstat (limited to 'deps/v8/src/x64/assembler-x64-inl.h')
-rw-r--r-- | deps/v8/src/x64/assembler-x64-inl.h | 74 |
1 files changed, 19 insertions, 55 deletions
diff --git a/deps/v8/src/x64/assembler-x64-inl.h b/deps/v8/src/x64/assembler-x64-inl.h index 90deaba4fe..74d5d2436a 100644 --- a/deps/v8/src/x64/assembler-x64-inl.h +++ b/deps/v8/src/x64/assembler-x64-inl.h @@ -8,7 +8,7 @@ #include "src/x64/assembler-x64.h" #include "src/base/cpu.h" -#include "src/debug.h" +#include "src/debug/debug.h" #include "src/v8memory.h" namespace v8 { @@ -293,11 +293,6 @@ Address Assembler::target_address_from_return_address(Address pc) { } -Address Assembler::break_address_from_return_address(Address pc) { - return pc - Assembler::kPatchDebugBreakSlotReturnOffset; -} - - Handle<Object> Assembler::code_target_object_handle_at(Address pc) { return code_targets_[Memory::int32_at(pc)]; } @@ -311,21 +306,17 @@ Address Assembler::runtime_entry_at(Address pc) { // Implementation of RelocInfo // The modes possibly affected by apply must be in kApplyMask. -void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) { - bool flush_icache = icache_flush_mode != SKIP_ICACHE_FLUSH; - if (IsInternalReference(rmode_)) { - // absolute code pointer inside code object moves with the code object. - Memory::Address_at(pc_) += delta; - if (flush_icache) CpuFeatures::FlushICache(pc_, sizeof(Address)); - } else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { +void RelocInfo::apply(intptr_t delta) { + if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { Memory::int32_at(pc_) -= static_cast<int32_t>(delta); - if (flush_icache) CpuFeatures::FlushICache(pc_, sizeof(int32_t)); - } else if (rmode_ == CODE_AGE_SEQUENCE) { + } else if (IsCodeAgeSequence(rmode_)) { if (*pc_ == kCallOpcode) { int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1); *p -= static_cast<int32_t>(delta); // Relocate entry. - if (flush_icache) CpuFeatures::FlushICache(p, sizeof(uint32_t)); } + } else if (IsInternalReference(rmode_)) { + // absolute code pointer inside code object moves with the code object. + Memory::Address_at(pc_) += delta; } } @@ -526,21 +517,18 @@ void RelocInfo::set_code_age_stub(Code* stub, } -Address RelocInfo::call_address() { - DCHECK((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || - (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); - return Memory::Address_at( - pc_ + Assembler::kRealPatchReturnSequenceAddressOffset); +Address RelocInfo::debug_call_address() { + DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); + return Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset); } -void RelocInfo::set_call_address(Address target) { - DCHECK((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || - (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); - Memory::Address_at(pc_ + Assembler::kRealPatchReturnSequenceAddressOffset) = +void RelocInfo::set_debug_call_address(Address target) { + DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); + Memory::Address_at(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset) = target; - CpuFeatures::FlushICache( - pc_ + Assembler::kRealPatchReturnSequenceAddressOffset, sizeof(Address)); + CpuFeatures::FlushICache(pc_ + Assembler::kPatchDebugBreakSlotAddressOffset, + sizeof(Address)); if (host() != NULL) { Object* target_code = Code::GetCodeFromTargetAddress(target); host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( @@ -549,24 +537,6 @@ void RelocInfo::set_call_address(Address target) { } -Object* RelocInfo::call_object() { - return *call_object_address(); -} - - -void RelocInfo::set_call_object(Object* target) { - *call_object_address() = target; -} - - -Object** RelocInfo::call_object_address() { - DCHECK((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || - (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); - return reinterpret_cast<Object**>( - pc_ + Assembler::kPatchReturnSequenceAddressOffset); -} - - void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { RelocInfo::Mode mode = rmode(); if (mode == RelocInfo::EMBEDDED_OBJECT) { @@ -582,11 +552,8 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { visitor->VisitInternalReference(this); } else if (RelocInfo::IsCodeAgeSequence(mode)) { visitor->VisitCodeAgeSequence(this); - } else if (((RelocInfo::IsJSReturn(mode) && - IsPatchedReturnSequence()) || - (RelocInfo::IsDebugBreakSlot(mode) && - IsPatchedDebugBreakSlotSequence())) && - isolate->debug()->has_break_points()) { + } else if (RelocInfo::IsDebugBreakSlot(mode) && + IsPatchedDebugBreakSlotSequence()) { visitor->VisitDebugTarget(this); } else if (RelocInfo::IsRuntimeEntry(mode)) { visitor->VisitRuntimeEntry(this); @@ -610,11 +577,8 @@ void RelocInfo::Visit(Heap* heap) { StaticVisitor::VisitInternalReference(this); } else if (RelocInfo::IsCodeAgeSequence(mode)) { StaticVisitor::VisitCodeAgeSequence(heap, this); - } else if (heap->isolate()->debug()->has_break_points() && - ((RelocInfo::IsJSReturn(mode) && - IsPatchedReturnSequence()) || - (RelocInfo::IsDebugBreakSlot(mode) && - IsPatchedDebugBreakSlotSequence()))) { + } else if (RelocInfo::IsDebugBreakSlot(mode) && + IsPatchedDebugBreakSlotSequence()) { StaticVisitor::VisitDebugTarget(heap, this); } else if (RelocInfo::IsRuntimeEntry(mode)) { StaticVisitor::VisitRuntimeEntry(this); |