Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1564)

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 64453002: Refactor loading a pointer into a register instruction for X64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased with bleeding_edge Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 6c3f50163efeae7c1d6a447ff7950bb6367eec80..e160dbb7776bbac6ac8c8ffc0e69d8b48f3d0bc3 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -163,7 +163,7 @@ void MacroAssembler::PushAddress(ExternalReference source) {
int64_t address = reinterpret_cast<int64_t>(source.address());
if (is_int32(address) && !Serializer::enabled()) {
if (emit_debug_code()) {
- movq(kScratchRegister, kZapValue, RelocInfo::NONE64);
+ Move(kScratchRegister, kZapValue, RelocInfo::NONE64);
}
push(Immediate(static_cast<int32_t>(address)));
return;
@@ -288,7 +288,7 @@ void MacroAssembler::InNewSpace(Register object,
ASSERT(is_int32(static_cast<int64_t>(isolate()->heap()->NewSpaceMask())));
intptr_t new_space_start =
reinterpret_cast<intptr_t>(isolate()->heap()->NewSpaceStart());
- movq(kScratchRegister, reinterpret_cast<Address>(-new_space_start),
+ Move(kScratchRegister, reinterpret_cast<Address>(-new_space_start),
RelocInfo::NONE64);
if (scratch.is(object)) {
addq(scratch, kScratchRegister);
@@ -340,8 +340,8 @@ void MacroAssembler::RecordWriteField(
// Clobber clobbered input registers when running with the debug-code flag
// turned on to provoke errors.
if (emit_debug_code()) {
- movq(value, kZapValue, RelocInfo::NONE64);
- movq(dst, kZapValue, RelocInfo::NONE64);
+ Move(value, kZapValue, RelocInfo::NONE64);
+ Move(dst, kZapValue, RelocInfo::NONE64);
}
}
@@ -374,8 +374,8 @@ void MacroAssembler::RecordWriteArray(Register object,
// Clobber clobbered input registers when running with the debug-code flag
// turned on to provoke errors.
if (emit_debug_code()) {
- movq(value, kZapValue, RelocInfo::NONE64);
- movq(index, kZapValue, RelocInfo::NONE64);
+ Move(value, kZapValue, RelocInfo::NONE64);
+ Move(index, kZapValue, RelocInfo::NONE64);
}
}
@@ -439,8 +439,8 @@ void MacroAssembler::RecordWrite(Register object,
// Clobber clobbered registers when running with the debug-code flag
// turned on to provoke errors.
if (emit_debug_code()) {
- movq(address, kZapValue, RelocInfo::NONE64);
- movq(value, kZapValue, RelocInfo::NONE64);
+ Move(address, kZapValue, RelocInfo::NONE64);
+ Move(value, kZapValue, RelocInfo::NONE64);
}
}
@@ -528,9 +528,9 @@ void MacroAssembler::Abort(BailoutReason reason) {
#endif
push(rax);
- movq(kScratchRegister, reinterpret_cast<Smi*>(p0), RelocInfo::NONE64);
+ Move(kScratchRegister, reinterpret_cast<Smi*>(p0), RelocInfo::NONE64);
push(kScratchRegister);
- movq(kScratchRegister, Smi::FromInt(static_cast<int>(p1 - p0)),
+ Move(kScratchRegister, Smi::FromInt(static_cast<int>(p1 - p0)),
RelocInfo::NONE64);
push(kScratchRegister);
@@ -720,18 +720,18 @@ void MacroAssembler::CallApiFunctionAndReturn(
bool* is_profiling_flag =
isolate()->cpu_profiler()->is_profiling_address();
STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
- movq(rax, is_profiling_flag, RelocInfo::EXTERNAL_REFERENCE);
+ Move(rax, is_profiling_flag, RelocInfo::EXTERNAL_REFERENCE);
cmpb(Operand(rax, 0), Immediate(0));
j(zero, &profiler_disabled);
// Third parameter is the address of the actual getter function.
- movq(thunk_last_arg, function_address, RelocInfo::EXTERNAL_REFERENCE);
- movq(rax, thunk_address, RelocInfo::EXTERNAL_REFERENCE);
+ Move(thunk_last_arg, function_address, RelocInfo::EXTERNAL_REFERENCE);
+ Move(rax, thunk_address, RelocInfo::EXTERNAL_REFERENCE);
jmp(&end_profiler_check);
bind(&profiler_disabled);
// Call the api function!
- movq(rax, reinterpret_cast<Address>(function_address),
+ Move(rax, reinterpret_cast<Address>(function_address),
RelocInfo::EXTERNAL_REFERENCE);
bind(&end_profiler_check);
@@ -1043,7 +1043,7 @@ Register MacroAssembler::GetSmiConstant(Smi* source) {
void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) {
if (emit_debug_code()) {
- movq(dst, Smi::FromInt(kSmiConstantRegisterValue), RelocInfo::NONE64);
+ Move(dst, Smi::FromInt(kSmiConstantRegisterValue), RelocInfo::NONE64);
cmpq(dst, kSmiConstantRegister);
Assert(equal, kUninitializedKSmiConstantRegister);
}
@@ -1083,7 +1083,7 @@ void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) {
UNREACHABLE();
return;
default:
- movq(dst, source, RelocInfo::NONE64);
+ Move(dst, source, RelocInfo::NONE64);
return;
}
if (negative) {
@@ -2551,10 +2551,10 @@ void MacroAssembler::MoveHeapObject(Register result,
ASSERT(object->IsHeapObject());
if (isolate()->heap()->InNewSpace(*object)) {
Handle<Cell> cell = isolate()->factory()->NewCell(object);
- movq(result, cell, RelocInfo::CELL);
+ Move(result, cell, RelocInfo::CELL);
movq(result, Operand(result, 0));
} else {
- movq(result, object, RelocInfo::EMBEDDED_OBJECT);
+ Move(result, object, RelocInfo::EMBEDDED_OBJECT);
}
}
@@ -2564,7 +2564,7 @@ void MacroAssembler::LoadGlobalCell(Register dst, Handle<Cell> cell) {
AllowDeferredHandleDereference embedding_raw_address;
load_rax(cell.location(), RelocInfo::CELL);
} else {
- movq(dst, cell, RelocInfo::CELL);
+ Move(dst, cell, RelocInfo::CELL);
movq(dst, Operand(dst, 0));
}
}
@@ -2591,7 +2591,7 @@ void MacroAssembler::Jump(ExternalReference ext) {
void MacroAssembler::Jump(Address destination, RelocInfo::Mode rmode) {
- movq(kScratchRegister, destination, rmode);
+ Move(kScratchRegister, destination, rmode);
jmp(kScratchRegister);
}
@@ -2625,7 +2625,7 @@ void MacroAssembler::Call(Address destination, RelocInfo::Mode rmode) {
#ifdef DEBUG
int end_position = pc_offset() + CallSize(destination, rmode);
#endif
- movq(kScratchRegister, destination, rmode);
+ Move(kScratchRegister, destination, rmode);
call(kScratchRegister);
#ifdef DEBUG
CHECK_EQ(pc_offset(), end_position);
@@ -3667,7 +3667,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
if (!definitely_matches) {
Handle<Code> adaptor = isolate()->builtins()->ArgumentsAdaptorTrampoline();
if (!code_constant.is_null()) {
- movq(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT);
+ Move(rdx, code_constant, RelocInfo::EMBEDDED_OBJECT);
addq(rdx, Immediate(Code::kHeaderSize - kHeapObjectTag));
} else if (!code_register.is(rdx)) {
movq(rdx, code_register);
@@ -3719,10 +3719,10 @@ void MacroAssembler::EnterFrame(StackFrame::Type type) {
movq(rbp, rsp);
push(rsi); // Context.
Push(Smi::FromInt(type));
- movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
+ Move(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
push(kScratchRegister);
if (emit_debug_code()) {
- movq(kScratchRegister,
+ Move(kScratchRegister,
isolate()->factory()->undefined_value(),
RelocInfo::EMBEDDED_OBJECT);
cmpq(Operand(rsp, 0), kScratchRegister);
@@ -3755,7 +3755,7 @@ void MacroAssembler::EnterExitFramePrologue(bool save_rax) {
// Reserve room for entry stack pointer and push the code object.
ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
push(Immediate(0)); // Saved entry sp, patched before call.
- movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
+ Move(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
push(kScratchRegister); // Accessed from EditFrame::code_slot.
// Save the frame pointer and the context in top.
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698