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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2541 // - (function() { ... })(); | 2541 // - (function() { ... })(); |
2542 // - var x = function() { ... }(); | 2542 // - var x = function() { ... }(); |
2543 bool is_parenthesized() { | 2543 bool is_parenthesized() { |
2544 return IsParenthesized::decode(bitfield_) == kIsParenthesized; | 2544 return IsParenthesized::decode(bitfield_) == kIsParenthesized; |
2545 } | 2545 } |
2546 void set_parenthesized() { | 2546 void set_parenthesized() { |
2547 bitfield_ = IsParenthesized::update(bitfield_, kIsParenthesized); | 2547 bitfield_ = IsParenthesized::update(bitfield_, kIsParenthesized); |
2548 } | 2548 } |
2549 | 2549 |
2550 FunctionKind kind() { return FunctionKindBits::decode(bitfield_); } | 2550 FunctionKind kind() { return FunctionKindBits::decode(bitfield_); } |
2551 bool is_arrow() { | |
2552 return IsArrowFunction(FunctionKindBits::decode(bitfield_)); | |
2553 } | |
2554 bool is_generator() { | |
2555 return IsGeneratorFunction(FunctionKindBits::decode(bitfield_)); | |
2556 } | |
2557 bool is_concise_method() { | |
2558 return IsConciseMethod(FunctionKindBits::decode(bitfield_)); | |
2559 } | |
2560 bool is_default_constructor() { | |
2561 return IsDefaultConstructor(FunctionKindBits::decode(bitfield_)); | |
2562 } | |
2563 | 2551 |
2564 int ast_node_count() { return ast_properties_.node_count(); } | 2552 int ast_node_count() { return ast_properties_.node_count(); } |
2565 AstProperties::Flags* flags() { return ast_properties_.flags(); } | 2553 AstProperties::Flags* flags() { return ast_properties_.flags(); } |
2566 void set_ast_properties(AstProperties* ast_properties) { | 2554 void set_ast_properties(AstProperties* ast_properties) { |
2567 ast_properties_ = *ast_properties; | 2555 ast_properties_ = *ast_properties; |
2568 } | 2556 } |
2569 const FeedbackVectorSpec& feedback_vector_spec() const { | 2557 const FeedbackVectorSpec& feedback_vector_spec() const { |
2570 return ast_properties_.get_spec(); | 2558 return ast_properties_.get_spec(); |
2571 } | 2559 } |
2572 bool dont_optimize() { return dont_optimize_reason_ != kNoReason; } | 2560 bool dont_optimize() { return dont_optimize_reason_ != kNoReason; } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 int parameter_count_; | 2611 int parameter_count_; |
2624 int function_token_position_; | 2612 int function_token_position_; |
2625 | 2613 |
2626 unsigned bitfield_; | 2614 unsigned bitfield_; |
2627 class IsExpression : public BitField<bool, 0, 1> {}; | 2615 class IsExpression : public BitField<bool, 0, 1> {}; |
2628 class IsAnonymous : public BitField<bool, 1, 1> {}; | 2616 class IsAnonymous : public BitField<bool, 1, 1> {}; |
2629 class Pretenure : public BitField<bool, 2, 1> {}; | 2617 class Pretenure : public BitField<bool, 2, 1> {}; |
2630 class HasDuplicateParameters : public BitField<ParameterFlag, 3, 1> {}; | 2618 class HasDuplicateParameters : public BitField<ParameterFlag, 3, 1> {}; |
2631 class IsFunction : public BitField<IsFunctionFlag, 4, 1> {}; | 2619 class IsFunction : public BitField<IsFunctionFlag, 4, 1> {}; |
2632 class IsParenthesized : public BitField<IsParenthesizedFlag, 5, 1> {}; | 2620 class IsParenthesized : public BitField<IsParenthesizedFlag, 5, 1> {}; |
2633 class FunctionKindBits : public BitField<FunctionKind, 6, 5> {}; | 2621 class FunctionKindBits : public BitField<FunctionKind, 6, 6> {}; |
2634 }; | 2622 }; |
2635 | 2623 |
2636 | 2624 |
2637 class ClassLiteral FINAL : public Expression { | 2625 class ClassLiteral FINAL : public Expression { |
2638 public: | 2626 public: |
2639 typedef ObjectLiteralProperty Property; | 2627 typedef ObjectLiteralProperty Property; |
2640 | 2628 |
2641 DECLARE_NODE_TYPE(ClassLiteral) | 2629 DECLARE_NODE_TYPE(ClassLiteral) |
2642 | 2630 |
2643 Handle<String> name() const { return raw_name_->string(); } | 2631 Handle<String> name() const { return raw_name_->string(); } |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3552 | 3540 |
3553 private: | 3541 private: |
3554 Zone* zone_; | 3542 Zone* zone_; |
3555 AstValueFactory* ast_value_factory_; | 3543 AstValueFactory* ast_value_factory_; |
3556 }; | 3544 }; |
3557 | 3545 |
3558 | 3546 |
3559 } } // namespace v8::internal | 3547 } } // namespace v8::internal |
3560 | 3548 |
3561 #endif // V8_AST_H_ | 3549 #endif // V8_AST_H_ |
OLD | NEW |