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; |