Revision: 2539
Author: [email protected]
Date: Mon Jul 27 03:39:21 2009
Log: Make X64 implementation update Store ic stubs.  Remove comment that  
talks about "below" on the stack meaning closer to the top.
Review URL: http://codereview.chromium.org/159402
http://code.google.com/p/v8/source/detail?r=2539

Modified:
  /branches/bleeding_edge/src/ia32/ic-ia32.cc
  /branches/bleeding_edge/src/ic.cc
  /branches/bleeding_edge/src/x64/ic-x64.cc
  /branches/bleeding_edge/src/x64/macro-assembler-x64.cc
  /branches/bleeding_edge/src/x64/stub-cache-x64.cc

=======================================
--- /branches/bleeding_edge/src/ia32/ic-ia32.cc Fri Jul 24 04:22:35 2009
+++ /branches/bleeding_edge/src/ia32/ic-ia32.cc Mon Jul 27 03:39:21 2009
@@ -749,12 +749,10 @@
    // -----------------------------------

    __ mov(eax, Operand(esp, kPointerSize));
-
-  // Move the return address below the arguments.
    __ pop(ebx);
-  __ push(eax);
-  __ push(ecx);
-  __ push(ebx);
+  __ push(eax);  // receiver
+  __ push(ecx);  // name
+  __ push(ebx);  // return address

    // Perform tail call to the entry.
    __ TailCallRuntime(f, 2);
@@ -877,12 +875,10 @@

    __ mov(eax, Operand(esp, kPointerSize));
    __ mov(ecx, Operand(esp, 2 * kPointerSize));
-
-  // Move the return address below the arguments.
    __ pop(ebx);
-  __ push(ecx);
-  __ push(eax);
-  __ push(ebx);
+  __ push(ecx);  // receiver
+  __ push(eax);  // name
+  __ push(ebx);  // return address

    // Perform tail call to the entry.
    __ TailCallRuntime(f, 2);
@@ -917,12 +913,12 @@
    //  -- esp[4] : receiver
    // -----------------------------------

-  // Move the return address below the arguments.
    __ pop(ebx);
-  __ push(Operand(esp, 0));
-  __ push(ecx);
-  __ push(eax);
-  __ push(ebx);
+  __ push(Operand(esp, 0));  // receiver
+  __ push(ecx);  // transition map
+  __ push(eax);  // value
+  __ push(ebx);  // return address
+
    // Perform tail call to the entry.
    __ TailCallRuntime(
        ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3);
=======================================
--- /branches/bleeding_edge/src/ic.cc   Mon Jul 20 07:33:59 2009
+++ /branches/bleeding_edge/src/ic.cc   Mon Jul 27 03:39:21 2009
@@ -978,10 +978,6 @@
      return *value;
    }

-  // TODO(X64): Enable inline cache for StoreIC.
-#ifdef V8_TARGET_ARCH_X64
-  USE(&LookupForWrite);  // The compiler complains otherwise.
-#else
    // Lookup the property locally in the receiver.
    if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) {
      LookupResult lookup;
@@ -989,7 +985,6 @@
        UpdateCaches(&lookup, state, receiver, name, value);
      }
    }
-#endif

    // Set the property.
    return receiver->SetProperty(*name, *value, NONE);
=======================================
--- /branches/bleeding_edge/src/x64/ic-x64.cc   Fri Jul 24 04:22:35 2009
+++ /branches/bleeding_edge/src/x64/ic-x64.cc   Mon Jul 27 03:39:21 2009
@@ -183,12 +183,10 @@

    __ movq(rax, Operand(rsp, kPointerSize));
    __ movq(rcx, Operand(rsp, 2 * kPointerSize));
-
-  // Move the return address below the arguments.
    __ pop(rbx);
-  __ push(rcx);
-  __ push(rax);
-  __ push(rbx);
+  __ push(rcx);  // receiver
+  __ push(rax);  // name
+  __ push(rbx);  // return address

    // Perform tail call to the entry.
    __ TailCallRuntime(f, 2);
@@ -369,19 +367,19 @@
    //  -- rsp[16] : receiver
    // -----------------------------------

