Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 5607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5618 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 5618 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 5619 DCHECK(!CompileTimeValue::IsCompileTimeValue(value)); | 5619 DCHECK(!CompileTimeValue::IsCompileTimeValue(value)); |
| 5620 // Fall through. | 5620 // Fall through. |
| 5621 case ObjectLiteral::Property::COMPUTED: | 5621 case ObjectLiteral::Property::COMPUTED: |
| 5622 // It is safe to use [[Put]] here because the boilerplate already | 5622 // It is safe to use [[Put]] here because the boilerplate already |
| 5623 // contains computed properties with an uninitialized value. | 5623 // contains computed properties with an uninitialized value. |
| 5624 if (key->value()->IsInternalizedString()) { | 5624 if (key->value()->IsInternalizedString()) { |
| 5625 if (property->emit_store()) { | 5625 if (property->emit_store()) { |
| 5626 CHECK_ALIVE(VisitForValue(value)); | 5626 CHECK_ALIVE(VisitForValue(value)); |
| 5627 HValue* value = Pop(); | 5627 HValue* value = Pop(); |
| 5628 | |
| 5629 // Add [[HomeObject]] to function literals. | |
| 5630 if (property->value()->IsFunctionLiteral() && | |
| 5631 property->value()->AsFunctionLiteral()->needs_super_binding()) { | |
| 5632 Handle<Symbol> sym = isolate()->factory()->home_object_symbol(); | |
| 5633 HInstruction* store_home = BuildKeyedGeneric( | |
| 5634 STORE, NULL, value, Add<HConstant>(sym), literal); | |
| 5635 AddInstruction(store_home); | |
| 5636 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.
| |
| 5637 Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE); | |
| 5638 } | |
| 5639 } | |
| 5640 | |
| 5628 Handle<Map> map = property->GetReceiverType(); | 5641 Handle<Map> map = property->GetReceiverType(); |
| 5629 Handle<String> name = property->key()->AsPropertyName(); | 5642 Handle<String> name = property->key()->AsPropertyName(); |
| 5630 HInstruction* store; | 5643 HInstruction* store; |
| 5631 if (map.is_null()) { | 5644 if (map.is_null()) { |
| 5632 // If we don't know the monomorphic type, do a generic store. | 5645 // If we don't know the monomorphic type, do a generic store. |
| 5633 CHECK_ALIVE(store = BuildNamedGeneric( | 5646 CHECK_ALIVE(store = BuildNamedGeneric( |
| 5634 STORE, NULL, literal, name, value)); | 5647 STORE, NULL, literal, name, value)); |
| 5635 } else { | 5648 } else { |
| 5636 PropertyAccessInfo info(this, STORE, ToType(map), name); | 5649 PropertyAccessInfo info(this, STORE, ToType(map), name); |
| 5637 if (info.CanAccessMonomorphic()) { | 5650 if (info.CanAccessMonomorphic()) { |
| (...skipping 7034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12672 if (ShouldProduceTraceOutput()) { | 12685 if (ShouldProduceTraceOutput()) { |
| 12673 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12686 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12674 } | 12687 } |
| 12675 | 12688 |
| 12676 #ifdef DEBUG | 12689 #ifdef DEBUG |
| 12677 graph_->Verify(false); // No full verify. | 12690 graph_->Verify(false); // No full verify. |
| 12678 #endif | 12691 #endif |
| 12679 } | 12692 } |
| 12680 | 12693 |
| 12681 } } // namespace v8::internal | 12694 } } // namespace v8::internal |
| OLD | NEW |