| Index: src/mips64/full-codegen-mips64.cc
|
| diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc
|
| index b57dbb1dd4c7d648521121e4b9496fa0b775f6b7..959edc0d5490306d1ed0ea501117024a05ef731b 100644
|
| --- a/src/mips64/full-codegen-mips64.cc
|
| +++ b/src/mips64/full-codegen-mips64.cc
|
| @@ -2938,6 +2938,14 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EmitLoadSuperConstructor(SuperReference* super_ref) {
|
| + DCHECK(super_ref != NULL);
|
| + __ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| + __ Push(a0);
|
| + __ CallRuntime(Runtime::kGetPrototype, 1);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::VisitCall(Call* expr) {
|
| #ifdef DEBUG
|
| // We want to verify that RecordJSReturnSite gets called on all paths
|
| @@ -3053,10 +3061,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| }
|
| } else if (call_type == Call::SUPER_CALL) {
|
| SuperReference* super_ref = callee->AsSuperReference();
|
| - DCHECK(super_ref != NULL);
|
| - __ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
| - __ Push(a0);
|
| - __ CallRuntime(Runtime::kGetPrototype, 1);
|
| + EmitLoadSuperConstructor(super_ref);
|
| __ Push(result_register());
|
| VisitForStackValue(super_ref->this_var());
|
| EmitCall(expr, CallICState::METHOD);
|
| @@ -3088,7 +3093,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();
|
|
|