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/ast/ast-types.h" | 8 #include "src/ast/ast-types.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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 static bool IsBoilerplateProperty(Property* property); | 1409 static bool IsBoilerplateProperty(Property* property); |
1410 | 1410 |
1411 // Populate the constant properties fixed array. | 1411 // Populate the constant properties fixed array. |
1412 void BuildConstantProperties(Isolate* isolate); | 1412 void BuildConstantProperties(Isolate* isolate); |
1413 | 1413 |
1414 // Mark all computed expressions that are bound to a key that | 1414 // Mark all computed expressions that are bound to a key that |
1415 // is shadowed by a later occurrence of the same key. For the | 1415 // is shadowed by a later occurrence of the same key. For the |
1416 // marked expressions, no store code is emitted. | 1416 // marked expressions, no store code is emitted. |
1417 void CalculateEmitStore(Zone* zone); | 1417 void CalculateEmitStore(Zone* zone); |
1418 | 1418 |
1419 // Determines whether the {FastCloneShallowObjectStub} can be used. | 1419 // Determines whether the {FastCloneShallowObject} builtin can be used. |
1420 bool IsFastCloningSupported() const; | 1420 bool IsFastCloningSupported() const; |
1421 | 1421 |
1422 // Assemble bitfield of flags for the CreateObjectLiteral helper. | 1422 // Assemble bitfield of flags for the CreateObjectLiteral helper. |
1423 int ComputeFlags(bool disable_mementos = false) const { | 1423 int ComputeFlags(bool disable_mementos = false) const { |
1424 int flags = fast_elements() ? kFastElements : kNoFlags; | 1424 int flags = fast_elements() ? kFastElements : kNoFlags; |
1425 if (has_shallow_properties()) { | 1425 if (has_shallow_properties()) { |
1426 flags |= kShallowProperties; | 1426 flags |= kShallowProperties; |
1427 } | 1427 } |
1428 if (disable_mementos) { | 1428 if (disable_mementos) { |
1429 flags |= kDisableMementos; | 1429 flags |= kDisableMementos; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 // Return an AST id for an element that is used in simulate instructions. | 1555 // Return an AST id for an element that is used in simulate instructions. |
1556 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } | 1556 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } |
1557 | 1557 |
1558 // Unlike other AST nodes, this number of bailout IDs allocated for an | 1558 // Unlike other AST nodes, this number of bailout IDs allocated for an |
1559 // ArrayLiteral can vary, so num_ids() is not a static method. | 1559 // ArrayLiteral can vary, so num_ids() is not a static method. |
1560 int num_ids() const { return parent_num_ids() + 1 + values()->length(); } | 1560 int num_ids() const { return parent_num_ids() + 1 + values()->length(); } |
1561 | 1561 |
1562 // Populate the constant elements fixed array. | 1562 // Populate the constant elements fixed array. |
1563 void BuildConstantElements(Isolate* isolate); | 1563 void BuildConstantElements(Isolate* isolate); |
1564 | 1564 |
1565 // Determines whether the {FastCloneShallowArrayStub} can be used. | 1565 // Determines whether the {FastCloneShallowArray} builtin can be used. |
1566 bool IsFastCloningSupported() const; | 1566 bool IsFastCloningSupported() const; |
1567 | 1567 |
1568 // Assemble bitfield of flags for the CreateArrayLiteral helper. | 1568 // Assemble bitfield of flags for the CreateArrayLiteral helper. |
1569 int ComputeFlags(bool disable_mementos = false) const { | 1569 int ComputeFlags(bool disable_mementos = false) const { |
1570 int flags = depth() == 1 ? kShallowElements : kNoFlags; | 1570 int flags = depth() == 1 ? kShallowElements : kNoFlags; |
1571 if (disable_mementos) { | 1571 if (disable_mementos) { |
1572 flags |= kDisableMementos; | 1572 flags |= kDisableMementos; |
1573 } | 1573 } |
1574 return flags; | 1574 return flags; |
1575 } | 1575 } |
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3603 : NULL; \ | 3603 : NULL; \ |
3604 } | 3604 } |
3605 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3605 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
3606 #undef DECLARE_NODE_FUNCTIONS | 3606 #undef DECLARE_NODE_FUNCTIONS |
3607 | 3607 |
3608 | 3608 |
3609 } // namespace internal | 3609 } // namespace internal |
3610 } // namespace v8 | 3610 } // namespace v8 |
3611 | 3611 |
3612 #endif // V8_AST_AST_H_ | 3612 #endif // V8_AST_AST_H_ |
OLD | NEW |