Index: src/x64/assembler-x64-inl.h |
diff --git a/src/x64/assembler-x64-inl.h b/src/x64/assembler-x64-inl.h |
index 0b018490db7f07aa1a0d192c3fa4441286b16616..0447513b985cce0dd5817e15a7b17e29ae8b3ae8 100644 |
--- a/src/x64/assembler-x64-inl.h |
+++ b/src/x64/assembler-x64-inl.h |
@@ -35,6 +35,24 @@ Condition NegateCondition(Condition cc) { |
} |
+// The modes possibly affected by apply must be in kApplyMask. |
+void RelocInfo::apply(int delta) { |
+ if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) { |
+ intptr_t* p = reinterpret_cast<intptr_t*>(pc_); |
+ *p -= delta; // relocate entry |
+ } else if (rmode_ == JS_RETURN && IsCallInstruction()) { |
+ // Special handling of js_return when a break point is set (call |
+ // instruction has been inserted). |
+ intptr_t* p = reinterpret_cast<intptr_t*>(pc_ + 1); |
+ *p -= delta; // relocate entry |
+ } else if (IsInternalReference(rmode_)) { |
+ // absolute code pointer inside code object moves with the code object. |
+ intptr_t* p = reinterpret_cast<intptr_t*>(pc_); |
+ *p += delta; // relocate entry |
+ } |
+} |
+ |
+ |
Address RelocInfo::target_address() { |
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
return Assembler::target_address_at(pc_); |
@@ -63,6 +81,71 @@ byte* Assembler::target_address_at(byte* location) { |
return NULL; |
} |
+ |
+Object* RelocInfo::target_object() { |
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
+ return *reinterpret_cast<Object**>(pc_); |
+} |
+ |
+ |
+Object** RelocInfo::target_object_address() { |
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
+ return reinterpret_cast<Object**>(pc_); |
+} |
+ |
+ |
+Address* RelocInfo::target_reference_address() { |
+ ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); |
+ return reinterpret_cast<Address*>(pc_); |
+} |
+ |
+ |
+void RelocInfo::set_target_object(Object* target) { |
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
+ *reinterpret_cast<Object**>(pc_) = target; |
+} |
+ |
+ |
+bool RelocInfo::IsCallInstruction() { |
+ UNIMPLEMENTED(); // IA32 code below. |
+ return *pc_ == 0xE8; |
+} |
+ |
+ |
+Address RelocInfo::call_address() { |
+ UNIMPLEMENTED(); // IA32 code below. |
+ ASSERT(IsCallInstruction()); |
+ return Assembler::target_address_at(pc_ + 1); |
+} |
+ |
+ |
+void RelocInfo::set_call_address(Address target) { |
+ UNIMPLEMENTED(); // IA32 code below. |
+ ASSERT(IsCallInstruction()); |
+ Assembler::set_target_address_at(pc_ + 1, target); |
+} |
+ |
+ |
+Object* RelocInfo::call_object() { |
+ UNIMPLEMENTED(); // IA32 code below. |
+ ASSERT(IsCallInstruction()); |
+ return *call_object_address(); |
+} |
+ |
+ |
+void RelocInfo::set_call_object(Object* target) { |
+ UNIMPLEMENTED(); // IA32 code below. |
+ ASSERT(IsCallInstruction()); |
+ *call_object_address() = target; |
+} |
+ |
+ |
+Object** RelocInfo::call_object_address() { |
+ UNIMPLEMENTED(); // IA32 code below. |
+ ASSERT(IsCallInstruction()); |
+ return reinterpret_cast<Object**>(pc_ + 1); |
+} |
+ |
} } // namespace v8::internal |
#endif // V8_X64_ASSEMBLER_X64_INL_H_ |