| 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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
| 6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 // expressions. | 751 // expressions. |
| 752 virtual void ReturnControl(HControlInstruction* instr, BailoutId ast_id) = 0; | 752 virtual void ReturnControl(HControlInstruction* instr, BailoutId ast_id) = 0; |
| 753 | 753 |
| 754 // Finishes the current basic block and materialize a boolean for | 754 // Finishes the current basic block and materialize a boolean for |
| 755 // value context, nothing for effect, generate a branch for test context. | 755 // value context, nothing for effect, generate a branch for test context. |
| 756 // Call this function in tail position in the Visit functions for | 756 // Call this function in tail position in the Visit functions for |
| 757 // expressions that use an IfBuilder. | 757 // expressions that use an IfBuilder. |
| 758 virtual void ReturnContinuation(HIfContinuation* continuation, | 758 virtual void ReturnContinuation(HIfContinuation* continuation, |
| 759 BailoutId ast_id) = 0; | 759 BailoutId ast_id) = 0; |
| 760 | 760 |
| 761 void set_for_typeof(bool for_typeof) { for_typeof_ = for_typeof; } | 761 void set_typeof_mode(TypeofMode typeof_mode) { typeof_mode_ = typeof_mode; } |
| 762 bool is_for_typeof() { return for_typeof_; } | 762 TypeofMode typeof_mode() { return typeof_mode_; } |
| 763 | 763 |
| 764 protected: | 764 protected: |
| 765 AstContext(HOptimizedGraphBuilder* owner, Expression::Context kind); | 765 AstContext(HOptimizedGraphBuilder* owner, Expression::Context kind); |
| 766 virtual ~AstContext(); | 766 virtual ~AstContext(); |
| 767 | 767 |
| 768 HOptimizedGraphBuilder* owner() const { return owner_; } | 768 HOptimizedGraphBuilder* owner() const { return owner_; } |
| 769 | 769 |
| 770 inline Zone* zone() const; | 770 inline Zone* zone() const; |
| 771 | 771 |
| 772 // We want to be able to assert, in a context-specific way, that the stack | 772 // We want to be able to assert, in a context-specific way, that the stack |
| 773 // height makes sense when the context is filled. | 773 // height makes sense when the context is filled. |
| 774 #ifdef DEBUG | 774 #ifdef DEBUG |
| 775 int original_length_; | 775 int original_length_; |
| 776 #endif | 776 #endif |
| 777 | 777 |
| 778 private: | 778 private: |
| 779 HOptimizedGraphBuilder* owner_; | 779 HOptimizedGraphBuilder* owner_; |
| 780 Expression::Context kind_; | 780 Expression::Context kind_; |
| 781 AstContext* outer_; | 781 AstContext* outer_; |
| 782 bool for_typeof_; | 782 TypeofMode typeof_mode_; |
| 783 }; | 783 }; |
| 784 | 784 |
| 785 | 785 |
| 786 class EffectContext final : public AstContext { | 786 class EffectContext final : public AstContext { |
| 787 public: | 787 public: |
| 788 explicit EffectContext(HOptimizedGraphBuilder* owner) | 788 explicit EffectContext(HOptimizedGraphBuilder* owner) |
| 789 : AstContext(owner, Expression::kEffect) { | 789 : AstContext(owner, Expression::kEffect) { |
| 790 } | 790 } |
| 791 virtual ~EffectContext(); | 791 virtual ~EffectContext(); |
| 792 | 792 |
| (...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3050 } | 3050 } |
| 3051 | 3051 |
| 3052 private: | 3052 private: |
| 3053 HGraphBuilder* builder_; | 3053 HGraphBuilder* builder_; |
| 3054 }; | 3054 }; |
| 3055 | 3055 |
| 3056 | 3056 |
| 3057 } } // namespace v8::internal | 3057 } } // namespace v8::internal |
| 3058 | 3058 |
| 3059 #endif // V8_HYDROGEN_H_ | 3059 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |