| 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_CRANKSHAFT_HYDROGEN_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ |
| 6 #define V8_CRANKSHAFT_HYDROGEN_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_H_ |
| 7 | 7 |
| 8 #include "src/accessors.h" | 8 #include "src/accessors.h" |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 | 877 |
| 878 HArgumentsElements* arguments_elements() { return arguments_elements_; } | 878 HArgumentsElements* arguments_elements() { return arguments_elements_; } |
| 879 void set_arguments_elements(HArgumentsElements* arguments_elements) { | 879 void set_arguments_elements(HArgumentsElements* arguments_elements) { |
| 880 arguments_elements_ = arguments_elements; | 880 arguments_elements_ = arguments_elements; |
| 881 } | 881 } |
| 882 | 882 |
| 883 bool arguments_pushed() { return arguments_elements() != NULL; } | 883 bool arguments_pushed() { return arguments_elements() != NULL; } |
| 884 | 884 |
| 885 int inlining_id() const { return inlining_id_; } | 885 int inlining_id() const { return inlining_id_; } |
| 886 | 886 |
| 887 void IncrementInDoExpressionScope() { do_expression_scope_count_++; } |
| 888 void DecrementInDoExpressionScope() { do_expression_scope_count_--; } |
| 889 bool IsInsideDoExpressionScope() { return do_expression_scope_count_ > 0; } |
| 890 |
| 887 private: | 891 private: |
| 888 HOptimizedGraphBuilder* owner_; | 892 HOptimizedGraphBuilder* owner_; |
| 889 | 893 |
| 890 CompilationInfo* compilation_info_; | 894 CompilationInfo* compilation_info_; |
| 891 | 895 |
| 892 // During function inlining, expression context of the call being | 896 // During function inlining, expression context of the call being |
| 893 // inlined. NULL when not inlining. | 897 // inlined. NULL when not inlining. |
| 894 AstContext* call_context_; | 898 AstContext* call_context_; |
| 895 | 899 |
| 896 // The kind of call which is currently being inlined. | 900 // The kind of call which is currently being inlined. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 909 // When inlining HEnterInlined instruction corresponding to the function | 913 // When inlining HEnterInlined instruction corresponding to the function |
| 910 // entry. | 914 // entry. |
| 911 HEnterInlined* entry_; | 915 HEnterInlined* entry_; |
| 912 | 916 |
| 913 HArgumentsObject* arguments_object_; | 917 HArgumentsObject* arguments_object_; |
| 914 HArgumentsElements* arguments_elements_; | 918 HArgumentsElements* arguments_elements_; |
| 915 | 919 |
| 916 int inlining_id_; | 920 int inlining_id_; |
| 917 SourcePosition outer_source_position_; | 921 SourcePosition outer_source_position_; |
| 918 | 922 |
| 923 int do_expression_scope_count_; |
| 924 |
| 919 FunctionState* outer_; | 925 FunctionState* outer_; |
| 920 }; | 926 }; |
| 921 | 927 |
| 922 | 928 |
| 923 class HIfContinuation final { | 929 class HIfContinuation final { |
| 924 public: | 930 public: |
| 925 HIfContinuation() | 931 HIfContinuation() |
| 926 : continuation_captured_(false), | 932 : continuation_captured_(false), |
| 927 true_branch_(NULL), | 933 true_branch_(NULL), |
| 928 false_branch_(NULL) {} | 934 false_branch_(NULL) {} |
| (...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3018 builder_->graph()->IncrementInNoSideEffectsScope(); | 3024 builder_->graph()->IncrementInNoSideEffectsScope(); |
| 3019 } | 3025 } |
| 3020 ~NoObservableSideEffectsScope() { | 3026 ~NoObservableSideEffectsScope() { |
| 3021 builder_->graph()->DecrementInNoSideEffectsScope(); | 3027 builder_->graph()->DecrementInNoSideEffectsScope(); |
| 3022 } | 3028 } |
| 3023 | 3029 |
| 3024 private: | 3030 private: |
| 3025 HGraphBuilder* builder_; | 3031 HGraphBuilder* builder_; |
| 3026 }; | 3032 }; |
| 3027 | 3033 |
| 3034 class DoExpressionScope final { |
| 3035 public: |
| 3036 explicit DoExpressionScope(HOptimizedGraphBuilder* builder) |
| 3037 : builder_(builder) { |
| 3038 builder_->function_state()->IncrementInDoExpressionScope(); |
| 3039 } |
| 3040 ~DoExpressionScope() { |
| 3041 builder_->function_state()->DecrementInDoExpressionScope(); |
| 3042 } |
| 3043 |
| 3044 private: |
| 3045 HOptimizedGraphBuilder* builder_; |
| 3046 }; |
| 3028 | 3047 |
| 3029 } // namespace internal | 3048 } // namespace internal |
| 3030 } // namespace v8 | 3049 } // namespace v8 |
| 3031 | 3050 |
| 3032 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 3051 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
| OLD | NEW |