Index: src/ppc/full-codegen-ppc.cc |
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc |
index ebd7efe8fbdb5534631ed245aa7fae530a2f119f..0145d006488afab0ebd5d46736d6252a01d87756 100644 |
--- a/src/ppc/full-codegen-ppc.cc |
+++ b/src/ppc/full-codegen-ppc.cc |
@@ -3094,15 +3094,20 @@ |
void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
- // r7: copy of the first argument or undefined if it doesn't exist. |
+ // r8: copy of the first argument or undefined if it doesn't exist. |
if (arg_count > 0) { |
- __ LoadP(r7, MemOperand(sp, arg_count * kPointerSize), r0); |
+ __ LoadP(r8, MemOperand(sp, arg_count * kPointerSize), r0); |
} else { |
- __ LoadRoot(r7, Heap::kUndefinedValueRootIndex); |
- } |
+ __ LoadRoot(r8, Heap::kUndefinedValueRootIndex); |
+ } |
+ |
+ // r7: the receiver of the enclosing function. |
+ __ LoadP(r7, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
// r6: the receiver of the enclosing function. |
- __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
+ Variable* this_var = scope()->LookupThis(); |
+ DCHECK_NOT_NULL(this_var); |
+ GetVar(r6, this_var); |
// r5: language mode. |
__ LoadSmiLiteral(r5, Smi::FromInt(language_mode())); |
@@ -3111,8 +3116,8 @@ |
__ LoadSmiLiteral(r4, Smi::FromInt(scope()->start_position())); |
// Do the runtime call. |
- __ Push(r7, r6, r5, r4); |
- __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5); |
+ __ Push(r8, r7, r6, r5, r4); |
+ __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6); |
} |
@@ -3145,8 +3150,9 @@ |
if (call_type == Call::POSSIBLY_EVAL_CALL) { |
// In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval |
- // to resolve the function we need to call. Then we call the resolved |
- // function using the given arguments. |
+ // to resolve the function we need to call and the receiver of the |
+ // call. Then we call the resolved function using the given |
+ // arguments. |
ZoneList<Expression*>* args = expr->arguments(); |
int arg_count = args->length(); |
@@ -3167,8 +3173,10 @@ |
__ push(r4); |
EmitResolvePossiblyDirectEval(arg_count); |
- // Touch up the stack with the resolved function. |
+ // The runtime call returns a pair of values in r3 (function) and |
+ // r4 (receiver). Touch up the stack with the right values. |
__ StoreP(r3, MemOperand(sp, (arg_count + 1) * kPointerSize), r0); |
+ __ StoreP(r4, MemOperand(sp, arg_count * kPointerSize), r0); |
PrepareForBailoutForId(expr->EvalOrLookupId(), NO_REGISTERS); |
} |
@@ -4797,10 +4805,9 @@ |
context()->Plug(r3); |
} else if (proxy != NULL) { |
Variable* var = proxy->var(); |
- // Delete of an unqualified identifier is disallowed in strict mode but |
- // "delete this" is allowed. |
- bool is_this = var->HasThisName(isolate()); |
- DCHECK(is_sloppy(language_mode()) || is_this); |
+ // Delete of an unqualified identifier is disallowed in strict mode |
+ // but "delete this" is allowed. |
+ DCHECK(is_sloppy(language_mode()) || var->is_this()); |
if (var->IsUnallocated()) { |
__ LoadP(r5, GlobalObjectOperand()); |
__ mov(r4, Operand(var->name())); |
@@ -4811,7 +4818,7 @@ |
} else if (var->IsStackAllocated() || var->IsContextSlot()) { |
// Result of deleting non-global, non-dynamic variables is false. |
// The subexpression does not have side effects. |
- context()->Plug(is_this); |
+ context()->Plug(var->is_this()); |
} else { |
// Non-global variable. Call the runtime to try to delete from the |
// context where the variable was introduced. |