Revision: 15861
Author: [email protected]
Date: Wed Jul 24 06:50:45 2013
Log: Add the emitp function for X64 assembler
[email protected]
Review URL: https://codereview.chromium.org/19752004
http://code.google.com/p/v8/source/detail?r=15861
Modified:
/branches/bleeding_edge/src/x64/assembler-x64-inl.h
/branches/bleeding_edge/src/x64/assembler-x64.cc
/branches/bleeding_edge/src/x64/assembler-x64.h
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64-inl.h Fri Jul 19 01:49:47
2013
+++ /branches/bleeding_edge/src/x64/assembler-x64-inl.h Wed Jul 24 06:50:45
2013
@@ -49,6 +49,16 @@
Memory::uint32_at(pc_) = x;
pc_ += sizeof(uint32_t);
}
+
+
+void Assembler::emitp(void* x, RelocInfo::Mode rmode) {
+ uintptr_t value = reinterpret_cast<uintptr_t>(x);
+ Memory::uintptr_at(pc_) = value;
+ if (!RelocInfo::IsNone(rmode)) {
+ RecordRelocInfo(rmode, value);
+ }
+ pc_ += sizeof(uintptr_t);
+}
void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) {
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.cc Fri Jul 5 02:52:11
2013
+++ /branches/bleeding_edge/src/x64/assembler-x64.cc Wed Jul 24 06:50:45
2013
@@ -1377,7 +1377,7 @@
EnsureSpace ensure_space(this);
emit(0x48); // REX.W
emit(0xA1);
- emitq(reinterpret_cast<uintptr_t>(value), mode);
+ emitp(value, mode);
}
@@ -1529,7 +1529,7 @@
EnsureSpace ensure_space(this);
emit_rex_64(dst);
emit(0xB8 | dst.low_bits());
- emitq(reinterpret_cast<uintptr_t>(value), rmode);
+ emitp(value, rmode);
}
@@ -1606,7 +1606,7 @@
ASSERT(!HEAP->InNewSpace(*value));
emit_rex_64(dst);
emit(0xB8 | dst.low_bits());
- emitq(reinterpret_cast<uintptr_t>(value.location()), mode);
+ emitp(value.location(), mode);
}
}
@@ -1998,7 +1998,7 @@
EnsureSpace ensure_space(this);
emit(0x48); // REX.W
emit(0xA3);
- emitq(reinterpret_cast<uintptr_t>(dst), mode);
+ emitp(dst, mode);
}
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.h Fri Apr 26 08:46:51 2013
+++ /branches/bleeding_edge/src/x64/assembler-x64.h Wed Jul 24 06:50:45 2013
@@ -1444,6 +1444,7 @@
void emit(byte x) { *pc_++ = x; }
inline void emitl(uint32_t x);
+ inline void emitp(void* x, RelocInfo::Mode rmode);
inline void emitq(uint64_t x, RelocInfo::Mode rmode);
inline void emitw(uint16_t x);
inline void emit_code_target(Handle<Code> target,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.