-  // Move the return address below the arguments.
    __ pop(rcx);
-  __ push(Operand(rsp, 1 * kPointerSize));
-  __ push(Operand(rsp, 1 * kPointerSize));
-  __ push(rax);
-  __ push(rcx);
+  __ push(Operand(rsp, 1 * kPointerSize));  // receiver
+  __ push(Operand(rsp, 1 * kPointerSize));  // key
+  __ push(rax);  // value
+  __ push(rcx);  // return address

    // Do tail-call to runtime routine.
    __ TailCallRuntime(f, 3);
  }

  void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) {
-  Generate(masm, ExternalReference(IC_Utility(kKeyedStoreIC_Miss)));
+  __ int3();
+  __ movq(rax, Immediate(0xdead1234));
  }


@@ -584,11 +582,10 @@

    __ movq(rax, Operand(rsp, kPointerSize));

-  // Move the return address below the arguments.
    __ pop(rbx);
-  __ push(rax);
-  __ push(rcx);
-  __ push(rbx);
+  __ push(rax);  // receiver
+  __ push(rcx);  // name
+  __ push(rbx);  // return address

    // Perform tail call to the entry.
    __ TailCallRuntime(f, 2);
@@ -654,19 +651,33 @@
    //  -- rsp[0] : return address
    //  -- rsp[8] : receiver
    // -----------------------------------
-  // Move the return address below the arguments.
    __ pop(rbx);
-  __ push(Operand(rsp, 0));
-  __ push(rcx);
-  __ push(rax);
-  __ push(rbx);
+  __ push(Operand(rsp, 0));  // receiver
+  __ push(rcx);  // name
+  __ push(rax);  // value
+  __ push(rbx);  // return address

    // Perform tail call to the entry.
    __ TailCallRuntime(f, 3);
  }

  void StoreIC::GenerateExtendStorage(MacroAssembler* masm) {
-  Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss)));
+  // ----------- S t a t e -------------
+  //  -- rax    : value
+  //  -- rcx    : Map (target of map transition)
+  //  -- rsp[0] : return address
+  //  -- rsp[8] : receiver
+  // -----------------------------------
+
+  __ pop(rbx);
+  __ push(Operand(rsp, 0));  // receiver
+  __ push(rcx);  // transition map
+  __ push(rax);  // value
+  __ push(rbx);  // return address
+
+  // Perform tail call to the entry.
+  __ TailCallRuntime(
+      ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3);
  }

  void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc      Thu Jul 16  
05:49:14 2009
+++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc      Mon Jul 27  
03:39:21 2009
@@ -151,6 +151,13 @@

  void MacroAssembler::TailCallRuntime(ExternalReference const& ext,
                                       int num_arguments) {
+  // ----------- S t a t e -------------
+  //  -- rsp[0] : return address
+  //  -- rsp[8] : argument num_arguments - 1
+  //  ...
+  //  -- rsp[8 * num_arguments] : argument 0 (receiver)
+  // -----------------------------------
+
    // TODO(1236192): Most runtime routines don't need the number of
    // arguments passed in because it is constant. At some point we
    // should remove this need and make the runtime routine entry code
=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc   Fri Jul 24 04:22:35  
2009
+++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc   Mon Jul 27 03:39:21  
2009
@@ -422,8 +422,8 @@
  Object* StoreStubCompiler::CompileStoreCallback(JSObject* a,
                                                  AccessorInfo* b,
                                                  String* c) {
-  UNIMPLEMENTED();
-  return NULL;
+  // TODO(X64): Implement a real stub.
+  return Failure::InternalError();
  }


@@ -463,16 +463,16 @@


  Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* a, String* b)  
{
-  UNIMPLEMENTED();
-  return NULL;
+  // TODO(X64): Implement a real stub.
+  return Failure::InternalError();
  }


  Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
                                                JSGlobalPropertyCell* cell,
                                                String* name) {
-  UNIMPLEMENTED();
-  return NULL;
+  // TODO(X64): Implement a real stub.
+  return Failure::InternalError();
  }



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

Reply via email to