Chromium Code Reviews| Index: src/x64/assembler-x64.cc |
| diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
| index 9fe7b8392e7a3a55b188b8d2769ae3363b6172de..61f75596415860df653df2a3014696334f0fd962 100644 |
| --- a/src/x64/assembler-x64.cc |
| +++ b/src/x64/assembler-x64.cc |
| @@ -1456,31 +1456,25 @@ void Assembler::movq(Register dst, void* value, RelocInfo::Mode rmode) { |
| // This method must not be used with heap object references. The stored |
| // address is not GC safe. Use the handle version instead. |
| ASSERT(rmode > RelocInfo::LAST_GCED_ENUM); |
| - EnsureSpace ensure_space(this); |
| - emit_rex_64(dst); |
| - emit(0xB8 | dst.low_bits()); |
| - emitp(value, rmode); |
| -} |
| - |
| - |
| -void Assembler::movq(Register dst, int64_t value, RelocInfo::Mode rmode) { |
| - // Non-relocatable values might not need a 64-bit representation. |
| - ASSERT(RelocInfo::IsNone(rmode)); |
| - if (is_uint32(value)) { |
| - movl(dst, Immediate(static_cast<int32_t>(value))); |
| - } else if (is_int32(value)) { |
| - movq(dst, Immediate(static_cast<int32_t>(value))); |
| + if (RelocInfo::IsNone(rmode)) { |
| + movq(dst, reinterpret_cast<int64_t>(value)); |
| } else { |
| - // Value cannot be represented by 32 bits, so do a full 64 bit immediate |
| - // value. |
| EnsureSpace ensure_space(this); |
| emit_rex_64(dst); |
| emit(0xB8 | dst.low_bits()); |
| - emitq(value); |
| + emitp(value, rmode); |
| } |
| } |
| +void Assembler::movq(Register dst, int64_t value) { |
|
haitao.feng
2013/10/25 06:19:11
Use MacroAssembler::Set instruction if the value c
|
| + EnsureSpace ensure_space(this); |
| + emit_rex_64(dst); |
| + emit(0xB8 | dst.low_bits()); |
| + emitq(value); |
| +} |
| + |
| + |
| void Assembler::movq(Register dst, ExternalReference ref) { |
| Address value = reinterpret_cast<Address>(ref.address()); |
| movq(dst, value, RelocInfo::EXTERNAL_REFERENCE); |
| @@ -1521,21 +1515,13 @@ void Assembler::movl(const Operand& dst, Label* src) { |
| void Assembler::movq(Register dst, Handle<Object> value, RelocInfo::Mode mode) { |
| AllowDeferredHandleDereference using_raw_address; |
| - // If there is no relocation info, emit the value of the handle efficiently |
| - // (possibly using less that 8 bytes for the value). |
| - if (RelocInfo::IsNone(mode)) { |
| - // There is no possible reason to store a heap pointer without relocation |
| - // info, so it must be a smi. |
| - ASSERT(value->IsSmi()); |
| - movq(dst, reinterpret_cast<int64_t>(*value), RelocInfo::NONE64); |
| - } else { |
| - EnsureSpace ensure_space(this); |
| - ASSERT(value->IsHeapObject()); |
| - ASSERT(!isolate()->heap()->InNewSpace(*value)); |
| - emit_rex_64(dst); |
| - emit(0xB8 | dst.low_bits()); |
| - emitp(value.location(), mode); |
| - } |
| + ASSERT(!RelocInfo::IsNone(mode)); |
|
haitao.feng
2013/10/25 06:19:11
Currently SMI cases are all handled before calling
|
| + EnsureSpace ensure_space(this); |
| + ASSERT(value->IsHeapObject()); |
| + ASSERT(!isolate()->heap()->InNewSpace(*value)); |
| + emit_rex_64(dst); |
| + emit(0xB8 | dst.low_bits()); |
| + emitp(value.location(), mode); |
| } |