From efe9f30fbe2a322afb85ee7e18622a9ebff1f891 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Wed, 5 May 2010 06:50:15 +0000 Subject: [PATCH] Handle loading the property name for load IC in the virtual frame Review URL: http://codereview.chromium.org/1946001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4585 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/codegen-arm.cc | 22 +++++++++------------- src/arm/virtual-frame-arm.cc | 4 +++- src/arm/virtual-frame-arm.h | 5 ++--- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index a0a1e86..8f9fa30 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -1343,9 +1343,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand, // give us a megamorphic load site. Not super, but it works. LoadAndSpill(applicand); Handle name = Factory::LookupAsciiSymbol("apply"); - __ mov(r2, Operand(name)); - __ ldr(r0, MemOperand(sp, 0)); - frame_->CallLoadIC(RelocInfo::CODE_TARGET); + frame_->CallLoadIC(name, RelocInfo::CODE_TARGET); frame_->EmitPush(r0); // Load the receiver and the existing arguments object onto the @@ -3012,11 +3010,10 @@ void CodeGenerator::LoadFromGlobalSlotCheckExtensions(Slot* slot, // Load the global object. LoadGlobal(); // Setup the name register and call load IC. - frame_->SpillAllButCopyTOSToR0(); - __ mov(r2, Operand(slot->var()->name())); - frame_->CallLoadIC(typeof_state == INSIDE_TYPEOF - ? RelocInfo::CODE_TARGET - : RelocInfo::CODE_TARGET_CONTEXT); + frame_->CallLoadIC(slot->var()->name(), + typeof_state == INSIDE_TYPEOF + ? RelocInfo::CODE_TARGET + : RelocInfo::CODE_TARGET_CONTEXT); // Drop the global object. The result is in r0. frame_->Drop(); } @@ -5446,11 +5443,10 @@ void CodeGenerator::EmitNamedLoad(Handle name, bool is_contextual) { if (is_contextual || scope()->is_global_scope() || loop_nesting() == 0) { Comment cmnt(masm(), "[ Load from named Property"); // Setup the name register and call load IC. - frame_->SpillAllButCopyTOSToR0(); - __ mov(r2, Operand(name)); - frame_->CallLoadIC(is_contextual - ? RelocInfo::CODE_TARGET_CONTEXT - : RelocInfo::CODE_TARGET); + frame_->CallLoadIC(name, + is_contextual + ? RelocInfo::CODE_TARGET_CONTEXT + : RelocInfo::CODE_TARGET); } else { // Inline the in-object property case. Comment cmnt(masm(), "[ Inlined named property load"); diff --git a/src/arm/virtual-frame-arm.cc b/src/arm/virtual-frame-arm.cc index 7c935fc..bf5cff2 100644 --- a/src/arm/virtual-frame-arm.cc +++ b/src/arm/virtual-frame-arm.cc @@ -298,8 +298,10 @@ void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, } -void VirtualFrame::CallLoadIC(RelocInfo::Mode mode) { +void VirtualFrame::CallLoadIC(Handle name, RelocInfo::Mode mode) { Handle ic(Builtins::builtin(Builtins::LoadIC_Initialize)); + SpillAllButCopyTOSToR0(); + __ mov(r2, Operand(name)); CallCodeObject(ic, mode, 0); } diff --git a/src/arm/virtual-frame-arm.h b/src/arm/virtual-frame-arm.h index 7809ce8..77bc70e 100644 --- a/src/arm/virtual-frame-arm.h +++ b/src/arm/virtual-frame-arm.h @@ -308,9 +308,8 @@ class VirtualFrame : public ZoneObject { InvokeJSFlags flag, int arg_count); - // Call load IC. Receiver is on the stack and the property name is in r2. - // Result is returned in r0. - void CallLoadIC(RelocInfo::Mode mode); + // Call load IC. Receiver is on the stack. Result is returned in r0. + void CallLoadIC(Handle name, RelocInfo::Mode mode); // Call store IC. If the load is contextual, value is found on top of the // frame. If not, value and receiver are on the frame. Both are consumed. -- 2.7.4