OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_COMPILER_FRAME_STATES_H_ | 5 #ifndef V8_COMPILER_FRAME_STATES_H_ |
6 #define V8_COMPILER_FRAME_STATES_H_ | 6 #define V8_COMPILER_FRAME_STATES_H_ |
7 | 7 |
8 #include "src/handles-inl.h" | 8 #include "src/handles-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 }; | 69 }; |
70 | 70 |
71 | 71 |
72 // The type of stack frame that a FrameState node represents. | 72 // The type of stack frame that a FrameState node represents. |
73 enum class FrameStateType { | 73 enum class FrameStateType { |
74 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame. | 74 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame. |
75 kArgumentsAdaptor // Represents an ArgumentsAdaptorFrame. | 75 kArgumentsAdaptor // Represents an ArgumentsAdaptorFrame. |
76 }; | 76 }; |
77 | 77 |
78 | 78 |
| 79 enum ContextCallingMode { |
| 80 CALL_MAINTAINS_NATIVE_CONTEXT, |
| 81 CALL_CHANGES_NATIVE_CONTEXT |
| 82 }; |
| 83 |
| 84 |
79 class FrameStateFunctionInfo { | 85 class FrameStateFunctionInfo { |
80 public: | 86 public: |
81 FrameStateFunctionInfo(FrameStateType type, int parameter_count, | 87 FrameStateFunctionInfo(FrameStateType type, int parameter_count, |
82 int local_count, | 88 int local_count, |
83 Handle<SharedFunctionInfo> shared_info) | 89 Handle<SharedFunctionInfo> shared_info, |
| 90 ContextCallingMode context_calling_mode) |
84 : type_(type), | 91 : type_(type), |
85 parameter_count_(parameter_count), | 92 parameter_count_(parameter_count), |
86 local_count_(local_count), | 93 local_count_(local_count), |
87 shared_info_(shared_info) {} | 94 shared_info_(shared_info), |
| 95 context_calling_mode_(context_calling_mode) {} |
88 | 96 |
89 int local_count() const { return local_count_; } | 97 int local_count() const { return local_count_; } |
90 int parameter_count() const { return parameter_count_; } | 98 int parameter_count() const { return parameter_count_; } |
91 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 99 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
92 FrameStateType type() const { return type_; } | 100 FrameStateType type() const { return type_; } |
| 101 ContextCallingMode context_calling_mode() const { |
| 102 return context_calling_mode_; |
| 103 } |
93 | 104 |
94 private: | 105 private: |
95 FrameStateType const type_; | 106 FrameStateType const type_; |
96 int const parameter_count_; | 107 int const parameter_count_; |
97 int const local_count_; | 108 int const local_count_; |
98 Handle<SharedFunctionInfo> const shared_info_; | 109 Handle<SharedFunctionInfo> const shared_info_; |
| 110 ContextCallingMode context_calling_mode_; |
99 }; | 111 }; |
100 | 112 |
101 | 113 |
102 class FrameStateInfo final { | 114 class FrameStateInfo final { |
103 public: | 115 public: |
104 FrameStateInfo(BailoutId bailout_id, OutputFrameStateCombine state_combine, | 116 FrameStateInfo(BailoutId bailout_id, OutputFrameStateCombine state_combine, |
105 const FrameStateFunctionInfo* info) | 117 const FrameStateFunctionInfo* info) |
106 : bailout_id_(bailout_id), | 118 : bailout_id_(bailout_id), |
107 frame_state_combine_(state_combine), | 119 frame_state_combine_(state_combine), |
108 info_(info) {} | 120 info_(info) {} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 static const int kFrameStateContextInput = 3; | 156 static const int kFrameStateContextInput = 3; |
145 static const int kFrameStateFunctionInput = 4; | 157 static const int kFrameStateFunctionInput = 4; |
146 static const int kFrameStateOuterStateInput = 5; | 158 static const int kFrameStateOuterStateInput = 5; |
147 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; | 159 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; |
148 | 160 |
149 } // namespace compiler | 161 } // namespace compiler |
150 } // namespace internal | 162 } // namespace internal |
151 } // namespace v8 | 163 } // namespace v8 |
152 | 164 |
153 #endif // V8_COMPILER_FRAME_STATES_H_ | 165 #endif // V8_COMPILER_FRAME_STATES_H_ |
OLD | NEW |