5 #ifndef V8_DEOPTIMIZE_REASON_H_ 6 #define V8_DEOPTIMIZE_REASON_H_ 8 #include "src/globals.h" 13 #define DEOPTIMIZE_REASON_LIST(V) \ 14 V(ArrayBufferWasNeutered, "array buffer was neutered") \ 15 V(CowArrayElementsChanged, "copy-on-write array's elements changed") \ 16 V(CouldNotGrowElements, "failed to grow elements store") \ 17 V(DeoptimizeNow, "%_DeoptimizeNow") \ 18 V(DivisionByZero, "division by zero") \ 20 V(InstanceMigrationFailed, "instance migration failed") \ 21 V(InsufficientTypeFeedbackForCall, "Insufficient type feedback for call") \ 22 V(InsufficientTypeFeedbackForConstruct, \ 23 "Insufficient type feedback for construct") \ 24 V(InsufficientTypeFeedbackForForIn, "Insufficient type feedback for for-in") \ 25 V(InsufficientTypeFeedbackForBinaryOperation, \ 26 "Insufficient type feedback for binary operation") \ 27 V(InsufficientTypeFeedbackForCompareOperation, \ 28 "Insufficient type feedback for compare operation") \ 29 V(InsufficientTypeFeedbackForGenericNamedAccess, \ 30 "Insufficient type feedback for generic named access") \ 31 V(InsufficientTypeFeedbackForGenericKeyedAccess, \ 32 "Insufficient type feedback for generic keyed access") \ 33 V(InsufficientTypeFeedbackForUnaryOperation, \ 34 "Insufficient type feedback for unary operation") \ 35 V(LostPrecision, "lost precision") \ 36 V(LostPrecisionOrNaN, "lost precision or NaN") \ 37 V(MinusZero, "minus zero") \ 39 V(NoCache, "no cache") \ 40 V(NotAHeapNumber, "not a heap number") \ 41 V(NotAJavaScriptObject, "not a JavaScript object") \ 42 V(NotAJavaScriptObjectOrNullOrUndefined, \ 43 "not a JavaScript object, Null or Undefined") \ 44 V(NotANumberOrOddball, "not a Number or Oddball") \ 45 V(NotASmi, "not a Smi") \ 46 V(NotAString, "not a String") \ 47 V(NotASymbol, "not a Symbol") \ 48 V(OutOfBounds, "out of bounds") \ 49 V(Overflow, "overflow") \ 50 V(ReceiverNotAGlobalProxy, "receiver was not a global proxy") \ 52 V(Unknown, "(unknown)") \ 53 V(ValueMismatch, "value mismatch") \ 54 V(WrongCallTarget, "wrong call target") \ 55 V(WrongEnumIndices, "wrong enum indices") \ 56 V(WrongInstanceType, "wrong instance type") \ 57 V(WrongMap, "wrong map") \ 58 V(WrongName, "wrong name") \ 59 V(WrongValue, "wrong value") \ 60 V(NoInitialElement, "no initial element") 62 enum class DeoptimizeReason : uint8_t {
63 #define DEOPTIMIZE_REASON(Name, message) k##Name, 64 DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
65 #undef DEOPTIMIZE_REASON 68 std::ostream& operator<<(std::ostream&, DeoptimizeReason);
70 size_t hash_value(DeoptimizeReason reason);
72 char const* DeoptimizeReasonToString(DeoptimizeReason reason);
77 #endif // V8_DEOPTIMIZE_REASON_H_