Chromium Code Reviews| 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/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
| 10 | 10 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 V(kValueMismatch, "value mismatch") \ | 395 V(kValueMismatch, "value mismatch") \ |
| 396 V(kWrongInstanceType, "wrong instance type") \ | 396 V(kWrongInstanceType, "wrong instance type") \ |
| 397 V(kWrongMap, "wrong map") \ | 397 V(kWrongMap, "wrong map") \ |
| 398 V(kUndefinedOrNullInForIn, "null or undefined in for-in") \ | 398 V(kUndefinedOrNullInForIn, "null or undefined in for-in") \ |
| 399 V(kUndefinedOrNullInToObject, "null or undefined in ToObject") | 399 V(kUndefinedOrNullInToObject, "null or undefined in ToObject") |
| 400 | 400 |
| 401 class Deoptimizer : public Malloced { | 401 class Deoptimizer : public Malloced { |
| 402 public: | 402 public: |
| 403 enum BailoutType { EAGER, LAZY, SOFT, kLastBailoutType = SOFT }; | 403 enum BailoutType { EAGER, LAZY, SOFT, kLastBailoutType = SOFT }; |
| 404 | 404 |
| 405 enum class BailoutState { | |
| 406 NO_REGISTERS, | |
| 407 TOS_REGISTER, | |
| 408 }; | |
| 409 | |
| 410 static const char* BailoutStateToString(BailoutState state) { | |
| 411 switch (state) { | |
| 412 case BailoutState::NO_REGISTERS: | |
| 413 return "NO_REGISTERS"; | |
| 414 case BailoutState::TOS_REGISTER: | |
| 415 return "TOS_REGISTER"; | |
| 416 } | |
| 417 UNREACHABLE(); | |
| 418 return NULL; | |
|
Michael Starzinger
2016/05/17 14:41:53
nit: s/NULL/nullptr/
rmcilroy
2016/05/17 15:20:05
Done.
| |
| 419 } | |
| 420 | |
| 405 #define DEOPT_MESSAGES_CONSTANTS(C, T) C, | 421 #define DEOPT_MESSAGES_CONSTANTS(C, T) C, |
| 406 enum DeoptReason { | 422 enum DeoptReason { |
| 407 DEOPT_MESSAGES_LIST(DEOPT_MESSAGES_CONSTANTS) kLastDeoptReason | 423 DEOPT_MESSAGES_LIST(DEOPT_MESSAGES_CONSTANTS) kLastDeoptReason |
| 408 }; | 424 }; |
| 409 #undef DEOPT_MESSAGES_CONSTANTS | 425 #undef DEOPT_MESSAGES_CONSTANTS |
| 410 static const char* GetDeoptReason(DeoptReason deopt_reason); | 426 static const char* GetDeoptReason(DeoptReason deopt_reason); |
| 411 | 427 |
| 412 struct DeoptInfo { | 428 struct DeoptInfo { |
| 413 DeoptInfo(SourcePosition position, DeoptReason deopt_reason, int deopt_id) | 429 DeoptInfo(SourcePosition position, DeoptReason deopt_reason, int deopt_id) |
| 414 : position(position), deopt_reason(deopt_reason), deopt_id(deopt_id) {} | 430 : position(position), deopt_reason(deopt_reason), deopt_id(deopt_id) {} |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1118 std::vector<Handle<Object> > expression_stack_; | 1134 std::vector<Handle<Object> > expression_stack_; |
| 1119 int source_position_; | 1135 int source_position_; |
| 1120 | 1136 |
| 1121 friend class Deoptimizer; | 1137 friend class Deoptimizer; |
| 1122 }; | 1138 }; |
| 1123 | 1139 |
| 1124 } // namespace internal | 1140 } // namespace internal |
| 1125 } // namespace v8 | 1141 } // namespace v8 |
| 1126 | 1142 |
| 1127 #endif // V8_DEOPTIMIZER_H_ | 1143 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |