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

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 code review comments 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 b9b3eb0819c30ad6d141de5d7cadcb1351218b9b..bf7dfac399be0739e5af5aa86a5e2a296ba39e5d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5653,6 +5653,18 @@ 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);
+ if (store_home->HasObservableSideEffects()) {
Dmitry Lomov (no reviews) 2014/11/11 19:27:47 'if' -> DCHECK
arv (Not doing code reviews) 2014/11/11 19:51:29 Done.
+ Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE);
+ }
+ }
+
Handle<Map> map = property->GetReceiverType();
Handle<String> name = property->key()->AsPropertyName();
HInstruction* store;
@@ -5674,9 +5686,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));
}

Powered by Google App Engine
This is Rietveld 408576698