From: balazs.kilvady@imgtec.com Date: Fri, 17 Oct 2014 11:30:13 +0000 (+0000) Subject: MIPS: Implement the new semantics for 'super(...)'. X-Git-Tag: upstream/4.7.83~6291 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15e018db2d936fa512c46359dcd5919ccdbcf91e;p=platform%2Fupstream%2Fv8.git MIPS: Implement the new semantics for 'super(...)'. Port r24683 (b1533f6) Original commit message: Per the latest ES6 draft, super(...) translates into a call to function's prototype. BUG=v8:3330 LOG=N R=dusan.milosavljevic@imgtec.com Review URL: https://codereview.chromium.org/661043003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24690 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 6f7166b..9f26d4c 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -3049,6 +3049,15 @@ void FullCodeGenerator::VisitCall(Call* expr) { EmitKeyedCallWithLoadIC(expr, property->key()); } } + } else if (call_type == Call::SUPER_CALL) { + SuperReference* super_ref = callee->AsSuperReference(); + DCHECK(super_ref != NULL); + __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); + __ Push(a0); + __ CallRuntime(Runtime::kGetPrototype, 1); + __ Push(result_register()); + VisitForStackValue(super_ref->this_var()); + EmitCall(expr, CallICState::METHOD); } else { DCHECK(call_type == Call::OTHER_CALL); // Call to an arbitrary expression not handled specially above. diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc index 79eec06..1a76c52 100644 --- a/src/mips64/full-codegen-mips64.cc +++ b/src/mips64/full-codegen-mips64.cc @@ -3048,6 +3048,15 @@ void FullCodeGenerator::VisitCall(Call* expr) { EmitKeyedCallWithLoadIC(expr, property->key()); } } + } 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); + __ Push(result_register()); + VisitForStackValue(super_ref->this_var()); + EmitCall(expr, CallICState::METHOD); } else { DCHECK(call_type == Call::OTHER_CALL); // Call to an arbitrary expression not handled specially above.