Revision: 24711
Author:   [email protected]
Date:     Mon Oct 20 02:00:50 2014 UTC
Log:      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=
[email protected]

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

Patch from Chunyang Dai <[email protected]>.
https://code.google.com/p/v8/source/detail?r=24711

Modified:
 /branches/bleeding_edge/src/x87/full-codegen-x87.cc

=======================================
--- /branches/bleeding_edge/src/x87/full-codegen-x87.cc Thu Oct 16 06:24:47 2014 UTC +++ /branches/bleeding_edge/src/x87/full-codegen-x87.cc Mon Oct 20 02:00:50 2014 UTC
@@ -2959,6 +2959,14 @@
         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.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to