Commit bb202665 authored by haitao.feng@intel.com's avatar haitao.feng@intel.com

Use the correct version of movq for ExternalReference in X64

R=danno@chromium.org

Review URL: https://codereview.chromium.org/26410004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f719a45f
...@@ -62,11 +62,8 @@ void Assembler::emitp(void* x, RelocInfo::Mode rmode) { ...@@ -62,11 +62,8 @@ void Assembler::emitp(void* x, RelocInfo::Mode rmode) {
} }
void Assembler::emitq(uint64_t x, RelocInfo::Mode rmode) { void Assembler::emitq(uint64_t x) {
Memory::uint64_at(pc_) = x; Memory::uint64_at(pc_) = x;
if (!RelocInfo::IsNone(rmode)) {
RecordRelocInfo(rmode, x);
}
pc_ += sizeof(uint64_t); pc_ += sizeof(uint64_t);
} }
......
...@@ -1465,26 +1465,24 @@ void Assembler::movq(Register dst, void* value, RelocInfo::Mode rmode) { ...@@ -1465,26 +1465,24 @@ void Assembler::movq(Register dst, void* value, RelocInfo::Mode rmode) {
void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) { void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) {
// Non-relocatable values might not need a 64-bit representation. // Non-relocatable values might not need a 64-bit representation.
if (RelocInfo::IsNone(rmode)) { ASSERT(RelocInfo::IsNone(rmode));
if (is_uint32(value)) { if (is_uint32(value)) {
movl(dst, Immediate(static_cast<int32_t>(value))); movl(dst, Immediate(static_cast<int32_t>(value)));
return; } else if (is_int32(value)) {
} else if (is_int32(value)) { movq(dst, Immediate(static_cast<int32_t>(value)));
movq(dst, Immediate(static_cast<int32_t>(value))); } else {
return;
}
// Value cannot be represented by 32 bits, so do a full 64 bit immediate // Value cannot be represented by 32 bits, so do a full 64 bit immediate
// value. // value.
EnsureSpace ensure_space(this);
emit_rex_64(dst);
emit(0xB8 | dst.low_bits());
emitq(value);
} }
EnsureSpace ensure_space(this);
emit_rex_64(dst);
emit(0xB8 | dst.low_bits());
emitq(value, rmode);
} }
void Assembler::movq(Register dst, ExternalReference ref) { void Assembler::movq(Register dst, ExternalReference ref) {
int64_t value = reinterpret_cast<int64_t>(ref.address()); Address value = reinterpret_cast<Address>(ref.address());
movq(dst, value, RelocInfo::EXTERNAL_REFERENCE); movq(dst, value, RelocInfo::EXTERNAL_REFERENCE);
} }
......
...@@ -723,7 +723,6 @@ class Assembler : public AssemblerBase { ...@@ -723,7 +723,6 @@ class Assembler : public AssemblerBase {
// All 64-bit immediates must have a relocation mode. // All 64-bit immediates must have a relocation mode.
void movq(Register dst, void* ptr, RelocInfo::Mode rmode); void movq(Register dst, void* ptr, RelocInfo::Mode rmode);
void movq(Register dst, int64_t value, RelocInfo::Mode rmode); void movq(Register dst, int64_t value, RelocInfo::Mode rmode);
void movq(Register dst, const char* s, RelocInfo::Mode rmode);
// Moves the address of the external reference into the register. // Moves the address of the external reference into the register.
void movq(Register dst, ExternalReference ext); void movq(Register dst, ExternalReference ext);
void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode);
...@@ -1474,7 +1473,7 @@ class Assembler : public AssemblerBase { ...@@ -1474,7 +1473,7 @@ class Assembler : public AssemblerBase {
void emit(byte x) { *pc_++ = x; } void emit(byte x) { *pc_++ = x; }
inline void emitl(uint32_t x); inline void emitl(uint32_t x);
inline void emitp(void* x, RelocInfo::Mode rmode); inline void emitp(void* x, RelocInfo::Mode rmode);
inline void emitq(uint64_t x, RelocInfo::Mode rmode); inline void emitq(uint64_t x);
inline void emitw(uint16_t x); inline void emitw(uint16_t x);
inline void emit_code_target(Handle<Code> target, inline void emit_code_target(Handle<Code> target,
RelocInfo::Mode rmode, RelocInfo::Mode rmode,
......
...@@ -740,7 +740,7 @@ void MacroAssembler::CallApiFunctionAndReturn( ...@@ -740,7 +740,7 @@ void MacroAssembler::CallApiFunctionAndReturn(
bind(&profiler_disabled); bind(&profiler_disabled);
// Call the api function! // Call the api function!
movq(rax, reinterpret_cast<int64_t>(function_address), movq(rax, reinterpret_cast<Address>(function_address),
RelocInfo::EXTERNAL_REFERENCE); RelocInfo::EXTERNAL_REFERENCE);
bind(&end_profiler_check); bind(&end_profiler_check);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment