5 #ifndef V8_COMPILER_FRAME_STATES_H_ 6 #define V8_COMPILER_FRAME_STATES_H_ 8 #include "src/builtins/builtins.h" 9 #include "src/handles.h" 10 #include "src/objects/shared-function-info.h" 11 #include "src/utils.h" 20 class SharedFunctionInfoRef;
26 static const size_t kInvalidIndex = SIZE_MAX;
35 size_t GetOffsetToPokeAt()
const {
36 DCHECK_NE(parameter_, kInvalidIndex);
40 bool IsOutputIgnored()
const {
return parameter_ == kInvalidIndex; }
42 size_t ConsumedOutputCount()
const {
return IsOutputIgnored() ? 0 : 1; }
45 return parameter_ == other.parameter_;
48 return !(*
this == other);
52 friend std::ostream& operator<<(std::ostream&,
58 size_t const parameter_;
63 enum class FrameStateType {
68 kJavaScriptBuiltinContinuation,
70 kJavaScriptBuiltinContinuationWithCatch
81 parameter_count_(parameter_count),
82 local_count_(local_count),
83 shared_info_(shared_info) {}
85 int local_count()
const {
return local_count_; }
86 int parameter_count()
const {
return parameter_count_; }
88 FrameStateType
type()
const {
return type_; }
90 static bool IsJSFunctionType(FrameStateType
type) {
91 return type == FrameStateType::kInterpretedFunction ||
92 type == FrameStateType::kJavaScriptBuiltinContinuation ||
93 type == FrameStateType::kJavaScriptBuiltinContinuationWithCatch;
97 FrameStateType
const type_;
98 int const parameter_count_;
99 int const local_count_;
108 : bailout_id_(bailout_id),
109 frame_state_combine_(state_combine),
112 FrameStateType
type()
const {
113 return info_ ==
nullptr ? FrameStateType::kInterpretedFunction
116 BailoutId bailout_id()
const {
return bailout_id_; }
120 : info_->shared_info();
122 int parameter_count()
const {
123 return info_ ==
nullptr ? 0 : info_->parameter_count();
125 int local_count()
const {
126 return info_ ==
nullptr ? 0 : info_->local_count();
143 static const int kFrameStateParametersInput = 0;
144 static const int kFrameStateLocalsInput = 1;
145 static const int kFrameStateStackInput = 2;
146 static const int kFrameStateContextInput = 3;
147 static const int kFrameStateFunctionInput = 4;
148 static const int kFrameStateOuterStateInput = 5;
149 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1;
151 enum class ContinuationFrameStateMode { EAGER, LAZY, LAZY_WITH_CATCH };
153 Node* CreateStubBuiltinContinuationFrameState(
154 JSGraph* graph, Builtins::Name name,
Node* context,
Node*
const* parameters,
155 int parameter_count,
Node* outer_frame_state,
156 ContinuationFrameStateMode mode);
158 Node* CreateJavaScriptBuiltinContinuationFrameState(
159 JSGraph* graph,
const SharedFunctionInfoRef& shared, Builtins::Name name,
160 Node* target,
Node* context,
Node*
const* stack_parameters,
161 int stack_parameter_count,
Node* outer_frame_state,
162 ContinuationFrameStateMode mode);
168 #endif // V8_COMPILER_FRAME_STATES_H_