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/utils.h" | 8 #include "src/handles-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 // Flag that describes how to combine the current environment with | 14 // Flag that describes how to combine the current environment with |
15 // the output of a node to obtain a framestate for lazy bailout. | 15 // the output of a node to obtain a framestate for lazy bailout. |
16 class OutputFrameStateCombine { | 16 class OutputFrameStateCombine { |
17 public: | 17 public: |
18 enum Kind { | 18 enum Kind { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // The type of stack frame that a FrameState node represents. | 72 // The type of stack frame that a FrameState node represents. |
73 enum FrameStateType { | 73 enum FrameStateType { |
74 JS_FRAME, // Represents an unoptimized JavaScriptFrame. | 74 JS_FRAME, // Represents an unoptimized JavaScriptFrame. |
75 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. | 75 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. |
76 }; | 76 }; |
77 | 77 |
78 | 78 |
79 class FrameStateCallInfo final { | 79 class FrameStateCallInfo final { |
80 public: | 80 public: |
81 FrameStateCallInfo(FrameStateType type, BailoutId bailout_id, | 81 FrameStateCallInfo(FrameStateType type, BailoutId bailout_id, |
82 OutputFrameStateCombine state_combine) | 82 OutputFrameStateCombine state_combine, |
| 83 MaybeHandle<SharedFunctionInfo> shared_info) |
83 : type_(type), | 84 : type_(type), |
84 bailout_id_(bailout_id), | 85 bailout_id_(bailout_id), |
85 frame_state_combine_(state_combine) {} | 86 frame_state_combine_(state_combine), |
| 87 shared_info_(shared_info) {} |
86 | 88 |
87 FrameStateType type() const { return type_; } | 89 FrameStateType type() const { return type_; } |
88 BailoutId bailout_id() const { return bailout_id_; } | 90 BailoutId bailout_id() const { return bailout_id_; } |
89 OutputFrameStateCombine state_combine() const { return frame_state_combine_; } | 91 OutputFrameStateCombine state_combine() const { return frame_state_combine_; } |
| 92 MaybeHandle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
90 | 93 |
91 private: | 94 private: |
92 FrameStateType const type_; | 95 FrameStateType const type_; |
93 BailoutId const bailout_id_; | 96 BailoutId const bailout_id_; |
94 OutputFrameStateCombine const frame_state_combine_; | 97 OutputFrameStateCombine const frame_state_combine_; |
| 98 MaybeHandle<SharedFunctionInfo> const shared_info_; |
95 }; | 99 }; |
96 | 100 |
97 bool operator==(FrameStateCallInfo const&, FrameStateCallInfo const&); | 101 bool operator==(FrameStateCallInfo const&, FrameStateCallInfo const&); |
98 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); | 102 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); |
99 | 103 |
100 size_t hash_value(FrameStateCallInfo const&); | 104 size_t hash_value(FrameStateCallInfo const&); |
101 | 105 |
102 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); | 106 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); |
103 | 107 |
104 static const int kFrameStateParametersInput = 0; | 108 static const int kFrameStateParametersInput = 0; |
105 static const int kFrameStateLocalsInput = 1; | 109 static const int kFrameStateLocalsInput = 1; |
106 static const int kFrameStateStackInput = 2; | 110 static const int kFrameStateStackInput = 2; |
107 static const int kFrameStateContextInput = 3; | 111 static const int kFrameStateContextInput = 3; |
108 static const int kFrameStateFunctionInput = 4; | 112 static const int kFrameStateFunctionInput = 4; |
109 static const int kFrameStateOuterStateInput = 5; | 113 static const int kFrameStateOuterStateInput = 5; |
110 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; | 114 static const int kFrameStateInputCount = kFrameStateOuterStateInput + 1; |
111 | 115 |
112 } // namespace compiler | 116 } // namespace compiler |
113 } // namespace internal | 117 } // namespace internal |
114 } // namespace v8 | 118 } // namespace v8 |
115 | 119 |
116 #endif // V8_COMPILER_FRAME_STATES_H_ | 120 #endif // V8_COMPILER_FRAME_STATES_H_ |
OLD | NEW |