Index: src/full-codegen/arm/full-codegen-arm.cc |
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc |
index 49a35c851896e59f8ec9b80991f471e49d26eb53..ab5cb674ba296e4eef2a71a8de25c50b40b9a4bf 100644 |
--- a/src/full-codegen/arm/full-codegen-arm.cc |
+++ b/src/full-codegen/arm/full-codegen-arm.cc |
@@ -468,6 +468,9 @@ void FullCodeGenerator::EmitReturnSequence() { |
} |
} |
+void FullCodeGenerator::RestoreContext() { |
+ __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+} |
void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
@@ -1418,7 +1421,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
} else { |
FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); |
__ CallStub(&stub); |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
@@ -1866,7 +1869,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ b(eq, &post_runtime); |
__ push(r0); // generator object |
__ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
__ bind(&post_runtime); |
PopOperand(result_register()); |
EmitReturnSequence(); |
@@ -2527,8 +2530,7 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- // Restore context register. |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->DropAndPlug(1, r0); |
} |
@@ -2635,8 +2637,7 @@ void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) { |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- // Restore context register. |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->DropAndPlug(1, r0); |
} |
@@ -2676,8 +2677,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
__ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
- // Restore context register. |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(r0); |
} |
@@ -2720,9 +2720,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(r0); |
} |
@@ -3118,8 +3116,7 @@ void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
__ mov(r0, Operand(argc)); |
__ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(argc + 1); |
- // Restore context register. |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
// Discard the function left on TOS. |
context()->DropAndPlug(1, r0); |
} |
@@ -3236,9 +3233,7 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
__ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
- |
- // Restore context register. |
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
@@ -3704,7 +3699,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
case Token::IN: |
VisitForStackValue(expr->right()); |
SetExpressionPosition(expr); |
- CallRuntimeWithOperands(Runtime::kHasProperty); |
+ EmitHasProperty(); |
PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
__ CompareRoot(r0, Heap::kTrueValueRootIndex); |
Split(eq, if_true, if_false, fall_through); |