Revision: 11056
Author:   [email protected]
Date:     Thu Mar 15 05:29:20 2012
Log: MIPS: Inline functions that use arguments object in f.apply(o, arguments) pattern.

Port r11008 (f7a04e6f9).

Original commit message:

Support arguments materialization after deoptimization in all frames (not only in topmost one).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9677053
Patch from Daniel Kalmar <[email protected]>.
http://code.google.com/p/v8/source/detail?r=11056

Modified:
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.h

=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Tue Mar 13 09:18:30 2012 +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Thu Mar 15 05:29:20 2012
@@ -2690,15 +2690,10 @@
 }


-void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
+void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
   Register receiver = ToRegister(instr->receiver());
   Register function = ToRegister(instr->function());
-  Register length = ToRegister(instr->length());
-  Register elements = ToRegister(instr->elements());
   Register scratch = scratch0();
-  ASSERT(receiver.is(a0));  // Used for parameter count.
-  ASSERT(function.is(a1));  // Required by InvokeFunction.
-  ASSERT(ToRegister(instr->result()).is(v0));

   // If the receiver is null or undefined, we have to pass the global
   // object as a receiver to normal functions. Values have to be
@@ -2739,6 +2734,17 @@
   __ lw(receiver,
          FieldMemOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
   __ bind(&receiver_ok);
+}
+
+void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
+  Register receiver = ToRegister(instr->receiver());
+  Register function = ToRegister(instr->function());
+  Register length = ToRegister(instr->length());
+  Register elements = ToRegister(instr->elements());
+  Register scratch = scratch0();
+  ASSERT(receiver.is(a0));  // Used for parameter count.
+  ASSERT(function.is(a1));  // Required by InvokeFunction.
+  ASSERT(ToRegister(instr->result()).is(v0));

   // Copy the arguments to this function possibly from the
   // adaptor frame below it.
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Mar 12 01:46:25 2012 +++ /branches/bleeding_edge/src/mips/lithium-mips.cc Thu Mar 15 05:29:20 2012
@@ -1095,6 +1095,14 @@
                                          FixedTemp(t0));
   return MarkAsCall(DefineFixed(result, v0), instr);
 }
+
+
+LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
+  LOperand* receiver = UseRegisterAtStart(instr->receiver());
+  LOperand* function = UseRegisterAtStart(instr->function());
+  LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function);
+  return AssignEnvironment(DefineSameAsFirst(result));
+}


 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h     Mon Mar 12 01:46:25 2012
+++ /branches/bleeding_edge/src/mips/lithium-mips.h     Thu Mar 15 05:29:20 2012
@@ -178,7 +178,8 @@
   V(ForInCacheArray)                            \
   V(CheckMapValue)                              \
   V(LoadFieldByIndex)                           \
-  V(DateField)
+  V(DateField)                                  \
+  V(WrapReceiver)

 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic)              \
   virtual Opcode opcode() const { return LInstruction::k##type; } \
@@ -467,6 +468,20 @@
 };


+class LWrapReceiver: public LTemplateInstruction<1, 2, 0> {
+ public:
+  LWrapReceiver(LOperand* receiver, LOperand* function) {
+    inputs_[0] = receiver;
+    inputs_[1] = function;
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
+
+  LOperand* receiver() { return inputs_[0]; }
+  LOperand* function() { return inputs_[1]; }
+};
+
+
 class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
  public:
   LApplyArguments(LOperand* function,

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

Reply via email to