Revision: 16580
Author:   [email protected]
Date:     Fri Sep  6 17:21:27 2013 UTC
Log:      MIPS: store ics for js api accessors.

Port r16571 (9266312)

BUG=

Review URL: https://codereview.chromium.org/23780003
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=16580

Modified:
 /branches/bleeding_edge/src/mips/stub-cache-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Fri Sep 6 11:04:20 2013 UTC +++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Fri Sep 6 17:21:27 2013 UTC
@@ -916,6 +916,36 @@
                               kStackUnwindSpace,
                               kFastApiCallArguments + 1);
 }
+
+
+// Generate call to api function.
+static void GenerateFastApiCall(MacroAssembler* masm,
+                                const CallOptimization& optimization,
+                                Register receiver,
+                                Register scratch,
+                                int argc,
+                                Register* values) {
+  ASSERT(optimization.is_simple_api_call());
+  ASSERT(!receiver.is(scratch));
+
+  const int stack_space = kFastApiCallArguments + argc + 1;
+  // Assign stack space for the call arguments.
+  __ Subu(sp, sp, Operand(stack_space * kPointerSize));
+  // Write holder to stack frame.
+  __ sw(receiver, MemOperand(sp, 0));
+  // Write receiver to stack frame.
+  int index = stack_space - 1;
+  __ sw(receiver, MemOperand(sp, index * kPointerSize));
+  // Write the arguments to stack frame.
+  for (int i = 0; i < argc; i++) {
+    ASSERT(!receiver.is(values[i]));
+    ASSERT(!scratch.is(values[i]));
+    __ sw(receiver, MemOperand(sp, index-- * kPointerSize));
+  }
+
+  GenerateFastApiDirectCall(masm, optimization, argc);
+}
+

 class CallInterceptorCompiler BASE_EMBEDDED {
  public:
@@ -1375,19 +1405,8 @@

 void BaseLoadStubCompiler::GenerateLoadCallback(
     const CallOptimization& call_optimization) {
-  ASSERT(call_optimization.is_simple_api_call());
-
-  // Assign stack space for the call arguments.
-  __ Subu(sp, sp, Operand((kFastApiCallArguments + 1) * kPointerSize));
-
-  int argc = 0;
-  int api_call_argc = argc + kFastApiCallArguments;
-  // Write holder to stack frame.
-  __ sw(receiver(), MemOperand(sp, 0));
-  // Write receiver to stack frame.
-  __ sw(receiver(), MemOperand(sp, api_call_argc * kPointerSize));
-
-  GenerateFastApiDirectCall(masm(), call_optimization, argc);
+  GenerateFastApiCall(
+      masm(), call_optimization, receiver(), scratch3(), 0, NULL);
 }


@@ -2812,6 +2831,24 @@
   // Return the generated code.
   return GetCode(kind(), Code::CALLBACKS, name);
 }
+
+
+Handle<Code> StoreStubCompiler::CompileStoreCallback(
+    Handle<JSObject> object,
+    Handle<JSObject> holder,
+    Handle<Name> name,
+    const CallOptimization& call_optimization) {
+  Label success;
+  HandlerFrontend(object, receiver(), holder, name, &success);
+  __ bind(&success);
+
+  Register values[] = { value() };
+  GenerateFastApiCall(
+      masm(), call_optimization, receiver(), scratch3(), 1, values);
+
+  // Return the generated code.
+  return GetCode(kind(), Code::CALLBACKS, name);
+}


 #undef __

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to