| Index: src/arm64/full-codegen-arm64.cc
|
| diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
|
| index 3d3e5ee0f2f4fc835b0390fd26c69cded3dda91d..77089160d4f2621ff54592149edc05a50a849594 100644
|
| --- a/src/arm64/full-codegen-arm64.cc
|
| +++ b/src/arm64/full-codegen-arm64.cc
|
| @@ -2628,6 +2628,14 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EmitLoadSuperConstructor(SuperReference* expr) {
|
| + DCHECK(super_ref != NULL);
|
| + __ ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| + __ Push(x0);
|
| + __ CallRuntime(Runtime::kGetPrototype, 1);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::VisitCall(Call* expr) {
|
| #ifdef DEBUG
|
| // We want to verify that RecordJSReturnSite gets called on all paths
|
| @@ -2746,10 +2754,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| }
|
| } else if (call_type == Call::SUPER_CALL) {
|
| SuperReference* super_ref = callee->AsSuperReference();
|
| - DCHECK(super_ref != NULL);
|
| - __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| - __ Push(x0);
|
| - __ CallRuntime(Runtime::kGetPrototype, 1);
|
| + EmitLoadSuperConstructor(super_ref);
|
| __ Push(result_register());
|
| VisitForStackValue(super_ref->this_var());
|
| EmitCall(expr, CallICState::METHOD);
|
| @@ -2781,7 +2786,12 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
| // Push constructor on the stack. If it's not a function it's used as
|
| // receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
|
| // ignored.
|
| - VisitForStackValue(expr->expression());
|
| + if (expr->expression()->IsSuperReference()) {
|
| + EmitLoadSuperConstructor(expr->expression()->AsSuperReference());
|
| + __ Push(result_register());
|
| + } else {
|
| + VisitForStackValue(expr->expression());
|
| + }
|
|
|
| // Push the arguments ("left-to-right") on the stack.
|
| ZoneList<Expression*>* args = expr->arguments();
|
|
|