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/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast-value-factory.h" | 9 #include "src/ast-value-factory.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 } | 2540 } |
2541 const FeedbackVectorSpec* feedback_vector_spec() const { | 2541 const FeedbackVectorSpec* feedback_vector_spec() const { |
2542 return ast_properties_.get_spec(); | 2542 return ast_properties_.get_spec(); |
2543 } | 2543 } |
2544 bool dont_optimize() { return dont_optimize_reason_ != kNoReason; } | 2544 bool dont_optimize() { return dont_optimize_reason_ != kNoReason; } |
2545 BailoutReason dont_optimize_reason() { return dont_optimize_reason_; } | 2545 BailoutReason dont_optimize_reason() { return dont_optimize_reason_; } |
2546 void set_dont_optimize_reason(BailoutReason reason) { | 2546 void set_dont_optimize_reason(BailoutReason reason) { |
2547 dont_optimize_reason_ = reason; | 2547 dont_optimize_reason_ = reason; |
2548 } | 2548 } |
2549 | 2549 |
| 2550 bool accept_IN() const { return AcceptInHintBit::decode(bitfield_); } |
| 2551 void set_accept_IN(bool value) { |
| 2552 bitfield_ = AcceptInHintBit::update(bitfield_, value); |
| 2553 } |
| 2554 |
2550 protected: | 2555 protected: |
2551 FunctionLiteral(Zone* zone, const AstRawString* name, | 2556 FunctionLiteral(Zone* zone, const AstRawString* name, |
2552 AstValueFactory* ast_value_factory, Scope* scope, | 2557 AstValueFactory* ast_value_factory, Scope* scope, |
2553 ZoneList<Statement*>* body, int materialized_literal_count, | 2558 ZoneList<Statement*>* body, int materialized_literal_count, |
2554 int expected_property_count, int parameter_count, | 2559 int expected_property_count, int parameter_count, |
2555 FunctionType function_type, | 2560 FunctionType function_type, |
2556 ParameterFlag has_duplicate_parameters, | 2561 ParameterFlag has_duplicate_parameters, |
2557 IsFunctionFlag is_function, | 2562 IsFunctionFlag is_function, |
2558 EagerCompileHint eager_compile_hint, FunctionKind kind, | 2563 EagerCompileHint eager_compile_hint, FunctionKind kind, |
2559 int position) | 2564 int position) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 unsigned bitfield_; | 2602 unsigned bitfield_; |
2598 class IsExpression : public BitField<bool, 0, 1> {}; | 2603 class IsExpression : public BitField<bool, 0, 1> {}; |
2599 class IsAnonymous : public BitField<bool, 1, 1> {}; | 2604 class IsAnonymous : public BitField<bool, 1, 1> {}; |
2600 class Pretenure : public BitField<bool, 2, 1> {}; | 2605 class Pretenure : public BitField<bool, 2, 1> {}; |
2601 class HasDuplicateParameters : public BitField<ParameterFlag, 3, 1> {}; | 2606 class HasDuplicateParameters : public BitField<ParameterFlag, 3, 1> {}; |
2602 class IsFunction : public BitField<IsFunctionFlag, 4, 1> {}; | 2607 class IsFunction : public BitField<IsFunctionFlag, 4, 1> {}; |
2603 class EagerCompileHintBit : public BitField<EagerCompileHint, 5, 1> {}; | 2608 class EagerCompileHintBit : public BitField<EagerCompileHint, 5, 1> {}; |
2604 class FunctionKindBits : public BitField<FunctionKind, 6, 8> {}; | 2609 class FunctionKindBits : public BitField<FunctionKind, 6, 8> {}; |
2605 class ShouldBeUsedOnceHintBit : public BitField<ShouldBeUsedOnceHint, 15, 1> { | 2610 class ShouldBeUsedOnceHintBit : public BitField<ShouldBeUsedOnceHint, 15, 1> { |
2606 }; | 2611 }; |
| 2612 // Used for lazily compiled arrow functions |
| 2613 class AcceptInHintBit : public BitField<bool, 16, 1> {}; |
2607 }; | 2614 }; |
2608 | 2615 |
2609 | 2616 |
2610 class ClassLiteral final : public Expression { | 2617 class ClassLiteral final : public Expression { |
2611 public: | 2618 public: |
2612 typedef ObjectLiteralProperty Property; | 2619 typedef ObjectLiteralProperty Property; |
2613 | 2620 |
2614 DECLARE_NODE_TYPE(ClassLiteral) | 2621 DECLARE_NODE_TYPE(ClassLiteral) |
2615 | 2622 |
2616 Handle<String> name() const { return raw_name_->string(); } | 2623 Handle<String> name() const { return raw_name_->string(); } |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3615 // the parser-level zone. | 3622 // the parser-level zone. |
3616 Zone* parser_zone_; | 3623 Zone* parser_zone_; |
3617 AstValueFactory* ast_value_factory_; | 3624 AstValueFactory* ast_value_factory_; |
3618 }; | 3625 }; |
3619 | 3626 |
3620 | 3627 |
3621 } // namespace internal | 3628 } // namespace internal |
3622 } // namespace v8 | 3629 } // namespace v8 |
3623 | 3630 |
3624 #endif // V8_AST_H_ | 3631 #endif // V8_AST_H_ |
OLD | NEW |