Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index aee3c8c018d48e18e12c03e27becf4a128533915..33345f32f3007c8e077766b12deb2fc8f1baeab9 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -425,6 +425,9 @@ void FullCodeGenerator::EmitReturnSequence() { |
} |
} |
+void FullCodeGenerator::RestoreContext() { |
+ __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+} |
void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
@@ -1373,7 +1376,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ Move(rdx, Smi::FromInt(flags)); |
FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); |
__ CallStub(&stub); |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
@@ -1806,8 +1809,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ j(equal, &post_runtime); |
__ Push(rax); // generator object |
__ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ movp(context_register(), |
- Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
__ bind(&post_runtime); |
PopOperand(result_register()); |
@@ -2413,9 +2415,7 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
// Discard the function left on TOS. |
context()->DropAndPlug(1, rax); |
} |
@@ -2518,8 +2518,7 @@ void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) { |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- // Restore context register. |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->DropAndPlug(1, rax); |
} |
@@ -2559,8 +2558,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
__ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
- // Restore context register. |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(rax); |
} |
@@ -2601,10 +2599,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
- |
+ RestoreContext(); |
context()->Plug(rax); |
} |
@@ -3003,8 +2998,7 @@ void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
__ Set(rax, argc); |
__ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(argc + 1); |
- // Restore context register. |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
// Discard the function left on TOS. |
context()->DropAndPlug(1, rax); |
} |
@@ -3123,9 +3117,7 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
__ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
- |
- // Restore context register. |
- __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
@@ -3597,7 +3589,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
case Token::IN: |
VisitForStackValue(expr->right()); |
SetExpressionPosition(expr); |
- CallRuntimeWithOperands(Runtime::kHasProperty); |
+ EmitHasProperty(); |
PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
__ CompareRoot(rax, Heap::kTrueValueRootIndex); |
Split(equal, if_true, if_false, fall_through); |