Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: src/hydrogen.cc

Issue 718473002: ES6: Add support for super in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports too Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 6184bb9e46b25c6a22015b216a3e60046a537f2d..f9aa516cde09290c63f6c4b50df05137c670fe5f 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5625,6 +5625,19 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
if (property->emit_store()) {
CHECK_ALIVE(VisitForValue(value));
HValue* value = Pop();
+
+ // Add [[HomeObject]] to function literals.
+ if (property->value()->IsFunctionLiteral() &&
+ property->value()->AsFunctionLiteral()->needs_super_binding()) {
+ Handle<Symbol> sym = isolate()->factory()->home_object_symbol();
+ HInstruction* store_home = BuildKeyedGeneric(
+ STORE, NULL, value, Add<HConstant>(sym), literal);
+ AddInstruction(store_home);
+ if (store_home->HasObservableSideEffects()) {
Dmitry Lomov (no reviews) 2014/11/11 11:50:38 Since it is a store, it will always have side effe
arv (Not doing code reviews) 2014/11/11 17:19:07 Done.
+ Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE);
+ }
+ }
+
Handle<Map> map = property->GetReceiverType();
Handle<String> name = property->key()->AsPropertyName();
HInstruction* store;

Powered by Google App Engine
This is Rietveld 408576698