Index: src/full-codegen/x87/full-codegen-x87.cc |
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc |
index 384ea45508f4bc2032739c0faf05a16a73e93936..3e1481b1812a548a25ad81fccb2a263aefdaaa64 100644 |
--- a/src/full-codegen/x87/full-codegen-x87.cc |
+++ b/src/full-codegen/x87/full-codegen-x87.cc |
@@ -420,6 +420,9 @@ void FullCodeGenerator::EmitReturnSequence() { |
} |
} |
+void FullCodeGenerator::RestoreContext() { |
+ __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+} |
void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
@@ -1339,7 +1342,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ mov(edx, Immediate(Smi::FromInt(flags))); |
FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); |
__ CallStub(&stub); |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
@@ -1774,8 +1777,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ j(equal, &post_runtime); |
__ push(eax); // generator object |
__ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ mov(context_register(), |
- Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
__ bind(&post_runtime); |
PopOperand(result_register()); |
EmitReturnSequence(); |
@@ -2416,10 +2418,7 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
- |
+ RestoreContext(); |
context()->DropAndPlug(1, eax); |
} |
@@ -2521,8 +2520,7 @@ void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) { |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->DropAndPlug(1, eax); |
} |
@@ -2562,8 +2560,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
__ call(stub.GetCode(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(eax); |
} |
@@ -2604,9 +2601,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(eax); |
} |
@@ -3007,8 +3002,7 @@ void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
__ mov(eax, Immediate(argc)); |
__ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(argc + 1); |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
// Discard the function left on TOS. |
context()->DropAndPlug(1, eax); |
} |
@@ -3128,9 +3122,7 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
__ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
- |
- // Restore context register. |
- __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
@@ -3604,7 +3596,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
case Token::IN: |
VisitForStackValue(expr->right()); |
SetExpressionPosition(expr); |
- CallRuntimeWithOperands(Runtime::kHasProperty); |
+ EmitHasProperty(); |
PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
__ cmp(eax, isolate()->factory()->true_value()); |
Split(equal, if_true, if_false, fall_through); |