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 5635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5646 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 5646 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
5647 DCHECK(!CompileTimeValue::IsCompileTimeValue(value)); | 5647 DCHECK(!CompileTimeValue::IsCompileTimeValue(value)); |
5648 // Fall through. | 5648 // Fall through. |
5649 case ObjectLiteral::Property::COMPUTED: | 5649 case ObjectLiteral::Property::COMPUTED: |
5650 // It is safe to use [[Put]] here because the boilerplate already | 5650 // It is safe to use [[Put]] here because the boilerplate already |
5651 // contains computed properties with an uninitialized value. | 5651 // contains computed properties with an uninitialized value. |
5652 if (key->value()->IsInternalizedString()) { | 5652 if (key->value()->IsInternalizedString()) { |
5653 if (property->emit_store()) { | 5653 if (property->emit_store()) { |
5654 CHECK_ALIVE(VisitForValue(value)); | 5654 CHECK_ALIVE(VisitForValue(value)); |
5655 HValue* value = Pop(); | 5655 HValue* value = Pop(); |
5656 | |
5657 // Add [[HomeObject]] to function literals. | |
5658 if (FunctionLiteral::NeedsHomeObject(property->value())) { | |
5659 Handle<Symbol> sym = isolate()->factory()->home_object_symbol(); | |
5660 HInstruction* store_home = BuildKeyedGeneric( | |
5661 STORE, NULL, value, Add<HConstant>(sym), literal); | |
5662 AddInstruction(store_home); | |
5663 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.
| |
5664 Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE); | |
5665 } | |
5666 } | |
5667 | |
5656 Handle<Map> map = property->GetReceiverType(); | 5668 Handle<Map> map = property->GetReceiverType(); |
5657 Handle<String> name = property->key()->AsPropertyName(); | 5669 Handle<String> name = property->key()->AsPropertyName(); |
5658 HInstruction* store; | 5670 HInstruction* store; |
5659 if (map.is_null()) { | 5671 if (map.is_null()) { |
5660 // If we don't know the monomorphic type, do a generic store. | 5672 // If we don't know the monomorphic type, do a generic store. |
5661 CHECK_ALIVE(store = BuildNamedGeneric( | 5673 CHECK_ALIVE(store = BuildNamedGeneric( |
5662 STORE, NULL, literal, name, value)); | 5674 STORE, NULL, literal, name, value)); |
5663 } else { | 5675 } else { |
5664 PropertyAccessInfo info(this, STORE, ToType(map), name); | 5676 PropertyAccessInfo info(this, STORE, ToType(map), name); |
5665 if (info.CanAccessMonomorphic()) { | 5677 if (info.CanAccessMonomorphic()) { |
5666 HValue* checked_literal = Add<HCheckMaps>(literal, map); | 5678 HValue* checked_literal = Add<HCheckMaps>(literal, map); |
5667 DCHECK(!info.IsAccessor()); | 5679 DCHECK(!info.IsAccessor()); |
5668 store = BuildMonomorphicAccess( | 5680 store = BuildMonomorphicAccess( |
5669 &info, literal, checked_literal, value, | 5681 &info, literal, checked_literal, value, |
5670 BailoutId::None(), BailoutId::None()); | 5682 BailoutId::None(), BailoutId::None()); |
5671 } else { | 5683 } else { |
5672 CHECK_ALIVE(store = BuildNamedGeneric( | 5684 CHECK_ALIVE(store = BuildNamedGeneric( |
5673 STORE, NULL, literal, name, value)); | 5685 STORE, NULL, literal, name, value)); |
5674 } | 5686 } |
5675 } | 5687 } |
5676 AddInstruction(store); | 5688 AddInstruction(store); |
5677 if (store->HasObservableSideEffects()) { | 5689 DCHECK(store->HasObservableSideEffects()); |
5678 Add<HSimulate>(key->id(), REMOVABLE_SIMULATE); | 5690 Add<HSimulate>(key->id(), REMOVABLE_SIMULATE); |
5679 } | |
5680 } else { | 5691 } else { |
5681 CHECK_ALIVE(VisitForEffect(value)); | 5692 CHECK_ALIVE(VisitForEffect(value)); |
5682 } | 5693 } |
5683 break; | 5694 break; |
5684 } | 5695 } |
5685 // Fall through. | 5696 // Fall through. |
5686 case ObjectLiteral::Property::PROTOTYPE: | 5697 case ObjectLiteral::Property::PROTOTYPE: |
5687 case ObjectLiteral::Property::SETTER: | 5698 case ObjectLiteral::Property::SETTER: |
5688 case ObjectLiteral::Property::GETTER: | 5699 case ObjectLiteral::Property::GETTER: |
5689 return Bailout(kObjectLiteralWithComplexProperty); | 5700 return Bailout(kObjectLiteralWithComplexProperty); |
(...skipping 7039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12729 if (ShouldProduceTraceOutput()) { | 12740 if (ShouldProduceTraceOutput()) { |
12730 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12741 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12731 } | 12742 } |
12732 | 12743 |
12733 #ifdef DEBUG | 12744 #ifdef DEBUG |
12734 graph_->Verify(false); // No full verify. | 12745 graph_->Verify(false); // No full verify. |
12735 #endif | 12746 #endif |
12736 } | 12747 } |
12737 | 12748 |
12738 } } // namespace v8::internal | 12749 } } // namespace v8::internal |
OLD | NEW |