V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
bailout-reason.h
1 // Copyright 2014 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_BAILOUT_REASON_H_
6 #define V8_BAILOUT_REASON_H_
7 
8 #include <cstdint>
9 
10 namespace v8 {
11 namespace internal {
12 
13 #define ABORT_MESSAGES_LIST(V) \
14  V(kNoReason, "no reason") \
15  \
16  V(k32BitValueInRegisterIsNotZeroExtended, \
17  "32 bit value in register is not zero-extended") \
18  V(kAPICallReturnedInvalidObject, "API call returned invalid object") \
19  V(kAllocatingNonEmptyPackedArray, "Allocating non-empty packed array") \
20  V(kAllocationIsNotDoubleAligned, "Allocation is not double aligned") \
21  V(kExpectedOptimizationSentinel, \
22  "Expected optimized code cell or optimization sentinel") \
23  V(kExpectedUndefinedOrCell, "Expected undefined or cell in register") \
24  V(kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, \
25  "The function_data field should be a BytecodeArray on interpreter entry") \
26  V(kInputStringTooLong, "Input string too long") \
27  V(kInvalidBytecode, "Invalid bytecode") \
28  V(kInvalidBytecodeAdvance, "Cannot advance current bytecode, ") \
29  V(kInvalidElementsKindForInternalArrayOrInternalPackedArray, \
30  "Invalid ElementsKind for InternalArray or InternalPackedArray") \
31  V(kInvalidHandleScopeLevel, "Invalid HandleScope level") \
32  V(kInvalidJumpTableIndex, "Invalid jump table index") \
33  V(kInvalidParametersAndRegistersInGenerator, \
34  "invalid parameters and registers in generator") \
35  V(kMissingBytecodeArray, "Missing bytecode array from function") \
36  V(kObjectNotTagged, "The object is not tagged") \
37  V(kObjectTagged, "The object is tagged") \
38  V(kOffsetOutOfRange, "Offset out of range") \
39  V(kOperandIsASmi, "Operand is a smi") \
40  V(kOperandIsASmiAndNotABoundFunction, \
41  "Operand is a smi and not a bound function") \
42  V(kOperandIsASmiAndNotAConstructor, \
43  "Operand is a smi and not a constructor") \
44  V(kOperandIsASmiAndNotAFunction, "Operand is a smi and not a function") \
45  V(kOperandIsASmiAndNotAGeneratorObject, \
46  "Operand is a smi and not a generator object") \
47  V(kOperandIsNotABoundFunction, "Operand is not a bound function") \
48  V(kOperandIsNotAConstructor, "Operand is not a constructor") \
49  V(kOperandIsNotAFixedArray, "Operand is not a fixed array") \
50  V(kOperandIsNotAFunction, "Operand is not a function") \
51  V(kOperandIsNotAGeneratorObject, "Operand is not a generator object") \
52  V(kOperandIsNotASmi, "Operand is not a smi") \
53  V(kReceivedInvalidReturnAddress, "Received invalid return address") \
54  V(kRegisterDidNotMatchExpectedRoot, "Register did not match expected root") \
55  V(kRegisterWasClobbered, "Register was clobbered") \
56  V(kReturnAddressNotFoundInFrame, "Return address not found in frame") \
57  V(kShouldNotDirectlyEnterOsrFunction, \
58  "Should not directly enter OSR-compiled function") \
59  V(kStackAccessBelowStackPointer, "Stack access below stack pointer") \
60  V(kStackFrameTypesMustMatch, "Stack frame types must match") \
61  V(kUnalignedCellInWriteBarrier, "Unaligned cell in write barrier") \
62  V(kUnexpectedElementsKindInArrayConstructor, \
63  "Unexpected ElementsKind in array constructor") \
64  V(kUnexpectedFPCRMode, "Unexpected FPCR mode.") \
65  V(kUnexpectedFunctionIDForInvokeIntrinsic, \
66  "Unexpected runtime function id for the InvokeIntrinsic bytecode") \
67  V(kUnexpectedInitialMapForArrayFunction, \
68  "Unexpected initial map for Array function") \
69  V(kUnexpectedInitialMapForInternalArrayFunction, \
70  "Unexpected initial map for InternalArray function") \
71  V(kUnexpectedLevelAfterReturnFromApiCall, \
72  "Unexpected level after return from api call") \
73  V(kUnexpectedNegativeValue, "Unexpected negative value") \
74  V(kUnexpectedReturnFromFrameDropper, \
75  "Unexpectedly returned from dropping frames") \
76  V(kUnexpectedReturnFromThrow, "Unexpectedly returned from a throw") \
77  V(kUnexpectedReturnFromWasmTrap, \
78  "Should not return after throwing a wasm trap") \
79  V(kUnexpectedStackPointer, "The stack pointer is not the expected value") \
80  V(kUnexpectedValue, "Unexpected value") \
81  V(kUnsupportedModuleOperation, "Unsupported module operation") \
82  V(kUnsupportedNonPrimitiveCompare, "Unsupported non-primitive compare") \
83  V(kWrongAddressOrValuePassedToRecordWrite, \
84  "Wrong address or value passed to RecordWrite") \
85  V(kWrongArgumentCountForInvokeIntrinsic, \
86  "Wrong number of arguments for intrinsic") \
87  V(kWrongFunctionCodeStart, "Wrong value in code start register passed") \
88  V(kWrongFunctionContext, "Wrong context passed to function")
89 
90 #define BAILOUT_MESSAGES_LIST(V) \
91  V(kNoReason, "no reason") \
92  \
93  V(kBailedOutDueToDependencyChange, "Bailed out due to dependency change") \
94  V(kCodeGenerationFailed, "Code generation failed") \
95  V(kCyclicObjectStateDetectedInEscapeAnalysis, \
96  "Cyclic object state detected by escape analysis") \
97  V(kFunctionBeingDebugged, "Function is being debugged") \
98  V(kGraphBuildingFailed, "Optimized graph construction failed") \
99  V(kFunctionTooBig, "Function is too big to be optimized") \
100  V(kLiveEdit, "LiveEdit") \
101  V(kNativeFunctionLiteral, "Native function literal") \
102  V(kNotEnoughVirtualRegistersRegalloc, \
103  "Not enough virtual registers (regalloc)") \
104  V(kOptimizationDisabled, "Optimization disabled") \
105  V(kOptimizationDisabledForTest, "Optimization disabled for test")
106 
107 #define ERROR_MESSAGES_CONSTANTS(C, T) C,
108 enum class BailoutReason : uint8_t {
109  BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
110 };
111 
112 enum class AbortReason : uint8_t {
113  ABORT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
114 };
115 #undef ERROR_MESSAGES_CONSTANTS
116 
117 const char* GetBailoutReason(BailoutReason reason);
118 const char* GetAbortReason(AbortReason reason);
119 bool IsValidAbortReason(int reason_id);
120 
121 } // namespace internal
122 } // namespace v8
123 
124 #endif // V8_BAILOUT_REASON_H_
Definition: libplatform.h:13