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
parent 8c5f9b6b
...@@ -3049,6 +3049,15 @@ void FullCodeGenerator::VisitCall(Call* expr) { ...@@ -3049,6 +3049,15 @@ void FullCodeGenerator::VisitCall(Call* expr) {
EmitKeyedCallWithLoadIC(expr, property->key()); 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 { } else {
DCHECK(call_type == Call::OTHER_CALL); DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above. // Call to an arbitrary expression not handled specially above.
......
...@@ -3048,6 +3048,15 @@ void FullCodeGenerator::VisitCall(Call* expr) { ...@@ -3048,6 +3048,15 @@ void FullCodeGenerator::VisitCall(Call* expr) {
EmitKeyedCallWithLoadIC(expr, property->key()); 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 { } else {
DCHECK(call_type == Call::OTHER_CALL); DCHECK(call_type == Call::OTHER_CALL);
// Call to an arbitrary expression not handled specially above. // Call to an arbitrary expression not handled specially above.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment