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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 .StoreAccumulatorInRegister(attr); | 1496 .StoreAccumulatorInRegister(attr); |
1497 attr_assigned = true; | 1497 attr_assigned = true; |
1498 } | 1498 } |
1499 | 1499 |
1500 switch (property->kind()) { | 1500 switch (property->kind()) { |
1501 case ClassLiteral::Property::METHOD: { | 1501 case ClassLiteral::Property::METHOD: { |
1502 DataPropertyInLiteralFlags flags = DataPropertyInLiteralFlag::kDontEnum; | 1502 DataPropertyInLiteralFlags flags = DataPropertyInLiteralFlag::kDontEnum; |
1503 if (property->NeedsSetFunctionName()) { | 1503 if (property->NeedsSetFunctionName()) { |
1504 flags |= DataPropertyInLiteralFlag::kSetFunctionName; | 1504 flags |= DataPropertyInLiteralFlag::kSetFunctionName; |
1505 } | 1505 } |
1506 builder()->StoreDataPropertyInLiteral(receiver, key, value, flags); | 1506 |
| 1507 FeedbackVectorSlot slot = property->GetStoreDataPropertySlot(); |
| 1508 DCHECK(!slot.IsInvalid()); |
| 1509 |
| 1510 builder() |
| 1511 ->LoadAccumulatorWithRegister(value) |
| 1512 .StoreDataPropertyInLiteral(receiver, key, flags, |
| 1513 feedback_index(slot)); |
1507 break; | 1514 break; |
1508 } | 1515 } |
1509 case ClassLiteral::Property::GETTER: { | 1516 case ClassLiteral::Property::GETTER: { |
1510 builder()->CallRuntime(Runtime::kDefineGetterPropertyUnchecked, args); | 1517 builder()->CallRuntime(Runtime::kDefineGetterPropertyUnchecked, args); |
1511 break; | 1518 break; |
1512 } | 1519 } |
1513 case ClassLiteral::Property::SETTER: { | 1520 case ClassLiteral::Property::SETTER: { |
1514 builder()->CallRuntime(Runtime::kDefineSetterPropertyUnchecked, args); | 1521 builder()->CallRuntime(Runtime::kDefineSetterPropertyUnchecked, args); |
1515 break; | 1522 break; |
1516 } | 1523 } |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 | 1745 |
1739 Register value = VisitForRegisterValue(property->value()); | 1746 Register value = VisitForRegisterValue(property->value()); |
1740 VisitSetHomeObject(value, literal, property); | 1747 VisitSetHomeObject(value, literal, property); |
1741 | 1748 |
1742 DataPropertyInLiteralFlags data_property_flags = | 1749 DataPropertyInLiteralFlags data_property_flags = |
1743 DataPropertyInLiteralFlag::kNoFlags; | 1750 DataPropertyInLiteralFlag::kNoFlags; |
1744 if (property->NeedsSetFunctionName()) { | 1751 if (property->NeedsSetFunctionName()) { |
1745 data_property_flags |= DataPropertyInLiteralFlag::kSetFunctionName; | 1752 data_property_flags |= DataPropertyInLiteralFlag::kSetFunctionName; |
1746 } | 1753 } |
1747 | 1754 |
1748 builder()->StoreDataPropertyInLiteral(literal, key, value, | 1755 FeedbackVectorSlot slot = property->GetStoreDataPropertySlot(); |
1749 data_property_flags); | 1756 DCHECK(!slot.IsInvalid()); |
| 1757 |
| 1758 builder() |
| 1759 ->LoadAccumulatorWithRegister(value) |
| 1760 .StoreDataPropertyInLiteral(literal, key, data_property_flags, |
| 1761 feedback_index(slot)); |
1750 break; | 1762 break; |
1751 } | 1763 } |
1752 case ObjectLiteral::Property::GETTER: | 1764 case ObjectLiteral::Property::GETTER: |
1753 case ObjectLiteral::Property::SETTER: { | 1765 case ObjectLiteral::Property::SETTER: { |
1754 RegisterList args = register_allocator()->NewRegisterList(4); | 1766 RegisterList args = register_allocator()->NewRegisterList(4); |
1755 builder()->MoveRegister(literal, args[0]); | 1767 builder()->MoveRegister(literal, args[0]); |
1756 VisitForAccumulatorValue(property->key()); | 1768 VisitForAccumulatorValue(property->key()); |
1757 builder()->ConvertAccumulatorToName(args[1]); | 1769 builder()->ConvertAccumulatorToName(args[1]); |
1758 VisitForRegisterValue(property->value(), args[2]); | 1770 VisitForRegisterValue(property->value(), args[2]); |
1759 VisitSetHomeObject(args[2], literal, property); | 1771 VisitSetHomeObject(args[2], literal, property); |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3307 } | 3319 } |
3308 | 3320 |
3309 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3321 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3310 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3322 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3311 : Runtime::kStoreKeyedToSuper_Sloppy; | 3323 : Runtime::kStoreKeyedToSuper_Sloppy; |
3312 } | 3324 } |
3313 | 3325 |
3314 } // namespace interpreter | 3326 } // namespace interpreter |
3315 } // namespace internal | 3327 } // namespace internal |
3316 } // namespace v8 | 3328 } // namespace v8 |
OLD | NEW |