Index: src/ia32/assembler-ia32.cc |
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc |
index b48906e70614ac930327856b8eec9afb3822a3f3..d9263163fefb97dee052b7009969edc563354d07 100644 |
--- a/src/ia32/assembler-ia32.cc |
+++ b/src/ia32/assembler-ia32.cc |
@@ -1425,11 +1425,7 @@ void Assembler::call(byte* entry, RelocInfo::Mode rmode) { |
EnsureSpace ensure_space(this); |
ASSERT(!RelocInfo::IsCodeTarget(rmode)); |
EMIT(0xE8); |
- if (RelocInfo::IsRuntimeEntry(rmode)) { |
- emit(reinterpret_cast<uint32_t>(entry), rmode); |
- } else { |
- emit(entry - (pc_ + sizeof(int32_t)), rmode); |
- } |
+ emit(entry - (pc_ + sizeof(int32_t)), rmode); |
} |
@@ -1494,11 +1490,7 @@ void Assembler::jmp(byte* entry, RelocInfo::Mode rmode) { |
EnsureSpace ensure_space(this); |
ASSERT(!RelocInfo::IsCodeTarget(rmode)); |
EMIT(0xE9); |
- if (RelocInfo::IsRuntimeEntry(rmode)) { |
- emit(reinterpret_cast<uint32_t>(entry), rmode); |
- } else { |
- emit(entry - (pc_ + sizeof(int32_t)), rmode); |
- } |
+ emit(entry - (pc_ + sizeof(int32_t)), rmode); |
} |
@@ -1555,11 +1547,7 @@ void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode) { |
// 0000 1111 1000 tttn #32-bit disp. |
EMIT(0x0F); |
EMIT(0x80 | cc); |
- if (RelocInfo::IsRuntimeEntry(rmode)) { |
- emit(reinterpret_cast<uint32_t>(entry), rmode); |
- } else { |
- emit(entry - (pc_ + sizeof(int32_t)), rmode); |
- } |
+ emit(entry - (pc_ + sizeof(int32_t)), rmode); |
} |
@@ -2576,7 +2564,10 @@ void Assembler::GrowBuffer() { |
// Relocate runtime entries. |
for (RelocIterator it(desc); !it.done(); it.next()) { |
RelocInfo::Mode rmode = it.rinfo()->rmode(); |
- if (rmode == RelocInfo::INTERNAL_REFERENCE) { |
+ if (rmode == RelocInfo::RUNTIME_ENTRY) { |
+ int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc()); |
+ *p -= pc_delta; // relocate entry |
+ } else if (rmode == RelocInfo::INTERNAL_REFERENCE) { |
int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc()); |
if (*p != 0) { // 0 means uninitialized. |
*p += pc_delta; |