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 5615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5626 } | 5626 } |
5627 | 5627 |
5628 // The object is expected in the bailout environment during computation | 5628 // The object is expected in the bailout environment during computation |
5629 // of the property values and is the value of the entire expression. | 5629 // of the property values and is the value of the entire expression. |
5630 Push(literal); | 5630 Push(literal); |
5631 | 5631 |
5632 expr->CalculateEmitStore(zone()); | 5632 expr->CalculateEmitStore(zone()); |
5633 | 5633 |
5634 for (int i = 0; i < expr->properties()->length(); i++) { | 5634 for (int i = 0; i < expr->properties()->length(); i++) { |
5635 ObjectLiteral::Property* property = expr->properties()->at(i); | 5635 ObjectLiteral::Property* property = expr->properties()->at(i); |
5636 if (property->is_computed_name()) { | |
5637 return Bailout(kComputedPropertyName); | |
5638 } | |
5639 if (property->IsCompileTimeValue()) continue; | 5636 if (property->IsCompileTimeValue()) continue; |
5640 | 5637 |
5641 Literal* key = property->key()->AsLiteral(); | 5638 Literal* key = property->key(); |
5642 Expression* value = property->value(); | 5639 Expression* value = property->value(); |
5643 | 5640 |
5644 switch (property->kind()) { | 5641 switch (property->kind()) { |
5645 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 5642 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
5646 DCHECK(!CompileTimeValue::IsCompileTimeValue(value)); | 5643 DCHECK(!CompileTimeValue::IsCompileTimeValue(value)); |
5647 // Fall through. | 5644 // Fall through. |
5648 case ObjectLiteral::Property::COMPUTED: | 5645 case ObjectLiteral::Property::COMPUTED: |
5649 // It is safe to use [[Put]] here because the boilerplate already | 5646 // It is safe to use [[Put]] here because the boilerplate already |
5650 // contains computed properties with an uninitialized value. | 5647 // contains computed properties with an uninitialized value. |
5651 if (key->value()->IsInternalizedString()) { | 5648 if (key->value()->IsInternalizedString()) { |
5652 if (property->emit_store()) { | 5649 if (property->emit_store()) { |
5653 CHECK_ALIVE(VisitForValue(value)); | 5650 CHECK_ALIVE(VisitForValue(value)); |
5654 HValue* value = Pop(); | 5651 HValue* value = Pop(); |
5655 | 5652 |
5656 // Add [[HomeObject]] to function literals. | 5653 // Add [[HomeObject]] to function literals. |
5657 if (FunctionLiteral::NeedsHomeObject(property->value())) { | 5654 if (FunctionLiteral::NeedsHomeObject(property->value())) { |
5658 Handle<Symbol> sym = isolate()->factory()->home_object_symbol(); | 5655 Handle<Symbol> sym = isolate()->factory()->home_object_symbol(); |
5659 HInstruction* store_home = BuildKeyedGeneric( | 5656 HInstruction* store_home = BuildKeyedGeneric( |
5660 STORE, NULL, value, Add<HConstant>(sym), literal); | 5657 STORE, NULL, value, Add<HConstant>(sym), literal); |
5661 AddInstruction(store_home); | 5658 AddInstruction(store_home); |
5662 DCHECK(store_home->HasObservableSideEffects()); | 5659 DCHECK(store_home->HasObservableSideEffects()); |
5663 Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE); | 5660 Add<HSimulate>(property->value()->id(), REMOVABLE_SIMULATE); |
5664 } | 5661 } |
5665 | 5662 |
5666 Handle<Map> map = property->GetReceiverType(); | 5663 Handle<Map> map = property->GetReceiverType(); |
5667 Handle<String> name = key->AsPropertyName(); | 5664 Handle<String> name = property->key()->AsPropertyName(); |
5668 HInstruction* store; | 5665 HInstruction* store; |
5669 if (map.is_null()) { | 5666 if (map.is_null()) { |
5670 // If we don't know the monomorphic type, do a generic store. | 5667 // If we don't know the monomorphic type, do a generic store. |
5671 CHECK_ALIVE(store = BuildNamedGeneric( | 5668 CHECK_ALIVE(store = BuildNamedGeneric( |
5672 STORE, NULL, literal, name, value)); | 5669 STORE, NULL, literal, name, value)); |
5673 } else { | 5670 } else { |
5674 PropertyAccessInfo info(this, STORE, ToType(map), name); | 5671 PropertyAccessInfo info(this, STORE, ToType(map), name); |
5675 if (info.CanAccessMonomorphic()) { | 5672 if (info.CanAccessMonomorphic()) { |
5676 HValue* checked_literal = Add<HCheckMaps>(literal, map); | 5673 HValue* checked_literal = Add<HCheckMaps>(literal, map); |
5677 DCHECK(!info.IsAccessor()); | 5674 DCHECK(!info.IsAccessor()); |
(...skipping 7816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13494 if (ShouldProduceTraceOutput()) { | 13491 if (ShouldProduceTraceOutput()) { |
13495 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13492 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13496 } | 13493 } |
13497 | 13494 |
13498 #ifdef DEBUG | 13495 #ifdef DEBUG |
13499 graph_->Verify(false); // No full verify. | 13496 graph_->Verify(false); // No full verify. |
13500 #endif | 13497 #endif |
13501 } | 13498 } |
13502 | 13499 |
13503 } } // namespace v8::internal | 13500 } } // namespace v8::internal |
OLD | NEW |