From 48a7db06094e814f208d453b0e10a6d6aa631133 Mon Sep 17 00:00:00 2001 From: "weiliang.lin@intel.com" Date: Mon, 20 Oct 2014 02:00:50 +0000 Subject: [PATCH] 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 . git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x87/full-codegen-x87.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc index 0c4ddb8215..8ae718f160 100644 --- a/src/x87/full-codegen-x87.cc +++ b/src/x87/full-codegen-x87.cc @@ -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.