| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_DEOPTIMIZER_H_ | 5 #ifndef V8_DEOPTIMIZER_H_ |
| 6 #define V8_DEOPTIMIZER_H_ | 6 #define V8_DEOPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 DEOPT_MESSAGES_LIST(DEOPT_MESSAGES_CONSTANTS) kLastDeoptReason | 181 DEOPT_MESSAGES_LIST(DEOPT_MESSAGES_CONSTANTS) kLastDeoptReason |
| 182 }; | 182 }; |
| 183 #undef DEOPT_MESSAGES_CONSTANTS | 183 #undef DEOPT_MESSAGES_CONSTANTS |
| 184 | 184 |
| 185 static const char* GetDeoptReason(DeoptReason deopt_reason); | 185 static const char* GetDeoptReason(DeoptReason deopt_reason); |
| 186 | 186 |
| 187 struct DeoptInfo { | 187 struct DeoptInfo { |
| 188 DeoptInfo(int r, const char* m, DeoptReason d) | 188 DeoptInfo(int r, const char* m, DeoptReason d) |
| 189 : raw_position(r), mnemonic(m), deopt_reason(d) {} | 189 : raw_position(r), mnemonic(m), deopt_reason(d) {} |
| 190 | 190 |
| 191 bool operator==(const DeoptInfo& other) const { |
| 192 return raw_position == other.raw_position && |
| 193 CStringEquals(mnemonic, other.mnemonic) && |
| 194 deopt_reason == other.deopt_reason; |
| 195 } |
| 196 |
| 197 bool operator!=(const DeoptInfo& other) const { return !(*this == other); } |
| 198 |
| 191 int raw_position; | 199 int raw_position; |
| 192 const char* mnemonic; | 200 const char* mnemonic; |
| 193 DeoptReason deopt_reason; | 201 DeoptReason deopt_reason; |
| 194 }; | 202 }; |
| 195 | 203 |
| 196 static DeoptInfo GetDeoptInfo(Code* code, int bailout_id); | 204 static DeoptInfo GetDeoptInfo(Code* code, int bailout_id); |
| 197 | 205 |
| 198 struct JumpTableEntry : public ZoneObject { | 206 struct JumpTableEntry : public ZoneObject { |
| 199 inline JumpTableEntry(Address entry, const DeoptInfo& deopt_info, | 207 inline JumpTableEntry(Address entry, const DeoptInfo& deopt_info, |
| 200 Deoptimizer::BailoutType type, bool frame) | 208 Deoptimizer::BailoutType type, bool frame) |
| 201 : label(), | 209 : label(), |
| 202 address(entry), | 210 address(entry), |
| 203 deopt_info(deopt_info), | 211 deopt_info(deopt_info), |
| 204 bailout_type(type), | 212 bailout_type(type), |
| 205 needs_frame(frame) {} | 213 needs_frame(frame) {} |
| 206 | 214 |
| 207 bool IsEquivalentTo(const JumpTableEntry& other) const { | 215 bool IsEquivalentTo(const JumpTableEntry& other) const { |
| 208 return address == other.address && bailout_type == other.bailout_type && | 216 return address == other.address && bailout_type == other.bailout_type && |
| 209 needs_frame == other.needs_frame; | 217 needs_frame == other.needs_frame && |
| 218 (!FLAG_trace_deopt || deopt_info == other.deopt_info); |
| 210 } | 219 } |
| 211 | 220 |
| 212 Label label; | 221 Label label; |
| 213 Address address; | 222 Address address; |
| 214 DeoptInfo deopt_info; | 223 DeoptInfo deopt_info; |
| 215 Deoptimizer::BailoutType bailout_type; | 224 Deoptimizer::BailoutType bailout_type; |
| 216 bool needs_frame; | 225 bool needs_frame; |
| 217 }; | 226 }; |
| 218 | 227 |
| 219 static bool TraceEnabledFor(BailoutType deopt_type, | 228 static bool TraceEnabledFor(BailoutType deopt_type, |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 Object** parameters_; | 1066 Object** parameters_; |
| 1058 Object** expression_stack_; | 1067 Object** expression_stack_; |
| 1059 int source_position_; | 1068 int source_position_; |
| 1060 | 1069 |
| 1061 friend class Deoptimizer; | 1070 friend class Deoptimizer; |
| 1062 }; | 1071 }; |
| 1063 | 1072 |
| 1064 } } // namespace v8::internal | 1073 } } // namespace v8::internal |
| 1065 | 1074 |
| 1066 #endif // V8_DEOPTIMIZER_H_ | 1075 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |