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.h" | 8 #include "src/handles.h" |
9 #include "src/utils.h" | 9 #include "src/utils.h" |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // The type of stack frame that a FrameState node represents. | 77 // The type of stack frame that a FrameState node represents. |
78 enum class FrameStateType { | 78 enum class FrameStateType { |
79 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame. | 79 kJavaScriptFunction, // Represents an unoptimized JavaScriptFrame. |
80 kInterpretedFunction, // Represents an InterpretedFrame. | 80 kInterpretedFunction, // Represents an InterpretedFrame. |
81 kArgumentsAdaptor, // Represents an ArgumentsAdaptorFrame. | 81 kArgumentsAdaptor, // Represents an ArgumentsAdaptorFrame. |
82 kConstructStub // Represents a ConstructStubFrame. | 82 kConstructStub // Represents a ConstructStubFrame. |
83 }; | 83 }; |
84 | 84 |
85 | 85 |
86 enum ContextCallingMode { | |
87 CALL_MAINTAINS_NATIVE_CONTEXT, | |
88 CALL_CHANGES_NATIVE_CONTEXT | |
89 }; | |
90 | |
91 | |
92 class FrameStateFunctionInfo { | 86 class FrameStateFunctionInfo { |
93 public: | 87 public: |
94 FrameStateFunctionInfo(FrameStateType type, int parameter_count, | 88 FrameStateFunctionInfo(FrameStateType type, int parameter_count, |
95 int local_count, | 89 int local_count, |
96 Handle<SharedFunctionInfo> shared_info, | 90 Handle<SharedFunctionInfo> shared_info) |
97 ContextCallingMode context_calling_mode) | |
98 : type_(type), | 91 : type_(type), |
99 parameter_count_(parameter_count), | 92 parameter_count_(parameter_count), |
100 local_count_(local_count), | 93 local_count_(local_count), |
101 shared_info_(shared_info), | 94 shared_info_(shared_info) {} |
102 context_calling_mode_(context_calling_mode) {} | |
103 | 95 |
104 int local_count() const { return local_count_; } | 96 int local_count() const { return local_count_; } |
105 int parameter_count() const { return parameter_count_; } | 97 int parameter_count() const { return parameter_count_; } |
106 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 98 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
107 FrameStateType type() const { return type_; } | 99 FrameStateType type() const { return type_; } |
108 ContextCallingMode context_calling_mode() const { | |
109 return context_calling_mode_; | |
110 } | |
111 | 100 |
112 static bool IsJSFunctionType(FrameStateType type) { | 101 static bool IsJSFunctionType(FrameStateType type) { |
113 return type == FrameStateType::kJavaScriptFunction || | 102 return type == FrameStateType::kJavaScriptFunction || |
114 type == FrameStateType::kInterpretedFunction; | 103 type == FrameStateType::kInterpretedFunction; |
115 } | 104 } |
116 | 105 |
117 private: | 106 private: |
118 FrameStateType const type_; | 107 FrameStateType const type_; |
119 int const parameter_count_; | 108 int const parameter_count_; |
120 int const local_count_; | 109 int const local_count_; |
121 Handle<SharedFunctionInfo> const shared_info_; | 110 Handle<SharedFunctionInfo> const shared_info_; |
122 ContextCallingMode context_calling_mode_; | |
123 }; | 111 }; |
124 | 112 |
125 | 113 |
126 class FrameStateInfo final { | 114 class FrameStateInfo final { |
127 public: | 115 public: |
128 FrameStateInfo(BailoutId bailout_id, OutputFrameStateCombine state_combine, | 116 FrameStateInfo(BailoutId bailout_id, OutputFrameStateCombine state_combine, |
129 const FrameStateFunctionInfo* info) | 117 const FrameStateFunctionInfo* info) |
130 : bailout_id_(bailout_id), | 118 : bailout_id_(bailout_id), |
131 frame_state_combine_(state_combine), | 119 frame_state_combine_(state_combine), |
132 info_(info) {} | 120 info_(info) {} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 static const int kFrameStateContextInput = 3; | 156 static const int kFrameStateContextInput = 3; |
169 static const int kFrameStateFunctionInput = 4; | 157 static const int kFrameStateFunctionInput = 4; |
170 static const int kFrameStateOuterStateInput = 5; | 158 static const int kFrameStateOuterStateInput = 5; |
171 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; | 159 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; |
172 | 160 |
173 } // namespace compiler | 161 } // namespace compiler |
174 } // namespace internal | 162 } // namespace internal |
175 } // namespace v8 | 163 } // namespace v8 |
176 | 164 |
177 #endif // V8_COMPILER_FRAME_STATES_H_ | 165 #endif // V8_COMPILER_FRAME_STATES_H_ |
OLD | NEW |