V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
deoptimize-reason.h
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_DEOPTIMIZE_REASON_H_
6 #define V8_DEOPTIMIZE_REASON_H_
7 
8 #include "src/globals.h"
9 
10 namespace v8 {
11 namespace internal {
12 
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") \
19  V(Hole, "hole") \
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") \
38  V(NaN, "NaN") \
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") \
51  V(Smi, "Smi") \
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")
61 
62 enum class DeoptimizeReason : uint8_t {
63 #define DEOPTIMIZE_REASON(Name, message) k##Name,
64  DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
65 #undef DEOPTIMIZE_REASON
66 };
67 
68 std::ostream& operator<<(std::ostream&, DeoptimizeReason);
69 
70 size_t hash_value(DeoptimizeReason reason);
71 
72 char const* DeoptimizeReasonToString(DeoptimizeReason reason);
73 
74 } // namespace internal
75 } // namespace v8
76 
77 #endif // V8_DEOPTIMIZE_REASON_H_
Definition: libplatform.h:13