Index: src/ia32/assembler-ia32-inl.h |
=================================================================== |
--- src/ia32/assembler-ia32-inl.h (revision 13870) |
+++ src/ia32/assembler-ia32-inl.h (working copy) |
@@ -51,7 +51,7 @@ |
// The modes possibly affected by apply must be in kApplyMask. |
void RelocInfo::apply(intptr_t delta) { |
- if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) { |
+ if (IsRuntimeEntry(rmode_) || IsCodeTarget(rmode_)) { |
int32_t* p = reinterpret_cast<int32_t*>(pc_); |
*p -= delta; // Relocate entry. |
CPU::FlushICache(p, sizeof(uint32_t)); |
@@ -83,13 +83,13 @@ |
Address RelocInfo::target_address() { |
- ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
+ ASSERT(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
return Assembler::target_address_at(pc_); |
} |
Address RelocInfo::target_address_address() { |
- ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY |
+ ASSERT(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
|| rmode_ == EMBEDDED_OBJECT |
|| rmode_ == EXTERNAL_REFERENCE); |
return reinterpret_cast<Address>(pc_); |
@@ -103,7 +103,7 @@ |
void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) { |
Assembler::set_target_address_at(pc_, target); |
- ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
+ ASSERT(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); |
if (mode == UPDATE_WRITE_BARRIER && host() != NULL && IsCodeTarget(rmode_)) { |
Object* target_code = Code::GetCodeFromTargetAddress(target); |
host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
@@ -149,6 +149,19 @@ |
} |
+Address RelocInfo::target_runtime_entry(Assembler* origin) { |
+ ASSERT(IsRuntimeEntry(rmode_)); |
+ return reinterpret_cast<Address>(*reinterpret_cast<int32_t*>(pc_)); |
+} |
+ |
+ |
+void RelocInfo::set_target_runtime_entry(Address target, |
+ WriteBarrierMode mode) { |
+ ASSERT(IsRuntimeEntry(rmode_)); |
+ if (target_address() != target) set_target_address(target, mode); |
+} |
+ |
+ |
Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() { |
ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); |
Address address = Memory::Address_at(pc_); |
@@ -262,7 +275,7 @@ |
Isolate::Current()->debug()->has_break_points()) { |
visitor->VisitDebugTarget(this); |
#endif |
- } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
+ } else if (IsRuntimeEntry(mode)) { |
visitor->VisitRuntimeEntry(this); |
} |
} |
@@ -291,7 +304,7 @@ |
IsPatchedDebugBreakSlotSequence()))) { |
StaticVisitor::VisitDebugTarget(heap, this); |
#endif |
- } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
+ } else if (IsRuntimeEntry(mode)) { |
StaticVisitor::VisitRuntimeEntry(this); |
} |
} |