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" // TODO(everyone): Fix our inl.h crap | |
9 #include "src/objects-inl.h" // TODO(everyone): Fix our inl.h crap | |
10 #include "src/utils.h" | 8 #include "src/utils.h" |
11 | 9 |
12 namespace v8 { | 10 namespace v8 { |
13 namespace internal { | 11 namespace internal { |
14 namespace compiler { | 12 namespace compiler { |
15 | 13 |
16 // Flag that describes how to combine the current environment with | 14 // Flag that describes how to combine the current environment with |
17 // 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. |
18 class OutputFrameStateCombine { | 16 class OutputFrameStateCombine { |
19 public: | 17 public: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 71 |
74 // The type of stack frame that a FrameState node represents. | 72 // The type of stack frame that a FrameState node represents. |
75 enum FrameStateType { | 73 enum FrameStateType { |
76 JS_FRAME, // Represents an unoptimized JavaScriptFrame. | 74 JS_FRAME, // Represents an unoptimized JavaScriptFrame. |
77 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. | 75 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. |
78 }; | 76 }; |
79 | 77 |
80 | 78 |
81 class FrameStateCallInfo final { | 79 class FrameStateCallInfo final { |
82 public: | 80 public: |
83 FrameStateCallInfo( | 81 FrameStateCallInfo(FrameStateType type, BailoutId bailout_id, |
84 FrameStateType type, BailoutId bailout_id, | 82 OutputFrameStateCombine state_combine) |
85 OutputFrameStateCombine state_combine, | |
86 MaybeHandle<JSFunction> jsfunction = MaybeHandle<JSFunction>()) | |
87 : type_(type), | 83 : type_(type), |
88 bailout_id_(bailout_id), | 84 bailout_id_(bailout_id), |
89 frame_state_combine_(state_combine), | 85 frame_state_combine_(state_combine) {} |
90 jsfunction_(jsfunction) {} | |
91 | 86 |
92 FrameStateType type() const { return type_; } | 87 FrameStateType type() const { return type_; } |
93 BailoutId bailout_id() const { return bailout_id_; } | 88 BailoutId bailout_id() const { return bailout_id_; } |
94 OutputFrameStateCombine state_combine() const { return frame_state_combine_; } | 89 OutputFrameStateCombine state_combine() const { return frame_state_combine_; } |
95 MaybeHandle<JSFunction> jsfunction() const { return jsfunction_; } | |
96 | 90 |
97 private: | 91 private: |
98 FrameStateType type_; | 92 FrameStateType const type_; |
99 BailoutId bailout_id_; | 93 BailoutId const bailout_id_; |
100 OutputFrameStateCombine frame_state_combine_; | 94 OutputFrameStateCombine const frame_state_combine_; |
101 MaybeHandle<JSFunction> jsfunction_; | |
102 }; | 95 }; |
103 | 96 |
104 bool operator==(FrameStateCallInfo const&, FrameStateCallInfo const&); | 97 bool operator==(FrameStateCallInfo const&, FrameStateCallInfo const&); |
105 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); | 98 bool operator!=(FrameStateCallInfo const&, FrameStateCallInfo const&); |
106 | 99 |
107 size_t hash_value(FrameStateCallInfo const&); | 100 size_t hash_value(FrameStateCallInfo const&); |
108 | 101 |
109 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); | 102 std::ostream& operator<<(std::ostream&, FrameStateCallInfo const&); |
110 | 103 |
111 | 104 |
112 } // namespace compiler | 105 } // namespace compiler |
113 } // namespace internal | 106 } // namespace internal |
114 } // namespace v8 | 107 } // namespace v8 |
115 | 108 |
116 #endif // V8_COMPILER_FRAME_STATES_H_ | 109 #endif // V8_COMPILER_FRAME_STATES_H_ |
OLD | NEW |