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

Introduce Push and Pop macro instructions for x64

R=verwaest@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20049 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1a6f977d
...@@ -1769,14 +1769,14 @@ void Assembler::Nop(int n) { ...@@ -1769,14 +1769,14 @@ void Assembler::Nop(int n) {
} }
void Assembler::pop(Register dst) { void Assembler::popq(Register dst) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
emit_optional_rex_32(dst); emit_optional_rex_32(dst);
emit(0x58 | dst.low_bits()); emit(0x58 | dst.low_bits());
} }
void Assembler::pop(const Operand& dst) { void Assembler::popq(const Operand& dst) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
emit_optional_rex_32(dst); emit_optional_rex_32(dst);
emit(0x8F); emit(0x8F);
...@@ -1790,14 +1790,14 @@ void Assembler::popfq() { ...@@ -1790,14 +1790,14 @@ void Assembler::popfq() {
} }
void Assembler::push(Register src) { void Assembler::pushq(Register src) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
emit_optional_rex_32(src); emit_optional_rex_32(src);
emit(0x50 | src.low_bits()); emit(0x50 | src.low_bits());
} }
void Assembler::push(const Operand& src) { void Assembler::pushq(const Operand& src) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
emit_optional_rex_32(src); emit_optional_rex_32(src);
emit(0xFF); emit(0xFF);
...@@ -1805,7 +1805,7 @@ void Assembler::push(const Operand& src) { ...@@ -1805,7 +1805,7 @@ void Assembler::push(const Operand& src) {
} }
void Assembler::push(Immediate value) { void Assembler::pushq(Immediate value) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
if (is_int8(value.value_)) { if (is_int8(value.value_)) {
emit(0x6A); emit(0x6A);
...@@ -1817,7 +1817,7 @@ void Assembler::push(Immediate value) { ...@@ -1817,7 +1817,7 @@ void Assembler::push(Immediate value) {
} }
void Assembler::push_imm32(int32_t imm32) { void Assembler::pushq_imm32(int32_t imm32) {
EnsureSpace ensure_space(this); EnsureSpace ensure_space(this);
emit(0x68); emit(0x68);
emitl(imm32); emitl(imm32);
......
...@@ -693,15 +693,15 @@ class Assembler : public AssemblerBase { ...@@ -693,15 +693,15 @@ class Assembler : public AssemblerBase {
void pushfq(); void pushfq();
void popfq(); void popfq();
void push(Immediate value); void pushq(Immediate value);
// Push a 32 bit integer, and guarantee that it is actually pushed as a // Push a 32 bit integer, and guarantee that it is actually pushed as a
// 32 bit value, the normal push will optimize the 8 bit case. // 32 bit value, the normal push will optimize the 8 bit case.
void push_imm32(int32_t imm32); void pushq_imm32(int32_t imm32);
void push(Register src); void pushq(Register src);
void push(const Operand& src); void pushq(const Operand& src);
void pop(Register dst); void popq(Register dst);
void pop(const Operand& dst); void popq(const Operand& dst);
void enter(Immediate size); void enter(Immediate size);
void leave(); void leave();
......
This diff is collapsed.
This diff is collapsed.
...@@ -305,19 +305,19 @@ class RecordWriteStub: public PlatformCodeStub { ...@@ -305,19 +305,19 @@ class RecordWriteStub: public PlatformCodeStub {
// We don't have to save scratch0_orig_ because it was given to us as // We don't have to save scratch0_orig_ because it was given to us as
// a scratch register. But if we had to switch to a different reg then // a scratch register. But if we had to switch to a different reg then
// we should save the new scratch0_. // we should save the new scratch0_.
if (!scratch0_.is(scratch0_orig_)) masm->push(scratch0_); if (!scratch0_.is(scratch0_orig_)) masm->Push(scratch0_);
if (!rcx.is(scratch0_orig_) && if (!rcx.is(scratch0_orig_) &&
!rcx.is(object_orig_) && !rcx.is(object_orig_) &&
!rcx.is(address_orig_)) { !rcx.is(address_orig_)) {
masm->push(rcx); masm->Push(rcx);
} }
masm->push(scratch1_); masm->Push(scratch1_);
if (!address_.is(address_orig_)) { if (!address_.is(address_orig_)) {
masm->push(address_); masm->Push(address_);
masm->movp(address_, address_orig_); masm->movp(address_, address_orig_);
} }
if (!object_.is(object_orig_)) { if (!object_.is(object_orig_)) {
masm->push(object_); masm->Push(object_);
masm->movp(object_, object_orig_); masm->movp(object_, object_orig_);
} }
} }
...@@ -328,19 +328,19 @@ class RecordWriteStub: public PlatformCodeStub { ...@@ -328,19 +328,19 @@ class RecordWriteStub: public PlatformCodeStub {
// one, since only one of them can alias with rcx. // one, since only one of them can alias with rcx.
if (!object_.is(object_orig_)) { if (!object_.is(object_orig_)) {
masm->movp(object_orig_, object_); masm->movp(object_orig_, object_);
masm->pop(object_); masm->Pop(object_);
} }
if (!address_.is(address_orig_)) { if (!address_.is(address_orig_)) {
masm->movp(address_orig_, address_); masm->movp(address_orig_, address_);
masm->pop(address_); masm->Pop(address_);
} }
masm->pop(scratch1_); masm->Pop(scratch1_);
if (!rcx.is(scratch0_orig_) && if (!rcx.is(scratch0_orig_) &&
!rcx.is(object_orig_) && !rcx.is(object_orig_) &&
!rcx.is(address_orig_)) { !rcx.is(address_orig_)) {
masm->pop(rcx); masm->Pop(rcx);
} }
if (!scratch0_.is(scratch0_orig_)) masm->pop(scratch0_); if (!scratch0_.is(scratch0_orig_)) masm->Pop(scratch0_);
} }
// If we have to call into C then we need to save and restore all caller- // If we have to call into C then we need to save and restore all caller-
......
...@@ -66,13 +66,13 @@ UnaryMathFunction CreateExpFunction() { ...@@ -66,13 +66,13 @@ UnaryMathFunction CreateExpFunction() {
// xmm0: raw double input. // xmm0: raw double input.
XMMRegister input = xmm0; XMMRegister input = xmm0;
XMMRegister result = xmm1; XMMRegister result = xmm1;
__ push(rax); __ pushq(rax);
__ push(rbx); __ pushq(rbx);
MathExpGenerator::EmitMathExp(&masm, input, result, xmm2, rax, rbx); MathExpGenerator::EmitMathExp(&masm, input, result, xmm2, rax, rbx);
__ pop(rbx); __ popq(rbx);
__ pop(rax); __ popq(rax);
__ movsd(xmm0, result); __ movsd(xmm0, result);
__ Ret(); __ Ret();
...@@ -381,7 +381,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( ...@@ -381,7 +381,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
__ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex);
__ j(equal, &only_change_map); __ j(equal, &only_change_map);
__ push(rax); __ Push(rax);
__ movp(r8, FieldOperand(rdx, JSObject::kElementsOffset)); __ movp(r8, FieldOperand(rdx, JSObject::kElementsOffset));
__ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset));
...@@ -404,7 +404,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( ...@@ -404,7 +404,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
// Call into runtime if GC is required. // Call into runtime if GC is required.
__ bind(&gc_required); __ bind(&gc_required);
__ pop(rax); __ Pop(rax);
__ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
__ jmp(fail); __ jmp(fail);
...@@ -458,7 +458,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( ...@@ -458,7 +458,7 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
kDontSaveFPRegs, kDontSaveFPRegs,
EMIT_REMEMBERED_SET, EMIT_REMEMBERED_SET,
OMIT_SMI_CHECK); OMIT_SMI_CHECK);
__ pop(rax); __ Pop(rax);
__ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
__ bind(&only_change_map); __ bind(&only_change_map);
...@@ -640,10 +640,10 @@ static byte* GetNoCodeAgeSequence(uint32_t* length) { ...@@ -640,10 +640,10 @@ static byte* GetNoCodeAgeSequence(uint32_t* length) {
// following boilerplate stack-building prologue that is found both in // following boilerplate stack-building prologue that is found both in
// FUNCTION and OPTIMIZED_FUNCTION code: // FUNCTION and OPTIMIZED_FUNCTION code:
CodePatcher patcher(sequence, kNoCodeAgeSequenceLength); CodePatcher patcher(sequence, kNoCodeAgeSequenceLength);
patcher.masm()->push(rbp); patcher.masm()->pushq(rbp);
patcher.masm()->movp(rbp, rsp); patcher.masm()->movp(rbp, rsp);
patcher.masm()->push(rsi); patcher.masm()->Push(rsi);
patcher.masm()->push(rdi); patcher.masm()->Push(rdi);
initialized = true; initialized = true;
} }
return sequence; return sequence;
......
...@@ -121,7 +121,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm, ...@@ -121,7 +121,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
Register reg = { r }; Register reg = { r };
ASSERT(!reg.is(kScratchRegister)); ASSERT(!reg.is(kScratchRegister));
if ((object_regs & (1 << r)) != 0) { if ((object_regs & (1 << r)) != 0) {
__ push(reg); __ Push(reg);
} }
if ((non_object_regs & (1 << r)) != 0) { if ((non_object_regs & (1 << r)) != 0) {
__ PushInt64AsTwoSmis(reg); __ PushInt64AsTwoSmis(reg);
...@@ -145,7 +145,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm, ...@@ -145,7 +145,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
__ Set(reg, kDebugZapValue); __ Set(reg, kDebugZapValue);
} }
if ((object_regs & (1 << r)) != 0) { if ((object_regs & (1 << r)) != 0) {
__ pop(reg); __ Pop(reg);
} }
// Reconstruct the 64-bit value from two smis. // Reconstruct the 64-bit value from two smis.
if ((non_object_regs & (1 << r)) != 0) { if ((non_object_regs & (1 << r)) != 0) {
...@@ -154,7 +154,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm, ...@@ -154,7 +154,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
} }
// Read current padding counter and skip corresponding number of words. // Read current padding counter and skip corresponding number of words.
__ pop(kScratchRegister); __ Pop(kScratchRegister);
__ SmiToInteger32(kScratchRegister, kScratchRegister); __ SmiToInteger32(kScratchRegister, kScratchRegister);
__ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0));
...@@ -329,8 +329,8 @@ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { ...@@ -329,8 +329,8 @@ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
// We do not know our frame height, but set rsp based on rbp. // We do not know our frame height, but set rsp based on rbp.
__ lea(rsp, Operand(rbp, -1 * kPointerSize)); __ lea(rsp, Operand(rbp, -1 * kPointerSize));
__ pop(rdi); // Function. __ Pop(rdi); // Function.
__ pop(rbp); __ popq(rbp);
// Load context from the function. // Load context from the function.
__ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
......
...@@ -179,7 +179,7 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -179,7 +179,7 @@ void Deoptimizer::EntryGenerator::Generate() {
// to restore all later. // to restore all later.
for (int i = 0; i < kNumberOfRegisters; i++) { for (int i = 0; i < kNumberOfRegisters; i++) {
Register r = Register::from_code(i); Register r = Register::from_code(i);
__ push(r); __ pushq(r);
} }
const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize + const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize +
...@@ -230,14 +230,14 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -230,14 +230,14 @@ void Deoptimizer::EntryGenerator::Generate() {
// Fill in the input registers. // Fill in the input registers.
for (int i = kNumberOfRegisters -1; i >= 0; i--) { for (int i = kNumberOfRegisters -1; i >= 0; i--) {
int offset = (i * kPointerSize) + FrameDescription::registers_offset(); int offset = (i * kPointerSize) + FrameDescription::registers_offset();
__ pop(Operand(rbx, offset)); __ Pop(Operand(rbx, offset));
} }
// Fill in the double input registers. // Fill in the double input registers.
int double_regs_offset = FrameDescription::double_registers_offset(); int double_regs_offset = FrameDescription::double_registers_offset();
for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) {
int dst_offset = i * kDoubleSize + double_regs_offset; int dst_offset = i * kDoubleSize + double_regs_offset;
__ pop(Operand(rbx, dst_offset)); __ popq(Operand(rbx, dst_offset));
} }
// Remove the bailout id and return address from the stack. // Remove the bailout id and return address from the stack.
...@@ -256,14 +256,14 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -256,14 +256,14 @@ void Deoptimizer::EntryGenerator::Generate() {
__ jmp(&pop_loop_header); __ jmp(&pop_loop_header);
Label pop_loop; Label pop_loop;
__ bind(&pop_loop); __ bind(&pop_loop);
__ pop(Operand(rdx, 0)); __ Pop(Operand(rdx, 0));
__ addq(rdx, Immediate(sizeof(intptr_t))); __ addq(rdx, Immediate(sizeof(intptr_t)));
__ bind(&pop_loop_header); __ bind(&pop_loop_header);
__ cmpq(rcx, rsp); __ cmpq(rcx, rsp);
__ j(not_equal, &pop_loop); __ j(not_equal, &pop_loop);
// Compute the output frame in the deoptimizer. // Compute the output frame in the deoptimizer.
__ push(rax); __ pushq(rax);
__ PrepareCallCFunction(2); __ PrepareCallCFunction(2);
__ movp(arg_reg_1, rax); __ movp(arg_reg_1, rax);
__ LoadAddress(arg_reg_2, ExternalReference::isolate_address(isolate())); __ LoadAddress(arg_reg_2, ExternalReference::isolate_address(isolate()));
...@@ -272,7 +272,7 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -272,7 +272,7 @@ void Deoptimizer::EntryGenerator::Generate() {
__ CallCFunction( __ CallCFunction(
ExternalReference::compute_output_frames_function(isolate()), 2); ExternalReference::compute_output_frames_function(isolate()), 2);
} }
__ pop(rax); __ popq(rax);
// Replace the current frame with the output frames. // Replace the current frame with the output frames.
Label outer_push_loop, inner_push_loop, Label outer_push_loop, inner_push_loop,
...@@ -290,7 +290,7 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -290,7 +290,7 @@ void Deoptimizer::EntryGenerator::Generate() {
__ jmp(&inner_loop_header); __ jmp(&inner_loop_header);
__ bind(&inner_push_loop); __ bind(&inner_push_loop);
__ subq(rcx, Immediate(sizeof(intptr_t))); __ subq(rcx, Immediate(sizeof(intptr_t)));
__ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); __ Push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset()));
__ bind(&inner_loop_header); __ bind(&inner_loop_header);
__ testq(rcx, rcx); __ testq(rcx, rcx);
__ j(not_zero, &inner_push_loop); __ j(not_zero, &inner_push_loop);
...@@ -306,14 +306,14 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -306,14 +306,14 @@ void Deoptimizer::EntryGenerator::Generate() {
} }
// Push state, pc, and continuation from the last output frame. // Push state, pc, and continuation from the last output frame.
__ push(Operand(rbx, FrameDescription::state_offset())); __ Push(Operand(rbx, FrameDescription::state_offset()));
__ push(Operand(rbx, FrameDescription::pc_offset())); __ Push(Operand(rbx, FrameDescription::pc_offset()));
__ push(Operand(rbx, FrameDescription::continuation_offset())); __ Push(Operand(rbx, FrameDescription::continuation_offset()));
// Push the registers from the last output frame. // Push the registers from the last output frame.
for (int i = 0; i < kNumberOfRegisters; i++) { for (int i = 0; i < kNumberOfRegisters; i++) {
int offset = (i * kPointerSize) + FrameDescription::registers_offset(); int offset = (i * kPointerSize) + FrameDescription::registers_offset();
__ push(Operand(rbx, offset)); __ Push(Operand(rbx, offset));
} }
// Restore the registers from the stack. // Restore the registers from the stack.
...@@ -325,7 +325,7 @@ void Deoptimizer::EntryGenerator::Generate() { ...@@ -325,7 +325,7 @@ void Deoptimizer::EntryGenerator::Generate() {
ASSERT(i > 0); ASSERT(i > 0);
r = Register::from_code(i - 1); r = Register::from_code(i - 1);
} }
__ pop(r); __ popq(r);
} }
// Set up the roots register. // Set up the roots register.
...@@ -343,7 +343,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() { ...@@ -343,7 +343,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
for (int i = 0; i < count(); i++) { for (int i = 0; i < count(); i++) {
int start = masm()->pc_offset(); int start = masm()->pc_offset();
USE(start); USE(start);
__ push_imm32(i); __ pushq_imm32(i);
__ jmp(&done); __ jmp(&done);
ASSERT(masm()->pc_offset() - start == table_entry_size_); ASSERT(masm()->pc_offset() - start == table_entry_size_);
} }
......
This diff is collapsed.
...@@ -571,8 +571,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { ...@@ -571,8 +571,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
// Everything is fine, call runtime. // Everything is fine, call runtime.
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rax); // key __ Push(rax); // key
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
// Perform tail call to the entry. // Perform tail call to the entry.
...@@ -1021,8 +1021,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { ...@@ -1021,8 +1021,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
__ IncrementCounter(counters->load_miss(), 1); __ IncrementCounter(counters->load_miss(), 1);
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rax); // receiver __ Push(rax); // receiver
__ push(rcx); // name __ Push(rcx); // name
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Perform tail call to the entry. // Perform tail call to the entry.
...@@ -1040,8 +1040,8 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { ...@@ -1040,8 +1040,8 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rax); // receiver __ Push(rax); // receiver
__ push(rcx); // name __ Push(rcx); // name
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Perform tail call to the entry. // Perform tail call to the entry.
...@@ -1060,8 +1060,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { ...@@ -1060,8 +1060,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
__ IncrementCounter(counters->keyed_load_miss(), 1); __ IncrementCounter(counters->keyed_load_miss(), 1);
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rax); // name __ Push(rax); // name
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Perform tail call to the entry. // Perform tail call to the entry.
...@@ -1079,8 +1079,8 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { ...@@ -1079,8 +1079,8 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rax); // name __ Push(rax); // name
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Perform tail call to the entry. // Perform tail call to the entry.
...@@ -1115,9 +1115,9 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -1115,9 +1115,9 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) {
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rcx); // name __ Push(rcx); // name
__ push(rax); // value __ Push(rax); // value
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Perform tail call to the entry. // Perform tail call to the entry.
...@@ -1159,9 +1159,9 @@ void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, ...@@ -1159,9 +1159,9 @@ void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
// -- rsp[0] : return address // -- rsp[0] : return address
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); __ Push(rdx);
__ push(rcx); __ Push(rcx);
__ push(rax); __ Push(rax);
__ Push(Smi::FromInt(NONE)); // PropertyAttributes __ Push(Smi::FromInt(NONE)); // PropertyAttributes
__ Push(Smi::FromInt(strict_mode)); __ Push(Smi::FromInt(strict_mode));
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
...@@ -1181,9 +1181,9 @@ void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm, ...@@ -1181,9 +1181,9 @@ void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rcx); // key __ Push(rcx); // key
__ push(rax); // value __ Push(rax); // value
__ Push(Smi::FromInt(NONE)); // PropertyAttributes __ Push(Smi::FromInt(NONE)); // PropertyAttributes
__ Push(Smi::FromInt(strict_mode)); // Strict mode. __ Push(Smi::FromInt(strict_mode)); // Strict mode.
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
...@@ -1202,9 +1202,9 @@ void StoreIC::GenerateSlow(MacroAssembler* masm) { ...@@ -1202,9 +1202,9 @@ void StoreIC::GenerateSlow(MacroAssembler* masm) {
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rcx); // key __ Push(rcx); // key
__ push(rax); // value __ Push(rax); // value
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Do tail-call to runtime routine. // Do tail-call to runtime routine.
...@@ -1222,9 +1222,9 @@ void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) { ...@@ -1222,9 +1222,9 @@ void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rcx); // key __ Push(rcx); // key
__ push(rax); // value __ Push(rax); // value
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Do tail-call to runtime routine. // Do tail-call to runtime routine.
...@@ -1242,9 +1242,9 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -1242,9 +1242,9 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
// ----------------------------------- // -----------------------------------
__ PopReturnAddressTo(rbx); __ PopReturnAddressTo(rbx);
__ push(rdx); // receiver __ Push(rdx); // receiver
__ push(rcx); // key __ Push(rcx); // key
__ push(rax); // value __ Push(rax); // value
__ PushReturnAddressFrom(rbx); __ PushReturnAddressFrom(rbx);
// Do tail-call to runtime routine. // Do tail-call to runtime routine.
......
This diff is collapsed.
This diff is collapsed.
...@@ -837,10 +837,14 @@ class MacroAssembler: public Assembler { ...@@ -837,10 +837,14 @@ class MacroAssembler: public Assembler {
void Drop(int stack_elements); void Drop(int stack_elements);
void Call(Label* target) { call(target); } void Call(Label* target) { call(target); }
void Push(Register src) { push(src); } void Push(Register src);
void Pop(Register dst) { pop(dst); } void Push(const Operand& src);
void PushReturnAddressFrom(Register src) { push(src); } void Push(Immediate value);
void PopReturnAddressTo(Register dst) { pop(dst); } void PushImm32(int32_t imm32);
void Pop(Register dst);
void Pop(const Operand& dst);
void PushReturnAddressFrom(Register src) { pushq(src); }
void PopReturnAddressTo(Register dst) { popq(dst); }
void Move(Register dst, ExternalReference ext) { void Move(Register dst, ExternalReference ext) {
movp(dst, reinterpret_cast<Address>(ext.address()), movp(dst, reinterpret_cast<Address>(ext.address()),
RelocInfo::EXTERNAL_REFERENCE); RelocInfo::EXTERNAL_REFERENCE);
...@@ -1608,9 +1612,9 @@ extern void LogGeneratedCodeCoverage(const char* file_line); ...@@ -1608,9 +1612,9 @@ extern void LogGeneratedCodeCoverage(const char* file_line);
Address x64_coverage_function = FUNCTION_ADDR(LogGeneratedCodeCoverage); \ Address x64_coverage_function = FUNCTION_ADDR(LogGeneratedCodeCoverage); \
masm->pushfq(); \ masm->pushfq(); \
masm->Pushad(); \ masm->Pushad(); \
masm->push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \ masm->Push(Immediate(reinterpret_cast<int>(&__FILE_LINE__))); \
masm->Call(x64_coverage_function, RelocInfo::EXTERNAL_REFERENCE); \ masm->Call(x64_coverage_function, RelocInfo::EXTERNAL_REFERENCE); \
masm->pop(rax); \ masm->Pop(rax); \
masm->Popad(); \ masm->Popad(); \
masm->popfq(); \ masm->popfq(); \
} \ } \
......
...@@ -322,10 +322,10 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase( ...@@ -322,10 +322,10 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase(
// Save important/volatile registers before calling C function. // Save important/volatile registers before calling C function.
#ifndef _WIN64 #ifndef _WIN64
// Caller save on Linux and callee save in Windows. // Caller save on Linux and callee save in Windows.
__ push(rsi); __ pushq(rsi);
__ push(rdi); __ pushq(rdi);
#endif #endif
__ push(backtrack_stackpointer()); __ pushq(backtrack_stackpointer());
static const int num_arguments = 4; static const int num_arguments = 4;
__ PrepareCallCFunction(num_arguments); __ PrepareCallCFunction(num_arguments);
...@@ -367,10 +367,10 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase( ...@@ -367,10 +367,10 @@ void RegExpMacroAssemblerX64::CheckNotBackReferenceIgnoreCase(
// Restore original values before reacting on result value. // Restore original values before reacting on result value.
__ Move(code_object_pointer(), masm_.CodeObject()); __ Move(code_object_pointer(), masm_.CodeObject());
__ pop(backtrack_stackpointer()); __ popq(backtrack_stackpointer());
#ifndef _WIN64 #ifndef _WIN64
__ pop(rdi); __ popq(rdi);
__ pop(rsi); __ popq(rsi);
#endif #endif
// Check if function returned non-zero for success or zero for failure. // Check if function returned non-zero for success or zero for failure.
...@@ -674,7 +674,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -674,7 +674,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
FrameScope scope(&masm_, StackFrame::MANUAL); FrameScope scope(&masm_, StackFrame::MANUAL);
// Actually emit code to start a new stack frame. // Actually emit code to start a new stack frame.
__ push(rbp); __ pushq(rbp);
__ movp(rbp, rsp); __ movp(rbp, rsp);
// Save parameters and callee-save registers. Order here should correspond // Save parameters and callee-save registers. Order here should correspond
// to order of kBackup_ebx etc. // to order of kBackup_ebx etc.
...@@ -686,9 +686,9 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -686,9 +686,9 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
__ movq(Operand(rbp, kInputStart), r8); __ movq(Operand(rbp, kInputStart), r8);
__ movq(Operand(rbp, kInputEnd), r9); __ movq(Operand(rbp, kInputEnd), r9);
// Callee-save on Win64. // Callee-save on Win64.
__ push(rsi); __ pushq(rsi);
__ push(rdi); __ pushq(rdi);
__ push(rbx); __ pushq(rbx);
#else #else
// GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9 (and then on stack). // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9 (and then on stack).
// Push register parameters on stack for reference. // Push register parameters on stack for reference.
...@@ -698,18 +698,18 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -698,18 +698,18 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
ASSERT_EQ(kInputEnd, -4 * kPointerSize); ASSERT_EQ(kInputEnd, -4 * kPointerSize);
ASSERT_EQ(kRegisterOutput, -5 * kPointerSize); ASSERT_EQ(kRegisterOutput, -5 * kPointerSize);
ASSERT_EQ(kNumOutputRegisters, -6 * kPointerSize); ASSERT_EQ(kNumOutputRegisters, -6 * kPointerSize);
__ push(rdi); __ pushq(rdi);
__ push(rsi); __ pushq(rsi);
__ push(rdx); __ pushq(rdx);
__ push(rcx); __ pushq(rcx);
__ push(r8); __ pushq(r8);
__ push(r9); __ pushq(r9);
__ push(rbx); // Callee-save __ pushq(rbx); // Callee-save
#endif #endif
__ push(Immediate(0)); // Number of successful matches in a global regexp. __ Push(Immediate(0)); // Number of successful matches in a global regexp.
__ push(Immediate(0)); // Make room for "input start - 1" constant. __ Push(Immediate(0)); // Make room for "input start - 1" constant.
// Check if we have space on the stack for registers. // Check if we have space on the stack for registers.
Label stack_limit_hit; Label stack_limit_hit;
...@@ -897,9 +897,9 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -897,9 +897,9 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
#ifdef _WIN64 #ifdef _WIN64
// Restore callee save registers. // Restore callee save registers.
__ lea(rsp, Operand(rbp, kLastCalleeSaveRegister)); __ lea(rsp, Operand(rbp, kLastCalleeSaveRegister));
__ pop(rbx); __ popq(rbx);
__ pop(rdi); __ popq(rdi);
__ pop(rsi); __ popq(rsi);
// Stack now at rbp. // Stack now at rbp.
#else #else
// Restore callee save register. // Restore callee save register.
...@@ -908,7 +908,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -908,7 +908,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
__ movp(rsp, rbp); __ movp(rsp, rbp);
#endif #endif
// Exit function frame, restore previous one. // Exit function frame, restore previous one.
__ pop(rbp); __ popq(rbp);
__ ret(0); __ ret(0);
// Backtrack code (branch target for conditional backtracks). // Backtrack code (branch target for conditional backtracks).
...@@ -923,8 +923,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -923,8 +923,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
if (check_preempt_label_.is_linked()) { if (check_preempt_label_.is_linked()) {
SafeCallTarget(&check_preempt_label_); SafeCallTarget(&check_preempt_label_);
__ push(backtrack_stackpointer()); __ pushq(backtrack_stackpointer());
__ push(rdi); __ pushq(rdi);
CallCheckStackGuardState(); CallCheckStackGuardState();
__ testq(rax, rax); __ testq(rax, rax);
...@@ -934,8 +934,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -934,8 +934,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
// Restore registers. // Restore registers.
__ Move(code_object_pointer(), masm_.CodeObject()); __ Move(code_object_pointer(), masm_.CodeObject());
__ pop(rdi); __ popq(rdi);
__ pop(backtrack_stackpointer()); __ popq(backtrack_stackpointer());
// String might have moved: Reload esi from frame. // String might have moved: Reload esi from frame.
__ movp(rsi, Operand(rbp, kInputEnd)); __ movp(rsi, Operand(rbp, kInputEnd));
SafeReturn(); SafeReturn();
...@@ -950,8 +950,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -950,8 +950,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
// Save registers before calling C function // Save registers before calling C function
#ifndef _WIN64 #ifndef _WIN64
// Callee-save in Microsoft 64-bit ABI, but not in AMD64 ABI. // Callee-save in Microsoft 64-bit ABI, but not in AMD64 ABI.
__ push(rsi); __ pushq(rsi);
__ push(rdi); __ pushq(rdi);
#endif #endif
// Call GrowStack(backtrack_stackpointer()) // Call GrowStack(backtrack_stackpointer())
...@@ -980,8 +980,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { ...@@ -980,8 +980,8 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
// Restore saved registers and continue. // Restore saved registers and continue.
__ Move(code_object_pointer(), masm_.CodeObject()); __ Move(code_object_pointer(), masm_.CodeObject());
#ifndef _WIN64 #ifndef _WIN64
__ pop(rdi); __ popq(rdi);
__ pop(rsi); __ popq(rsi);
#endif #endif
SafeReturn(); SafeReturn();
} }
......
...@@ -49,10 +49,12 @@ static void ProbeTable(Isolate* isolate, ...@@ -49,10 +49,12 @@ static void ProbeTable(Isolate* isolate,
// The offset is scaled by 4, based on // The offset is scaled by 4, based on
// kHeapObjectTagSize, which is two bits // kHeapObjectTagSize, which is two bits
Register offset) { Register offset) {
// We need to scale up the pointer by 2 because the offset is scaled by less // We need to scale up the pointer by 2 when the offset is scaled by less
// than the pointer size. // than the pointer size.
ASSERT(kPointerSizeLog2 == kHeapObjectTagSize + 1); ASSERT(kPointerSize == kInt64Size
ScaleFactor scale_factor = times_2; ? kPointerSizeLog2 == kHeapObjectTagSize + 1
: kPointerSizeLog2 == kHeapObjectTagSize);
ScaleFactor scale_factor = kPointerSize == kInt64Size ? times_2 : times_1;
ASSERT_EQ(3 * kPointerSize, sizeof(StubCache::Entry)); ASSERT_EQ(3 * kPointerSize, sizeof(StubCache::Entry));
// The offset register holds the entry offset times four (due to masking // The offset register holds the entry offset times four (due to masking
...@@ -320,13 +322,13 @@ static void PushInterceptorArguments(MacroAssembler* masm, ...@@ -320,13 +322,13 @@ static void PushInterceptorArguments(MacroAssembler* masm,
STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2); STATIC_ASSERT(StubCache::kInterceptorArgsThisIndex == 2);
STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3); STATIC_ASSERT(StubCache::kInterceptorArgsHolderIndex == 3);
STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4); STATIC_ASSERT(StubCache::kInterceptorArgsLength == 4);
__ push(name); __ Push(name);
Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor()); Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor)); ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
__ Move(kScratchRegister, interceptor); __ Move(kScratchRegister, interceptor);
__ push(kScratchRegister); __ Push(kScratchRegister);
__ push(receiver); __ Push(receiver);
__ push(holder); __ Push(holder);
} }
...@@ -357,13 +359,13 @@ void StubCompiler::GenerateFastApiCall(MacroAssembler* masm, ...@@ -357,13 +359,13 @@ void StubCompiler::GenerateFastApiCall(MacroAssembler* masm,
__ PopReturnAddressTo(scratch_in); __ PopReturnAddressTo(scratch_in);
// receiver // receiver
__ push(receiver); __ Push(receiver);
// Write the arguments to stack frame. // Write the arguments to stack frame.
for (int i = 0; i < argc; i++) { for (int i = 0; i < argc; i++) {
Register arg = values[argc-1-i]; Register arg = values[argc-1-i];
ASSERT(!receiver.is(arg)); ASSERT(!receiver.is(arg));
ASSERT(!scratch_in.is(arg)); ASSERT(!scratch_in.is(arg));
__ push(arg); __ Push(arg);
} }
__ PushReturnAddressFrom(scratch_in); __ PushReturnAddressFrom(scratch_in);
// Stack now matches JSFunction abi. // Stack now matches JSFunction abi.
...@@ -521,9 +523,9 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, ...@@ -521,9 +523,9 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
// The properties must be extended before we can store the value. // The properties must be extended before we can store the value.
// We jump to a runtime call that extends the properties array. // We jump to a runtime call that extends the properties array.
__ PopReturnAddressTo(scratch1); __ PopReturnAddressTo(scratch1);
__ push(receiver_reg); __ Push(receiver_reg);
__ Push(transition); __ Push(transition);
__ push(value_reg); __ Push(value_reg);
__ PushReturnAddressFrom(scratch1); __ PushReturnAddressFrom(scratch1);
__ TailCallExternalReference( __ TailCallExternalReference(
ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
...@@ -933,22 +935,22 @@ void LoadStubCompiler::GenerateLoadCallback( ...@@ -933,22 +935,22 @@ void LoadStubCompiler::GenerateLoadCallback(
STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4); STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5); STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6); STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6);
__ push(receiver()); // receiver __ Push(receiver()); // receiver
if (heap()->InNewSpace(callback->data())) { if (heap()->InNewSpace(callback->data())) {
ASSERT(!scratch2().is(reg)); ASSERT(!scratch2().is(reg));
__ Move(scratch2(), callback); __ Move(scratch2(), callback);
__ push(FieldOperand(scratch2(), __ Push(FieldOperand(scratch2(),
ExecutableAccessorInfo::kDataOffset)); // data ExecutableAccessorInfo::kDataOffset)); // data
} else { } else {
__ Push(Handle<Object>(callback->data(), isolate())); __ Push(Handle<Object>(callback->data(), isolate()));
} }
ASSERT(!kScratchRegister.is(reg)); ASSERT(!kScratchRegister.is(reg));
__ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
__ push(kScratchRegister); // return value __ Push(kScratchRegister); // return value
__ push(kScratchRegister); // return value default __ Push(kScratchRegister); // return value default
__ PushAddress(ExternalReference::isolate_address(isolate())); __ PushAddress(ExternalReference::isolate_address(isolate()));
__ push(reg); // holder __ Push(reg); // holder
__ push(name()); // name __ Push(name()); // name
// Save a pointer to where we pushed the arguments pointer. This will be // Save a pointer to where we pushed the arguments pointer. This will be
// passed as the const PropertyAccessorInfo& to the C++ callback. // passed as the const PropertyAccessorInfo& to the C++ callback.
...@@ -1016,10 +1018,10 @@ void LoadStubCompiler::GenerateLoadInterceptor( ...@@ -1016,10 +1018,10 @@ void LoadStubCompiler::GenerateLoadInterceptor(
FrameScope frame_scope(masm(), StackFrame::INTERNAL); FrameScope frame_scope(masm(), StackFrame::INTERNAL);
if (must_preserve_receiver_reg) { if (must_preserve_receiver_reg) {
__ push(receiver()); __ Push(receiver());
} }
__ push(holder_reg); __ Push(holder_reg);
__ push(this->name()); __ Push(this->name());
// Invoke an interceptor. Note: map checks from receiver to // Invoke an interceptor. Note: map checks from receiver to
// interceptor's holder has been compiled before (see a caller // interceptor's holder has been compiled before (see a caller
...@@ -1037,10 +1039,10 @@ void LoadStubCompiler::GenerateLoadInterceptor( ...@@ -1037,10 +1039,10 @@ void LoadStubCompiler::GenerateLoadInterceptor(
__ ret(0); __ ret(0);
__ bind(&interceptor_failed); __ bind(&interceptor_failed);
__ pop(this->name()); __ Pop(this->name());
__ pop(holder_reg); __ Pop(holder_reg);
if (must_preserve_receiver_reg) { if (must_preserve_receiver_reg) {
__ pop(receiver()); __ Pop(receiver());
} }
// Leave the internal frame. // Leave the internal frame.
...@@ -1082,11 +1084,11 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -1082,11 +1084,11 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
IC::CurrentTypeOf(object, isolate()), receiver(), holder, name); IC::CurrentTypeOf(object, isolate()), receiver(), holder, name);
__ PopReturnAddressTo(scratch1()); __ PopReturnAddressTo(scratch1());
__ push(receiver()); __ Push(receiver());
__ push(holder_reg); __ Push(holder_reg);
__ Push(callback); // callback info __ Push(callback); // callback info
__ Push(name); __ Push(name);
__ push(value()); __ Push(value());
__ PushReturnAddressFrom(scratch1()); __ PushReturnAddressFrom(scratch1());
// Do tail-call to the runtime system. // Do tail-call to the runtime system.
...@@ -1115,7 +1117,7 @@ void StoreStubCompiler::GenerateStoreViaSetter( ...@@ -1115,7 +1117,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
// Save value register, so we can restore it later. // Save value register, so we can restore it later.
__ push(value()); __ Push(value());
if (!setter.is_null()) { if (!setter.is_null()) {
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
...@@ -1124,8 +1126,8 @@ void StoreStubCompiler::GenerateStoreViaSetter( ...@@ -1124,8 +1126,8 @@ void StoreStubCompiler::GenerateStoreViaSetter(
__ movp(receiver, __ movp(receiver,
FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
} }
__ push(receiver); __ Push(receiver);
__ push(value()); __ Push(value());
ParameterCount actual(1); ParameterCount actual(1);
ParameterCount expected(setter); ParameterCount expected(setter);
__ InvokeFunction(setter, expected, actual, __ InvokeFunction(setter, expected, actual,
...@@ -1137,7 +1139,7 @@ void StoreStubCompiler::GenerateStoreViaSetter( ...@@ -1137,7 +1139,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
} }
// We have to return the passed value, not the return value of the setter. // We have to return the passed value, not the return value of the setter.
__ pop(rax); __ Pop(rax);
// Restore context register. // Restore context register.
__ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
...@@ -1154,9 +1156,9 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( ...@@ -1154,9 +1156,9 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
Handle<JSObject> object, Handle<JSObject> object,
Handle<Name> name) { Handle<Name> name) {
__ PopReturnAddressTo(scratch1()); __ PopReturnAddressTo(scratch1());
__ push(receiver()); __ Push(receiver());
__ push(this->name()); __ Push(this->name());
__ push(value()); __ Push(value());
__ PushReturnAddressFrom(scratch1()); __ PushReturnAddressFrom(scratch1());
// Do tail-call to the runtime system. // Do tail-call to the runtime system.
...@@ -1172,8 +1174,8 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( ...@@ -1172,8 +1174,8 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
void StoreStubCompiler::GenerateStoreArrayLength() { void StoreStubCompiler::GenerateStoreArrayLength() {
// Prepare tail call to StoreIC_ArrayLength. // Prepare tail call to StoreIC_ArrayLength.
__ PopReturnAddressTo(scratch1()); __ PopReturnAddressTo(scratch1());
__ push(receiver()); __ Push(receiver());
__ push(value()); __ Push(value());
__ PushReturnAddressFrom(scratch1()); __ PushReturnAddressFrom(scratch1());
ExternalReference ref = ExternalReference ref =
...@@ -1289,7 +1291,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, ...@@ -1289,7 +1291,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
__ movp(receiver, __ movp(receiver,
FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
} }
__ push(receiver); __ Push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
ParameterCount expected(getter); ParameterCount expected(getter);
__ InvokeFunction(getter, expected, actual, __ InvokeFunction(getter, expected, actual,
......
...@@ -99,15 +99,15 @@ TEST(AssemblerX64StackOperations) { ...@@ -99,15 +99,15 @@ TEST(AssemblerX64StackOperations) {
// Assemble a simple function that copies argument 2 and returns it. // Assemble a simple function that copies argument 2 and returns it.
// We compile without stack frame pointers, so the gdb debugger shows // We compile without stack frame pointers, so the gdb debugger shows
// incorrect stack frames when debugging this function (which has them). // incorrect stack frames when debugging this function (which has them).
__ push(rbp); __ pushq(rbp);
__ movq(rbp, rsp); __ movq(rbp, rsp);
__ push(arg2); // Value at (rbp - 8) __ pushq(arg2); // Value at (rbp - 8)
__ push(arg2); // Value at (rbp - 16) __ pushq(arg2); // Value at (rbp - 16)
__ push(arg1); // Value at (rbp - 24) __ pushq(arg1); // Value at (rbp - 24)
__ pop(rax); __ popq(rax);
__ pop(rax); __ popq(rax);
__ pop(rax); __ popq(rax);
__ pop(rbp); __ popq(rbp);
__ nop(); __ nop();
__ ret(0); __ ret(0);
...@@ -330,19 +330,19 @@ TEST(AssemblerX64MemoryOperands) { ...@@ -330,19 +330,19 @@ TEST(AssemblerX64MemoryOperands) {
Assembler assm(CcTest::i_isolate(), buffer, static_cast<int>(actual_size)); Assembler assm(CcTest::i_isolate(), buffer, static_cast<int>(actual_size));
// Assemble a simple function that copies argument 2 and returns it. // Assemble a simple function that copies argument 2 and returns it.
__ push(rbp); __ pushq(rbp);
__ movq(rbp, rsp); __ movq(rbp, rsp);
__ push(arg2); // Value at (rbp - 8) __ pushq(arg2); // Value at (rbp - 8)
__ push(arg2); // Value at (rbp - 16) __ pushq(arg2); // Value at (rbp - 16)
__ push(arg1); // Value at (rbp - 24) __ pushq(arg1); // Value at (rbp - 24)
const int kStackElementSize = 8; const int kStackElementSize = 8;
__ movq(rax, Operand(rbp, -3 * kStackElementSize)); __ movq(rax, Operand(rbp, -3 * kStackElementSize));
__ pop(arg2); __ popq(arg2);
__ pop(arg2); __ popq(arg2);
__ pop(arg2); __ popq(arg2);
__ pop(rbp); __ popq(rbp);
__ nop(); __ nop();
__ ret(0); __ ret(0);
...@@ -364,7 +364,7 @@ TEST(AssemblerX64ControlFlow) { ...@@ -364,7 +364,7 @@ TEST(AssemblerX64ControlFlow) {
Assembler assm(CcTest::i_isolate(), buffer, static_cast<int>(actual_size)); Assembler assm(CcTest::i_isolate(), buffer, static_cast<int>(actual_size));
// Assemble a simple function that copies argument 1 and returns it. // Assemble a simple function that copies argument 1 and returns it.
__ push(rbp); __ pushq(rbp);
__ movq(rbp, rsp); __ movq(rbp, rsp);
__ movq(rax, arg1); __ movq(rax, arg1);
...@@ -372,7 +372,7 @@ TEST(AssemblerX64ControlFlow) { ...@@ -372,7 +372,7 @@ TEST(AssemblerX64ControlFlow) {
__ jmp(&target); __ jmp(&target);
__ movq(rax, arg2); __ movq(rax, arg2);
__ bind(&target); __ bind(&target);
__ pop(rbp); __ popq(rbp);
__ ret(0); __ ret(0);
CodeDesc desc; CodeDesc desc;
...@@ -496,11 +496,11 @@ TEST(AssemblerMultiByteNop) { ...@@ -496,11 +496,11 @@ TEST(AssemblerMultiByteNop) {
byte buffer[1024]; byte buffer[1024];
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Assembler assm(isolate, buffer, sizeof(buffer)); Assembler assm(isolate, buffer, sizeof(buffer));
__ push(rbx); __ pushq(rbx);
__ push(rcx); __ pushq(rcx);
__ push(rdx); __ pushq(rdx);
__ push(rdi); __ pushq(rdi);
__ push(rsi); __ pushq(rsi);
__ movq(rax, Immediate(1)); __ movq(rax, Immediate(1));
__ movq(rbx, Immediate(2)); __ movq(rbx, Immediate(2));
__ movq(rcx, Immediate(3)); __ movq(rcx, Immediate(3));
...@@ -527,19 +527,19 @@ TEST(AssemblerMultiByteNop) { ...@@ -527,19 +527,19 @@ TEST(AssemblerMultiByteNop) {
__ cmpq(rsi, Immediate(6)); __ cmpq(rsi, Immediate(6));
__ j(not_equal, &fail); __ j(not_equal, &fail);
__ movq(rax, Immediate(42)); __ movq(rax, Immediate(42));
__ pop(rsi); __ popq(rsi);
__ pop(rdi); __ popq(rdi);
__ pop(rdx); __ popq(rdx);
__ pop(rcx); __ popq(rcx);
__ pop(rbx); __ popq(rbx);
__ ret(0); __ ret(0);
__ bind(&fail); __ bind(&fail);
__ movq(rax, Immediate(13)); __ movq(rax, Immediate(13));
__ pop(rsi); __ popq(rsi);
__ pop(rdi); __ popq(rdi);
__ pop(rdx); __ popq(rdx);
__ pop(rcx); __ popq(rcx);
__ pop(rbx); __ popq(rbx);
__ ret(0); __ ret(0);
CodeDesc desc; CodeDesc desc;
...@@ -571,14 +571,14 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) { ...@@ -571,14 +571,14 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
Assembler assm(isolate, buffer, sizeof(buffer)); Assembler assm(isolate, buffer, sizeof(buffer));
// Remove return address from the stack for fix stack frame alignment. // Remove return address from the stack for fix stack frame alignment.
__ pop(rcx); __ popq(rcx);
// Store input vector on the stack. // Store input vector on the stack.
for (int i = 0; i < ELEMENT_COUNT; i++) { for (int i = 0; i < ELEMENT_COUNT; i++) {
__ movl(rax, Immediate(vec->Get(i)->Int32Value())); __ movl(rax, Immediate(vec->Get(i)->Int32Value()));
__ shl(rax, Immediate(0x20)); __ shl(rax, Immediate(0x20));
__ or_(rax, Immediate(vec->Get(++i)->Int32Value())); __ or_(rax, Immediate(vec->Get(++i)->Int32Value()));
__ push(rax); __ pushq(rax);
} }
// Read vector into a xmm register. // Read vector into a xmm register.
...@@ -590,7 +590,7 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) { ...@@ -590,7 +590,7 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
// Remove unused data from the stack. // Remove unused data from the stack.
__ addq(rsp, Immediate(ELEMENT_COUNT * sizeof(int32_t))); __ addq(rsp, Immediate(ELEMENT_COUNT * sizeof(int32_t)));
// Restore return address. // Restore return address.
__ push(rcx); __ pushq(rcx);
__ ret(0); __ ret(0);
......
...@@ -57,11 +57,11 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, ...@@ -57,11 +57,11 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
DoubleToIStub stub(source_reg, destination_reg, offset, true); DoubleToIStub stub(source_reg, destination_reg, offset, true);
byte* start = stub.GetCode(isolate)->instruction_start(); byte* start = stub.GetCode(isolate)->instruction_start();
__ push(rbx); __ pushq(rbx);
__ push(rcx); __ pushq(rcx);
__ push(rdx); __ pushq(rdx);
__ push(rsi); __ pushq(rsi);
__ push(rdi); __ pushq(rdi);
if (!source_reg.is(rsp)) { if (!source_reg.is(rsp)) {
// The argument we pass to the stub is not a heap number, but instead // The argument we pass to the stub is not a heap number, but instead
...@@ -78,7 +78,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, ...@@ -78,7 +78,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) { for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) {
Register reg = Register::FromAllocationIndex(reg_num); Register reg = Register::FromAllocationIndex(reg_num);
if (!reg.is(rsp) && !reg.is(rbp) && !reg.is(destination_reg)) { if (!reg.is(rsp) && !reg.is(rbp) && !reg.is(destination_reg)) {
__ push(reg); __ pushq(reg);
} }
} }
...@@ -103,11 +103,11 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, ...@@ -103,11 +103,11 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
__ movq(rax, destination_reg); __ movq(rax, destination_reg);
__ pop(rdi); __ popq(rdi);
__ pop(rsi); __ popq(rsi);
__ pop(rdx); __ popq(rdx);
__ pop(rcx); __ popq(rcx);
__ pop(rbx); __ popq(rbx);
__ ret(0); __ ret(0);
......
...@@ -118,17 +118,17 @@ TEST(DisasmX64) { ...@@ -118,17 +118,17 @@ TEST(DisasmX64) {
__ bts(Operand(rdx, 0), rcx); __ bts(Operand(rdx, 0), rcx);
__ bts(Operand(rbx, rcx, times_4, 0), rcx); __ bts(Operand(rbx, rcx, times_4, 0), rcx);
__ nop(); __ nop();
__ push(Immediate(12)); __ pushq(Immediate(12));
__ push(Immediate(23456)); __ pushq(Immediate(23456));
__ push(rcx); __ pushq(rcx);
__ push(rsi); __ pushq(rsi);
__ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); __ pushq(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
__ push(Operand(rbx, rcx, times_4, 0)); __ pushq(Operand(rbx, rcx, times_4, 0));
__ push(Operand(rbx, rcx, times_4, 0)); __ pushq(Operand(rbx, rcx, times_4, 0));
__ push(Operand(rbx, rcx, times_4, 10000)); __ pushq(Operand(rbx, rcx, times_4, 10000));
__ pop(rdx); __ popq(rdx);
__ pop(rax); __ popq(rax);
__ pop(Operand(rbx, rcx, times_4, 0)); __ popq(Operand(rbx, rcx, times_4, 0));
__ nop(); __ nop();
__ addq(rdx, Operand(rsp, 16)); __ addq(rdx, Operand(rsp, 16));
...@@ -168,8 +168,8 @@ TEST(DisasmX64) { ...@@ -168,8 +168,8 @@ TEST(DisasmX64) {
__ incq(rdx); __ incq(rdx);
__ incq(Operand(rbx, rcx, times_4, 10000)); __ incq(Operand(rbx, rcx, times_4, 10000));
__ push(Operand(rbx, rcx, times_4, 10000)); __ pushq(Operand(rbx, rcx, times_4, 10000));
__ pop(Operand(rbx, rcx, times_4, 10000)); __ popq(Operand(rbx, rcx, times_4, 10000));
// TODO(mstarzinger): The following is protected. // TODO(mstarzinger): The following is protected.
// __ jmp(Operand(rbx, rcx, times_4, 10000)); // __ jmp(Operand(rbx, rcx, times_4, 10000));
......
...@@ -66,21 +66,21 @@ void generate(MacroAssembler* masm, i::Vector<const uint8_t> string) { ...@@ -66,21 +66,21 @@ void generate(MacroAssembler* masm, i::Vector<const uint8_t> string) {
__ pop(ebx); __ pop(ebx);
__ Ret(); __ Ret();
#elif V8_TARGET_ARCH_X64 #elif V8_TARGET_ARCH_X64
__ push(kRootRegister); __ pushq(kRootRegister);
__ InitializeRootRegister(); __ InitializeRootRegister();
__ push(rbx); __ pushq(rbx);
__ push(rcx); __ pushq(rcx);
__ movq(rax, Immediate(0)); __ movp(rax, Immediate(0));
__ movq(rbx, Immediate(string.at(0))); __ movp(rbx, Immediate(string.at(0)));
StringHelper::GenerateHashInit(masm, rax, rbx, rcx); StringHelper::GenerateHashInit(masm, rax, rbx, rcx);
for (int i = 1; i < string.length(); i++) { for (int i = 1; i < string.length(); i++) {
__ movq(rbx, Immediate(string.at(i))); __ movp(rbx, Immediate(string.at(i)));
StringHelper::GenerateHashAddCharacter(masm, rax, rbx, rcx); StringHelper::GenerateHashAddCharacter(masm, rax, rbx, rcx);
} }
StringHelper::GenerateHashGetHash(masm, rax, rcx); StringHelper::GenerateHashGetHash(masm, rax, rcx);
__ pop(rcx); __ popq(rcx);
__ pop(rbx); __ popq(rbx);
__ pop(kRootRegister); __ popq(kRootRegister);
__ Ret(); __ Ret();
#elif V8_TARGET_ARCH_ARM #elif V8_TARGET_ARCH_ARM
__ push(kRootRegister); __ push(kRootRegister);
...@@ -143,13 +143,13 @@ void generate(MacroAssembler* masm, uint32_t key) { ...@@ -143,13 +143,13 @@ void generate(MacroAssembler* masm, uint32_t key) {
__ pop(ebx); __ pop(ebx);
__ Ret(); __ Ret();
#elif V8_TARGET_ARCH_X64 #elif V8_TARGET_ARCH_X64
__ push(kRootRegister); __ pushq(kRootRegister);
__ InitializeRootRegister(); __ InitializeRootRegister();
__ push(rbx); __ pushq(rbx);
__ movq(rax, Immediate(key)); __ movp(rax, Immediate(key));
__ GetNumberHash(rax, rbx); __ GetNumberHash(rax, rbx);
__ pop(rbx); __ popq(rbx);
__ pop(kRootRegister); __ popq(kRootRegister);
__ Ret(); __ Ret();
#elif V8_TARGET_ARCH_ARM #elif V8_TARGET_ARCH_ARM
__ push(kRootRegister); __ push(kRootRegister);
......
...@@ -99,8 +99,8 @@ typedef int (*F0)(); ...@@ -99,8 +99,8 @@ typedef int (*F0)();
static void EntryCode(MacroAssembler* masm) { static void EntryCode(MacroAssembler* masm) {
// Smi constant register is callee save. // Smi constant register is callee save.
__ push(i::kSmiConstantRegister); __ pushq(i::kSmiConstantRegister);
__ push(i::kRootRegister); __ pushq(i::kRootRegister);
__ InitializeSmiConstantRegister(); __ InitializeSmiConstantRegister();
__ InitializeRootRegister(); __ InitializeRootRegister();
} }
...@@ -112,8 +112,8 @@ static void ExitCode(MacroAssembler* masm) { ...@@ -112,8 +112,8 @@ static void ExitCode(MacroAssembler* masm) {
__ cmpq(rdx, i::kSmiConstantRegister); __ cmpq(rdx, i::kSmiConstantRegister);
__ movq(rdx, Immediate(-1)); __ movq(rdx, Immediate(-1));
__ cmovq(not_equal, rax, rdx); __ cmovq(not_equal, rax, rdx);
__ pop(i::kRootRegister); __ popq(i::kRootRegister);
__ pop(i::kSmiConstantRegister); __ popq(i::kSmiConstantRegister);
} }
...@@ -1360,8 +1360,8 @@ TEST(SmiDiv) { ...@@ -1360,8 +1360,8 @@ TEST(SmiDiv) {
EntryCode(masm); EntryCode(masm);
Label exit; Label exit;
__ push(r14); __ pushq(r14);
__ push(r15); __ pushq(r15);
TestSmiDiv(masm, &exit, 0x10, 1, 1); TestSmiDiv(masm, &exit, 0x10, 1, 1);
TestSmiDiv(masm, &exit, 0x20, 1, 0); TestSmiDiv(masm, &exit, 0x20, 1, 0);
TestSmiDiv(masm, &exit, 0x30, -1, 0); TestSmiDiv(masm, &exit, 0x30, -1, 0);
...@@ -1386,8 +1386,8 @@ TEST(SmiDiv) { ...@@ -1386,8 +1386,8 @@ TEST(SmiDiv) {
__ xor_(r15, r15); // Success. __ xor_(r15, r15); // Success.
__ bind(&exit); __ bind(&exit);
__ movq(rax, r15); __ movq(rax, r15);
__ pop(r15); __ popq(r15);
__ pop(r14); __ popq(r14);
ExitCode(masm); ExitCode(masm);
__ ret(0); __ ret(0);
...@@ -1470,8 +1470,8 @@ TEST(SmiMod) { ...@@ -1470,8 +1470,8 @@ TEST(SmiMod) {
EntryCode(masm); EntryCode(masm);
Label exit; Label exit;
__ push(r14); __ pushq(r14);
__ push(r15); __ pushq(r15);
TestSmiMod(masm, &exit, 0x10, 1, 1); TestSmiMod(masm, &exit, 0x10, 1, 1);
TestSmiMod(masm, &exit, 0x20, 1, 0); TestSmiMod(masm, &exit, 0x20, 1, 0);
TestSmiMod(masm, &exit, 0x30, -1, 0); TestSmiMod(masm, &exit, 0x30, -1, 0);
...@@ -1496,8 +1496,8 @@ TEST(SmiMod) { ...@@ -1496,8 +1496,8 @@ TEST(SmiMod) {
__ xor_(r15, r15); // Success. __ xor_(r15, r15); // Success.
__ bind(&exit); __ bind(&exit);
__ movq(rax, r15); __ movq(rax, r15);
__ pop(r15); __ popq(r15);
__ pop(r14); __ popq(r14);
ExitCode(masm); ExitCode(masm);
__ ret(0); __ ret(0);
...@@ -2324,21 +2324,21 @@ TEST(OperandOffset) { ...@@ -2324,21 +2324,21 @@ TEST(OperandOffset) {
Label exit; Label exit;
EntryCode(masm); EntryCode(masm);
__ push(r13); __ pushq(r13);
__ push(r14); __ pushq(r14);
__ push(rbx); __ pushq(rbx);
__ push(rbp); __ pushq(rbp);
__ push(Immediate(0x100)); // <-- rbp __ pushq(Immediate(0x100)); // <-- rbp
__ movq(rbp, rsp); __ movq(rbp, rsp);
__ push(Immediate(0x101)); __ pushq(Immediate(0x101));
__ push(Immediate(0x102)); __ pushq(Immediate(0x102));
__ push(Immediate(0x103)); __ pushq(Immediate(0x103));
__ push(Immediate(0x104)); __ pushq(Immediate(0x104));
__ push(Immediate(0x105)); // <-- rbx __ pushq(Immediate(0x105)); // <-- rbx
__ push(Immediate(0x106)); __ pushq(Immediate(0x106));
__ push(Immediate(0x107)); __ pushq(Immediate(0x107));
__ push(Immediate(0x108)); __ pushq(Immediate(0x108));
__ push(Immediate(0x109)); // <-- rsp __ pushq(Immediate(0x109)); // <-- rsp
// rbp = rsp[9] // rbp = rsp[9]
// r15 = rsp[3] // r15 = rsp[3]
// rbx = rsp[5] // rbx = rsp[5]
...@@ -2644,10 +2644,10 @@ TEST(OperandOffset) { ...@@ -2644,10 +2644,10 @@ TEST(OperandOffset) {
__ movl(rax, Immediate(0)); __ movl(rax, Immediate(0));
__ bind(&exit); __ bind(&exit);
__ lea(rsp, Operand(rbp, kPointerSize)); __ lea(rsp, Operand(rbp, kPointerSize));
__ pop(rbp); __ popq(rbp);
__ pop(rbx); __ popq(rbx);
__ pop(r14); __ popq(r14);
__ pop(r13); __ popq(r13);
ExitCode(masm); ExitCode(masm);
__ ret(0); __ ret(0);
......
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