Reviewers: Kevin Millikin,

Description:
Remove spilled code from SetValue and GetValue

Please review this at http://codereview.chromium.org/18596

SVN Base: http://v8.googlecode.com/svn/branches/experimental/toiger/

Affected files:
   M     src/codegen-ia32.cc


Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 1159)
+++ src/codegen-ia32.cc (working copy)
@@ -4600,14 +4600,17 @@
          cgen_->frame()->Push(&value);

        } else {
-        VirtualFrame::SpilledScope spilled_scope(cgen_);
          VirtualFrame* frame = cgen_->frame();
          Comment cmnt(masm, "[ Load from keyed Property");
          Handle<Code>  
ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+        // The arguments to the functions are on top of the frame.
+        // They are spilled in CallCodeObject.
+        Result answer(cgen_);
          if (is_global) {
-          frame->CallCodeObject(ic, RelocInfo::CODE_TARGET_CONTEXT, 0);
+          answer = frame->CallCodeObject(ic,
+                                         RelocInfo::CODE_TARGET_CONTEXT,  
0);
          } else {
-          frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
+          answer = frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
          }
          // Make sure that we do not have a test instruction after the
          // call.  A test instruction after the call is used to
@@ -4615,7 +4618,7 @@
          // keyed load.  The explicit nop instruction is here because
          // the push that follows might be peep-hole optimized away.
          __ nop();
-        frame->EmitPush(eax);  // IC call leaves result in eax, push it out
+        frame->Push(&answer);  // IC call leaves result in eax, push it out
        }
        break;
      }
@@ -4670,29 +4673,37 @@
      }

      case NAMED: {
-      VirtualFrame::SpilledScope spilled_scope(cgen_);
        Comment cmnt(masm, "[ Store to named Property");
        // Call the appropriate IC code.
        Handle<String> name(GetName());
        Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
        // TODO(1222589): Make the IC grab the values from the stack.
-      frame->EmitPop(eax);
+      Result argument = frame->Pop();
+      argument.ToRegister(eax);
+      ASSERT(argument.is_valid());
+      Result ecx_result = cgen_->allocator()->Allocate(ecx);
+      ASSERT(ecx_result.is_valid());
        // Setup the name register.
-      __ mov(ecx, name);
-      frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
-      frame->EmitPush(eax);  // IC call leaves result in eax, push it out
+      __ mov(ecx_result.reg(), name);
+      // Free the registers used by the call.
+      argument.Unuse();
+      ecx_result.Unuse();
+      Result answer = frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
+      frame->Push(&answer);
        break;
      }

      case KEYED: {
-      VirtualFrame::SpilledScope spilled_scope(cgen_);
        Comment cmnt(masm, "[ Store to keyed Property");
        // Call IC code.
        Handle<Code>  
ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
        // TODO(1222589): Make the IC grab the values from the stack.
-      frame->EmitPop(eax);
-      frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
-      frame->EmitPush(eax);  // IC call leaves result in eax, push it out
+      Result temp = frame->Pop();
+      temp.ToRegister(eax);
+      ASSERT(temp.is_valid());
+      temp.Unuse();
+      temp = frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0);
+      frame->Push(&temp);
        break;
      }




--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to