Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index 7d918816ed50ea92d4cb4de05761207923880647..0cc1753272c688ee13a2d07586265137379c8d9a 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -460,6 +460,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()); |
@@ -1404,7 +1407,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); |
@@ -2428,8 +2431,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, x0); |
} |
@@ -2539,8 +2541,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, x0); |
} |
@@ -2580,8 +2581,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(x0); |
} |
@@ -2625,9 +2625,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(x0); |
} |
@@ -3023,8 +3021,7 @@ void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
__ Mov(x0, 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, x0); |
} |
@@ -3152,9 +3149,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(); |
} |
@@ -3627,7 +3622,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
case Token::IN: |
VisitForStackValue(expr->right()); |
SetExpressionPosition(expr); |
- CallRuntimeWithOperands(Runtime::kHasProperty); |
+ EmitHasProperty(); |
PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
__ CompareRoot(x0, Heap::kTrueValueRootIndex); |
Split(eq, if_true, if_false, fall_through); |
@@ -3758,7 +3753,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ B(eq, &post_runtime); |
__ Push(x0); // generator object |
__ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
__ Bind(&post_runtime); |
PopOperand(result_register()); |
EmitReturnSequence(); |