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
parent 4b7c0c05
......@@ -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.
......
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