Chromium Code Reviews| 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" |
| 11 #include "src/ast/variables.h" | 11 #include "src/ast/variables.h" |
| 12 #include "src/bailout-reason.h" | 12 #include "src/bailout-reason.h" |
| 13 #include "src/base/flags.h" | 13 #include "src/base/flags.h" |
| 14 #include "src/factory.h" | 14 #include "src/factory.h" |
| 15 #include "src/globals.h" | 15 #include "src/globals.h" |
| 16 #include "src/isolate.h" | 16 #include "src/isolate.h" |
| 17 #include "src/label.h" | 17 #include "src/label.h" |
| 18 #include "src/list.h" | 18 #include "src/list.h" |
| 19 #include "src/objects/literal-objects.h" | |
| 19 #include "src/parsing/token.h" | 20 #include "src/parsing/token.h" |
| 20 #include "src/runtime/runtime.h" | 21 #include "src/runtime/runtime.h" |
| 21 #include "src/small-pointer-list.h" | 22 #include "src/small-pointer-list.h" |
| 22 | 23 |
| 23 namespace v8 { | 24 namespace v8 { |
| 24 namespace internal { | 25 namespace internal { |
| 25 | 26 |
| 26 // The abstract syntax tree is an intermediate, light-weight | 27 // The abstract syntax tree is an intermediate, light-weight |
| 27 // representation of the parsed JavaScript code suitable for | 28 // representation of the parsed JavaScript code suitable for |
| 28 // compilation to native code. | 29 // compilation to native code. |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1547 }; | 1548 }; |
| 1548 | 1549 |
| 1549 | 1550 |
| 1550 // An array literal has a literals object that is used | 1551 // An array literal has a literals object that is used |
| 1551 // for minimizing the work when constructing it at runtime. | 1552 // for minimizing the work when constructing it at runtime. |
| 1552 class ArrayLiteral final : public MaterializedLiteral { | 1553 class ArrayLiteral final : public MaterializedLiteral { |
| 1553 public: | 1554 public: |
| 1554 Handle<ConstantElementsPair> constant_elements() const { | 1555 Handle<ConstantElementsPair> constant_elements() const { |
| 1555 return constant_elements_; | 1556 return constant_elements_; |
| 1556 } | 1557 } |
| 1557 ElementsKind constant_elements_kind() const { | 1558 ElementsKind constant_elements_kind() const { |
|
Michael Starzinger
2017/01/27 14:52:28
suggestion: As discussed offline, it looks like th
marja
2017/01/27 14:57:06
Done.
| |
| 1558 return static_cast<ElementsKind>(constant_elements()->elements_kind()); | 1559 return static_cast<ElementsKind>(constant_elements()->elements_kind()); |
| 1559 } | 1560 } |
| 1560 | 1561 |
| 1561 ZoneList<Expression*>* values() const { return values_; } | 1562 ZoneList<Expression*>* values() const { return values_; } |
| 1562 | 1563 |
| 1563 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } | 1564 BailoutId CreateLiteralId() const { return BailoutId(local_id(0)); } |
| 1564 | 1565 |
| 1565 // Return an AST id for an element that is used in simulate instructions. | 1566 // Return an AST id for an element that is used in simulate instructions. |
| 1566 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } | 1567 BailoutId GetIdForElement(int i) { return BailoutId(local_id(i + 1)); } |
| 1567 | 1568 |
| (...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3647 : NULL; \ | 3648 : NULL; \ |
| 3648 } | 3649 } |
| 3649 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3650 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3650 #undef DECLARE_NODE_FUNCTIONS | 3651 #undef DECLARE_NODE_FUNCTIONS |
| 3651 | 3652 |
| 3652 | 3653 |
| 3653 } // namespace internal | 3654 } // namespace internal |
| 3654 } // namespace v8 | 3655 } // namespace v8 |
| 3655 | 3656 |
| 3656 #endif // V8_AST_AST_H_ | 3657 #endif // V8_AST_AST_H_ |
| OLD | NEW |