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
This commit is contained in:
parent
8c5f9b6bb0
commit
15e018db2d
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user