| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/interpreter/bytecode-flags.h" | 10 #include "src/interpreter/bytecode-flags.h" |
| (...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 Literal* key = property->key()->AsLiteral(); | 1641 Literal* key = property->key()->AsLiteral(); |
| 1642 switch (property->kind()) { | 1642 switch (property->kind()) { |
| 1643 case ObjectLiteral::Property::CONSTANT: | 1643 case ObjectLiteral::Property::CONSTANT: |
| 1644 UNREACHABLE(); | 1644 UNREACHABLE(); |
| 1645 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1645 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 1646 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); | 1646 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); |
| 1647 // Fall through. | 1647 // Fall through. |
| 1648 case ObjectLiteral::Property::COMPUTED: { | 1648 case ObjectLiteral::Property::COMPUTED: { |
| 1649 // It is safe to use [[Put]] here because the boilerplate already | 1649 // It is safe to use [[Put]] here because the boilerplate already |
| 1650 // contains computed properties with an uninitialized value. | 1650 // contains computed properties with an uninitialized value. |
| 1651 if (key->IsPropertyName()) { | 1651 if (key->IsStringLiteral()) { |
| 1652 DCHECK(key->IsPropertyName()); |
| 1652 if (property->emit_store()) { | 1653 if (property->emit_store()) { |
| 1653 VisitForAccumulatorValue(property->value()); | 1654 VisitForAccumulatorValue(property->value()); |
| 1654 if (FunctionLiteral::NeedsHomeObject(property->value())) { | 1655 if (FunctionLiteral::NeedsHomeObject(property->value())) { |
| 1655 RegisterAllocationScope register_scope(this); | 1656 RegisterAllocationScope register_scope(this); |
| 1656 Register value = register_allocator()->NewRegister(); | 1657 Register value = register_allocator()->NewRegister(); |
| 1657 builder()->StoreAccumulatorInRegister(value); | 1658 builder()->StoreAccumulatorInRegister(value); |
| 1658 builder()->StoreNamedProperty( | 1659 builder()->StoreNamedProperty( |
| 1659 literal, key->AsPropertyName(), | 1660 literal, key->AsPropertyName(), |
| 1660 feedback_index(property->GetSlot(0)), language_mode()); | 1661 feedback_index(property->GetSlot(0)), language_mode()); |
| 1661 VisitSetHomeObject(value, literal, property, 1); | 1662 VisitSetHomeObject(value, literal, property, 1); |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3277 return execution_context()->scope()->language_mode(); | 3278 return execution_context()->scope()->language_mode(); |
| 3278 } | 3279 } |
| 3279 | 3280 |
| 3280 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3281 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3281 return TypeFeedbackVector::GetIndex(slot); | 3282 return TypeFeedbackVector::GetIndex(slot); |
| 3282 } | 3283 } |
| 3283 | 3284 |
| 3284 } // namespace interpreter | 3285 } // namespace interpreter |
| 3285 } // namespace internal | 3286 } // namespace internal |
| 3286 } // namespace v8 | 3287 } // namespace v8 |
| OLD | NEW |