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 3876eb39f8ef1aa16a98f5db3511cef08d1546ad..a4724567ffaf00c6c6d1b276391ddeba06b62b77 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -3120,6 +3120,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { |
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
__ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
+ // Restore context register. |
+ __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
context()->Plug(rax); |
} |
@@ -3169,6 +3171,9 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
RecordJSReturnSite(expr); |
+ // Restore context register. |
+ __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
+ |
context()->Plug(rax); |
} |
@@ -4081,9 +4086,10 @@ void FullCodeGenerator::EmitDefaultConstructorCallSuper(CallRuntime* expr) { |
CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); |
__ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
- __ Drop(1); |
+ // Restore context register. |
+ __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
- context()->Plug(result_register()); |
+ context()->DropAndPlug(1, rax); |
} |