OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 | 1526 |
1527 struct Accessors: public ZoneObject { | 1527 struct Accessors: public ZoneObject { |
1528 Accessors() : getter(NULL), setter(NULL) {} | 1528 Accessors() : getter(NULL), setter(NULL) {} |
1529 ObjectLiteralProperty* getter; | 1529 ObjectLiteralProperty* getter; |
1530 ObjectLiteralProperty* setter; | 1530 ObjectLiteralProperty* setter; |
1531 }; | 1531 }; |
1532 | 1532 |
1533 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } | 1533 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } |
1534 | 1534 |
1535 // Return an AST id for a property that is used in simulate instructions. | 1535 // Return an AST id for a property that is used in simulate instructions. |
1536 BailoutId GetIdForProperty(int i) { return BailoutId(local_id(i + 1)); } | 1536 BailoutId GetIdForPropertyName(int i) { |
| 1537 return BailoutId(local_id(2 * i + 1)); |
| 1538 } |
| 1539 BailoutId GetIdForPropertySet(int i) { |
| 1540 return BailoutId(local_id(2 * i + 2)); |
| 1541 } |
1537 | 1542 |
1538 // Unlike other AST nodes, this number of bailout IDs allocated for an | 1543 // Unlike other AST nodes, this number of bailout IDs allocated for an |
1539 // ObjectLiteral can vary, so num_ids() is not a static method. | 1544 // ObjectLiteral can vary, so num_ids() is not a static method. |
1540 int num_ids() const { return parent_num_ids() + 1 + properties()->length(); } | 1545 int num_ids() const { |
| 1546 return parent_num_ids() + 1 + 2 * properties()->length(); |
| 1547 } |
1541 | 1548 |
1542 // Object literals need one feedback slot for each non-trivial value, as well | 1549 // Object literals need one feedback slot for each non-trivial value, as well |
1543 // as some slots for home objects. | 1550 // as some slots for home objects. |
1544 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, | 1551 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, |
1545 FeedbackVectorSlotCache* cache) override; | 1552 FeedbackVectorSlotCache* cache) override; |
1546 | 1553 |
1547 protected: | 1554 protected: |
1548 ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, | 1555 ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index, |
1549 int boilerplate_properties, bool has_function, bool is_strong, | 1556 int boilerplate_properties, bool has_function, bool is_strong, |
1550 int pos) | 1557 int pos) |
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3762 // the parser-level zone. | 3769 // the parser-level zone. |
3763 Zone* parser_zone_; | 3770 Zone* parser_zone_; |
3764 AstValueFactory* ast_value_factory_; | 3771 AstValueFactory* ast_value_factory_; |
3765 }; | 3772 }; |
3766 | 3773 |
3767 | 3774 |
3768 } // namespace internal | 3775 } // namespace internal |
3769 } // namespace v8 | 3776 } // namespace v8 |
3770 | 3777 |
3771 #endif // V8_AST_AST_H_ | 3778 #endif // V8_AST_AST_H_ |
OLD | NEW |