| 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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 static bool IsBoilerplateProperty(Property* property); | 1408 static bool IsBoilerplateProperty(Property* property); |
| 1409 | 1409 |
| 1410 // Populate the constant properties fixed array. | 1410 // Populate the constant properties fixed array. |
| 1411 void BuildConstantProperties(Isolate* isolate); | 1411 void BuildConstantProperties(Isolate* isolate); |
| 1412 | 1412 |
| 1413 // Mark all computed expressions that are bound to a key that | 1413 // Mark all computed expressions that are bound to a key that |
| 1414 // is shadowed by a later occurrence of the same key. For the | 1414 // is shadowed by a later occurrence of the same key. For the |
| 1415 // marked expressions, no store code is emitted. | 1415 // marked expressions, no store code is emitted. |
| 1416 void CalculateEmitStore(Zone* zone); | 1416 void CalculateEmitStore(Zone* zone); |
| 1417 | 1417 |
| 1418 // Determines whether the {FastCloneShallowObjectStub} can be used. |
| 1419 bool IsFastCloningSupported() const; |
| 1420 |
| 1418 // Assemble bitfield of flags for the CreateObjectLiteral helper. | 1421 // Assemble bitfield of flags for the CreateObjectLiteral helper. |
| 1419 int ComputeFlags(bool disable_mementos = false) const { | 1422 int ComputeFlags(bool disable_mementos = false) const { |
| 1420 int flags = fast_elements() ? kFastElements : kNoFlags; | 1423 int flags = fast_elements() ? kFastElements : kNoFlags; |
| 1421 if (has_shallow_properties()) { | 1424 if (has_shallow_properties()) { |
| 1422 flags |= kShallowProperties; | 1425 flags |= kShallowProperties; |
| 1423 } | 1426 } |
| 1424 if (disable_mementos) { | 1427 if (disable_mementos) { |
| 1425 flags |= kDisableMementos; | 1428 flags |= kDisableMementos; |
| 1426 } | 1429 } |
| 1427 return flags; | 1430 return flags; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 // Return an AST id for an element that is used in simulate instructions. | 1554 // Return an AST id for an element that is used in simulate instructions. |
| 1552 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } | 1555 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } |
| 1553 | 1556 |
| 1554 // Unlike other AST nodes, this number of bailout IDs allocated for an | 1557 // Unlike other AST nodes, this number of bailout IDs allocated for an |
| 1555 // ArrayLiteral can vary, so num_ids() is not a static method. | 1558 // ArrayLiteral can vary, so num_ids() is not a static method. |
| 1556 int num_ids() const { return parent_num_ids() + 1 + values()->length(); } | 1559 int num_ids() const { return parent_num_ids() + 1 + values()->length(); } |
| 1557 | 1560 |
| 1558 // Populate the constant elements fixed array. | 1561 // Populate the constant elements fixed array. |
| 1559 void BuildConstantElements(Isolate* isolate); | 1562 void BuildConstantElements(Isolate* isolate); |
| 1560 | 1563 |
| 1564 // Determines whether the {FastCloneShallowArrayStub} can be used. |
| 1565 bool IsFastCloningSupported() const; |
| 1566 |
| 1561 // Assemble bitfield of flags for the CreateArrayLiteral helper. | 1567 // Assemble bitfield of flags for the CreateArrayLiteral helper. |
| 1562 int ComputeFlags(bool disable_mementos = false) const { | 1568 int ComputeFlags(bool disable_mementos = false) const { |
| 1563 int flags = depth() == 1 ? kShallowElements : kNoFlags; | 1569 int flags = depth() == 1 ? kShallowElements : kNoFlags; |
| 1564 if (disable_mementos) { | 1570 if (disable_mementos) { |
| 1565 flags |= kDisableMementos; | 1571 flags |= kDisableMementos; |
| 1566 } | 1572 } |
| 1567 return flags; | 1573 return flags; |
| 1568 } | 1574 } |
| 1569 | 1575 |
| 1570 // Provide a mechanism for iterating through values to rewrite spreads. | 1576 // Provide a mechanism for iterating through values to rewrite spreads. |
| (...skipping 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3634 : NULL; \ | 3640 : NULL; \ |
| 3635 } | 3641 } |
| 3636 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3642 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3637 #undef DECLARE_NODE_FUNCTIONS | 3643 #undef DECLARE_NODE_FUNCTIONS |
| 3638 | 3644 |
| 3639 | 3645 |
| 3640 } // namespace internal | 3646 } // namespace internal |
| 3641 } // namespace v8 | 3647 } // namespace v8 |
| 3642 | 3648 |
| 3643 #endif // V8_AST_AST_H_ | 3649 #endif // V8_AST_AST_H_ |
| OLD | NEW |