Reviewers: dstence, michael_dawson, wingo,

Description:
PPC: Fix "Fix receiver when calling eval() bound by with scope"

[email protected], [email protected], [email protected]
BUG=

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

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

Affected files (+13, -12 lines):
  M src/ppc/builtins-ppc.cc
  M src/ppc/full-codegen-ppc.cc


Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index 02fc030634d10c6e39ccf96349e11e992de3ce33..5ecd7d918242169d530c3bf6341142c20c420395 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1401,7 +1401,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {

// 5b. Get the code to call from the function and check that the number of
   //     expected arguments matches what we're providing.  If so, jump
- // (tail-call) to the code in register edx without checking arguments.
+  //     (tail-call) to the code in register ip without checking arguments.
   // r3: actual number of arguments
   // r4: function
   __ LoadP(r6, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
Index: src/ppc/full-codegen-ppc.cc
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc
index e89be857cfd4c70a83fba91986b99ccb50f2d3e6..83526dd7d87920f196023f244aa68ce08c49f792 100644
--- a/src/ppc/full-codegen-ppc.cc
+++ b/src/ppc/full-codegen-ppc.cc
@@ -3148,34 +3148,35 @@ void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
       EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done);
     }
     __ bind(&slow);
-    // Call the runtime to find the function to call (returned in rax) and
-    // the object holding it (returned in rdx).
-    __ Push(context_register());
-    __ Push(callee->name());
+    // Call the runtime to find the function to call (returned in r3) and
+    // the object holding it (returned in r4).
+    DCHECK(!context_register().is(r5));
+    __ mov(r5, Operand(callee->name()));
+    __ Push(context_register(), r5);
     __ CallRuntime(Runtime::kLoadLookupSlot, 2);
-    __ Push(rax);  // Function.
-    __ Push(rdx);  // Receiver.
+    __ Push(r3, r4);  // Function, receiver.
     PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS);

     // If fast case code has been generated, emit code to push the function
     // and receiver and have the slow path jump around this code.
     if (done.is_linked()) {
       Label call;
-      __ jmp(&call, Label::kNear);
+      __ b(&call);
       __ bind(&done);
       // Push function.
-      __ Push(rax);
+      __ push(r3);
       // Pass undefined as the receiver, which is the WithBaseObject of a
// non-object environment record. If the callee is sloppy, it will patch
       // it up to be the global receiver.
-      __ PushRoot(Heap::kUndefinedValueRootIndex);
+      __ LoadRoot(r4, Heap::kUndefinedValueRootIndex);
+      __ push(r4);
       __ bind(&call);
     }
   } else {
     VisitForStackValue(callee);
     // refEnv.WithBaseObject()
     __ LoadRoot(r5, Heap::kUndefinedValueRootIndex);
-    __ push(r5);
+    __ push(r5);  // Reserved receiver slot.
   }
 }

@@ -3796,7 +3797,7 @@ void FullCodeGenerator::EmitArguments(CallRuntime* expr) {
   ZoneList<Expression*>* args = expr->arguments();
   DCHECK(args->length() == 1);

-  // ArgumentsAccessStub expects the key in edx and the formal
+  // ArgumentsAccessStub expects the key in r4 and the formal
   // parameter count in r3.
   VisitForAccumulatorValue(args->at(0));
   __ mr(r4, r3);


--
--
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