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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 OutputFrameStateCombine(Kind kind, size_t parameter) | 69 OutputFrameStateCombine(Kind kind, size_t parameter) |
70 : kind_(kind), parameter_(parameter) {} | 70 : kind_(kind), parameter_(parameter) {} |
71 | 71 |
72 Kind const kind_; | 72 Kind const kind_; |
73 size_t const parameter_; | 73 size_t const parameter_; |
74 }; | 74 }; |
75 | 75 |
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 kArgumentsAdaptor, // Represents an ArgumentsAdaptorFrame. | 80 kInterpretedFunction, // Represents an InterpretedFrame. |
81 kConstructStub // Represents a ConstructStubFrame. | 81 kArgumentsAdaptor, // Represents an ArgumentsAdaptorFrame. |
| 82 kConstructStub // Represents a ConstructStubFrame. |
82 }; | 83 }; |
83 | 84 |
84 | 85 |
85 enum ContextCallingMode { | 86 enum ContextCallingMode { |
86 CALL_MAINTAINS_NATIVE_CONTEXT, | 87 CALL_MAINTAINS_NATIVE_CONTEXT, |
87 CALL_CHANGES_NATIVE_CONTEXT | 88 CALL_CHANGES_NATIVE_CONTEXT |
88 }; | 89 }; |
89 | 90 |
90 | 91 |
91 class FrameStateFunctionInfo { | 92 class FrameStateFunctionInfo { |
92 public: | 93 public: |
93 FrameStateFunctionInfo(FrameStateType type, int parameter_count, | 94 FrameStateFunctionInfo(FrameStateType type, int parameter_count, |
94 int local_count, | 95 int local_count, |
95 Handle<SharedFunctionInfo> shared_info, | 96 Handle<SharedFunctionInfo> shared_info, |
96 ContextCallingMode context_calling_mode) | 97 ContextCallingMode context_calling_mode) |
97 : type_(type), | 98 : type_(type), |
98 parameter_count_(parameter_count), | 99 parameter_count_(parameter_count), |
99 local_count_(local_count), | 100 local_count_(local_count), |
100 shared_info_(shared_info), | 101 shared_info_(shared_info), |
101 context_calling_mode_(context_calling_mode) {} | 102 context_calling_mode_(context_calling_mode) {} |
102 | 103 |
103 int local_count() const { return local_count_; } | 104 int local_count() const { return local_count_; } |
104 int parameter_count() const { return parameter_count_; } | 105 int parameter_count() const { return parameter_count_; } |
105 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 106 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
106 FrameStateType type() const { return type_; } | 107 FrameStateType type() const { return type_; } |
107 ContextCallingMode context_calling_mode() const { | 108 ContextCallingMode context_calling_mode() const { |
108 return context_calling_mode_; | 109 return context_calling_mode_; |
109 } | 110 } |
110 | 111 |
| 112 static bool IsJSFunctionType(FrameStateType type) { |
| 113 return type == FrameStateType::kJavaScriptFunction || |
| 114 type == FrameStateType::kInterpretedFunction; |
| 115 } |
| 116 |
111 private: | 117 private: |
112 FrameStateType const type_; | 118 FrameStateType const type_; |
113 int const parameter_count_; | 119 int const parameter_count_; |
114 int const local_count_; | 120 int const local_count_; |
115 Handle<SharedFunctionInfo> const shared_info_; | 121 Handle<SharedFunctionInfo> const shared_info_; |
116 ContextCallingMode context_calling_mode_; | 122 ContextCallingMode context_calling_mode_; |
117 }; | 123 }; |
118 | 124 |
119 | 125 |
120 class FrameStateInfo final { | 126 class FrameStateInfo final { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 static const int kFrameStateContextInput = 3; | 168 static const int kFrameStateContextInput = 3; |
163 static const int kFrameStateFunctionInput = 4; | 169 static const int kFrameStateFunctionInput = 4; |
164 static const int kFrameStateOuterStateInput = 5; | 170 static const int kFrameStateOuterStateInput = 5; |
165 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; | 171 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; |
166 | 172 |
167 } // namespace compiler | 173 } // namespace compiler |
168 } // namespace internal | 174 } // namespace internal |
169 } // namespace v8 | 175 } // namespace v8 |
170 | 176 |
171 #endif // V8_COMPILER_FRAME_STATES_H_ | 177 #endif // V8_COMPILER_FRAME_STATES_H_ |
OLD | NEW |