X87: Implement the new semantics for 'super(...)'

original commit message:

  Implement the new semantics for 'super(...)'

  Per the latest ES6 draft, super(...) translates into a call
   to function's prototype.

BUG=
R=weiliang.lin@intel.com

Review URL: https://codereview.chromium.org/642603006

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
weiliang.lin@intel.com 2014-10-20 02:00:50 +00:00
parent 4b7c0c05c5
commit 48a7db0609

View File

@ -2959,6 +2959,14 @@ 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);
__ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
__ 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.