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

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: Fix remaining code review issues 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
« no previous file with comments | « src/full-codegen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index b9b3eb0819c30ad6d141de5d7cadcb1351218b9b..e91609dba4387ae6c75f80dca8fe84b7ec960a50 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5653,6 +5653,17 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
if (property->emit_store()) {
CHECK_ALIVE(VisitForValue(value));
HValue* value = Pop();
+
+ // Add [[HomeObject]] to function literals.
+ if (FunctionLiteral::NeedsHomeObject(property->value())) {
+ Handle<Symbol> sym = isolate()->factory()->home_object_symbol();
+ HInstruction* store_home = BuildKeyedGeneric(
+ STORE, NULL, value, Add<HConstant>(sym), literal);
+ AddInstruction(store_home);
+ DCHECK(store_home->HasObservableSideEffects());
+ Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE);
+ }
+
Handle<Map> map = property->GetReceiverType();
Handle<String> name = property->key()->AsPropertyName();
HInstruction* store;
@@ -5674,9 +5685,8 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
}
}
AddInstruction(store);
- if (store->HasObservableSideEffects()) {
- Add<HSimulate>(key->id(), REMOVABLE_SIMULATE);
- }
+ DCHECK(store->HasObservableSideEffects());
+ Add<HSimulate>(key->id(), REMOVABLE_SIMULATE);
} else {
CHECK_ALIVE(VisitForEffect(value));
}
« no previous file with comments | « src/full-codegen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698