Index: src/full-codegen/mips/full-codegen-mips.cc |
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc |
index 4289b7dbd3ef0a5defc7188e90f63154d83c41e0..3b4c93fe4c304b042eaf20eb80b2bc6986de6cb3 100644 |
--- a/src/full-codegen/mips/full-codegen-mips.cc |
+++ b/src/full-codegen/mips/full-codegen-mips.cc |
@@ -459,6 +459,9 @@ void FullCodeGenerator::EmitReturnSequence() { |
} |
} |
+void FullCodeGenerator::RestoreContext() { |
+ __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+} |
void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
@@ -1413,7 +1416,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
} else { |
FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); |
__ CallStub(&stub); |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
@@ -1859,7 +1862,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ Branch(&post_runtime, eq, sp, Operand(a1)); |
__ push(v0); // generator object |
__ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
__ bind(&post_runtime); |
PopOperand(result_register()); |
EmitReturnSequence(); |
@@ -2532,8 +2535,7 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- // Restore context register. |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->DropAndPlug(1, v0); |
} |
@@ -2639,8 +2641,7 @@ void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) { |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- // Restore context register. |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->DropAndPlug(1, v0); |
} |
@@ -2680,8 +2681,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
__ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
- // Restore context register. |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(v0); |
} |
@@ -2724,9 +2724,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
OperandStackDepthDecrement(arg_count + 1); |
RecordJSReturnSite(expr); |
- |
- // Restore context register. |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
context()->Plug(v0); |
} |
@@ -3137,8 +3135,7 @@ void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
__ li(a0, Operand(argc)); |
__ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(argc + 1); |
- // Restore context register. |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
// Discard the function left on TOS. |
context()->DropAndPlug(1, v0); |
} |
@@ -3255,9 +3252,7 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
__ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
- |
- // Restore context register. |
- __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ RestoreContext(); |
} |
@@ -3724,7 +3719,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
case Token::IN: |
VisitForStackValue(expr->right()); |
SetExpressionPosition(expr); |
- CallRuntimeWithOperands(Runtime::kHasProperty); |
+ EmitHasProperty(); |
PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
__ LoadRoot(t0, Heap::kTrueValueRootIndex); |
Split(eq, v0, Operand(t0), if_true, if_false, fall_through); |