Reviewers: paul.l..., gergely.kis.imgtec, balazs.kilvady, danno, Dmitry Lomov (chromium),

Message:
PTAL

Description:
MIPS: Fix 'MIPS: [es6] implement Reflect.apply() & Reflect.construct()'

Port d21fd15467e16f185e511dbfbaeef7caddfe804a

TEST=mjsunit/harmony/reflect-construct
BUG=

Please review this at https://codereview.chromium.org/1022053002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+12, -6 lines):
  M src/mips/builtins-mips.cc
  M src/mips64/builtins-mips64.cc


Index: src/mips/builtins-mips.cc
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
index de62d59fe798d16a220e394cb3674da5e9fde1af..9bdc1e1bd8294430e63c2be7b32c3b2dfc357420 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -1432,6 +1432,7 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
       __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
     }

+    // Returns the result in v0.
     Generate_CheckStackOverflow(masm, kFunctionOffset);

     // Push current limit and index.
@@ -1536,7 +1537,7 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
   const int kStackSize = kFormalParameters + 1;

   {
-    FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL);
+    FrameScope frame_scope(masm, StackFrame::INTERNAL);
     const int kNewTargetOffset = kFPOnStackSize + kPCOnStackSize;
     const int kArgumentsOffset = kNewTargetOffset + kPointerSize;
     const int kFunctionOffset = kArgumentsOffset + kPointerSize;
@@ -1557,8 +1558,10 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
     __ push(a0);
     __ lw(a0, MemOperand(fp, kNewTargetOffset));  // get the new.target
     __ push(a0);
+    // Returns argument count in v0.
     __ InvokeBuiltin(Builtins::REFLECT_CONSTRUCT_PREPARE, CALL_FUNCTION);

+    // Returns result in v0.
     Generate_CheckStackOverflow(masm, kFunctionOffset);

     // Push current limit and index.
@@ -1591,8 +1594,8 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {

     // Leave internal frame.
   }
-  __ Addu(sp, sp, Operand(kStackSize * kPointerSize));
-  __ Jump(ra);
+  __ jr(ra);
+  __ Addu(sp, sp, Operand(kStackSize * kPointerSize));  // In delay slot.
 }


Index: src/mips64/builtins-mips64.cc
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
index 0fb0e6d3a54f7e06b6ae5388006709cd02d85d09..24d4a800e5e6f6cb2149297b2a174be7f8e287da 100644
--- a/src/mips64/builtins-mips64.cc
+++ b/src/mips64/builtins-mips64.cc
@@ -1440,6 +1440,7 @@ static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
       __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
     }

+    // Returns the result in v0.
     Generate_CheckStackOverflow(masm, kFunctionOffset);

     // Push current limit and index.
@@ -1544,7 +1545,7 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
   const int kStackSize = kFormalParameters + 1;

   {
-    FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL);
+    FrameScope frame_scope(masm, StackFrame::INTERNAL);
     const int kNewTargetOffset = kFPOnStackSize + kPCOnStackSize;
     const int kArgumentsOffset = kNewTargetOffset + kPointerSize;
     const int kFunctionOffset = kArgumentsOffset + kPointerSize;
@@ -1565,8 +1566,10 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {
     __ push(a0);
     __ ld(a0, MemOperand(fp, kNewTargetOffset));  // get the new.target
     __ push(a0);
+    // Returns argument count in v0.
     __ InvokeBuiltin(Builtins::REFLECT_CONSTRUCT_PREPARE, CALL_FUNCTION);

+    // Returns result in v0.
     Generate_CheckStackOverflow(masm, kFunctionOffset);

     // Push current limit and index.
@@ -1599,8 +1602,8 @@ static void Generate_ConstructHelper(MacroAssembler* masm) {

     // Leave internal frame.
   }
-  __ Daddu(sp, sp, Operand(kStackSize * kPointerSize));
-  __ Jump(ra);
+  __ jr(ra);
+  __ Daddu(sp, sp, Operand(kStackSize * kPointerSize));  // In delay slot.
 }




--
--
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/d/optout.

Reply via email to