From 60659dd1c6d352bf47fd52344abb732dd4766096 Mon Sep 17 00:00:00 2001 From: "ager@chromium.org" Date: Wed, 17 Nov 2010 14:48:43 +0000 Subject: [PATCH] Landing for Martyn Capewell. Replace some hard-coded return address calculations with Call. BUG=none TEST=none Codereview URL: http://codereview.chromium.org/5158002/ git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/codegen-arm.cc | 7 ++----- src/arm/full-codegen-arm.cc | 7 ++----- src/arm/virtual-frame-arm.cc | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index 210a3f7..dd0520f 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -1892,18 +1892,15 @@ void CodeGenerator::CheckStack() { frame_->SpillAll(); Comment cmnt(masm_, "[ check stack"); __ LoadRoot(ip, Heap::kStackLimitRootIndex); - // Put the lr setup instruction in the delay slot. kInstrSize is added to - // the implicit 8 byte offset that always applies to operations with pc and - // gives a return address 12 bytes down. - masm_->add(lr, pc, Operand(Assembler::kInstrSize)); masm_->cmp(sp, Operand(ip)); StackCheckStub stub; // Call the stub if lower. - masm_->mov(pc, + masm_->mov(ip, Operand(reinterpret_cast(stub.GetCode().location()), RelocInfo::CODE_TARGET), LeaveCC, lo); + masm_->Call(ip, lo); } diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index df8d4bd..c50f84a 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -172,19 +172,16 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { } // Check the stack for overflow or break request. - // Put the lr setup instruction in the delay slot. The kInstrSize is - // added to the implicit 8 byte offset that always applies to operations - // with pc and gives a return address 12 bytes down. { Comment cmnt(masm_, "[ Stack check"); __ LoadRoot(r2, Heap::kStackLimitRootIndex); - __ add(lr, pc, Operand(Assembler::kInstrSize)); __ cmp(sp, Operand(r2)); StackCheckStub stub; - __ mov(pc, + __ mov(ip, Operand(reinterpret_cast(stub.GetCode().location()), RelocInfo::CODE_TARGET), LeaveCC, lo); + __ Call(ip, lo); } if (FLAG_trace) { diff --git a/src/arm/virtual-frame-arm.cc b/src/arm/virtual-frame-arm.cc index da76edf..45f4876 100644 --- a/src/arm/virtual-frame-arm.cc +++ b/src/arm/virtual-frame-arm.cc @@ -245,18 +245,15 @@ void VirtualFrame::AllocateStackSlots() { __ LoadRoot(r2, Heap::kStackLimitRootIndex); } // Check the stack for overflow or a break request. - // Put the lr setup instruction in the delay slot. The kInstrSize is added - // to the implicit 8 byte offset that always applies to operations with pc - // and gives a return address 12 bytes down. - masm()->add(lr, pc, Operand(Assembler::kInstrSize)); masm()->cmp(sp, Operand(r2)); StackCheckStub stub; // Call the stub if lower. - masm()->mov(pc, + masm()->mov(ip, Operand(reinterpret_cast(stub.GetCode().location()), RelocInfo::CODE_TARGET), LeaveCC, lo); + masm()->Call(ip, lo); } -- 2.7.4