5#ifndef V8_CODEGEN_BAILOUT_REASON_H_ 
    6#define V8_CODEGEN_BAILOUT_REASON_H_ 
   13#define ABORT_MESSAGES_LIST(V)                                                 \ 
   14  V(kNoReason, "no reason")                                                    \ 
   16  V(k32BitValueInRegisterIsNotZeroExtended,                                    \ 
   17    "32 bit value in register is not zero-extended")                           \ 
   18  V(kSignedBitOfSmiIsNotZero, "Signed bit of 31 bit smi register is not zero") \ 
   19  V(kAPICallReturnedInvalidObject, "API call returned invalid object")         \ 
   20  V(kAccumulatorClobbered, "Accumulator clobbered")                            \ 
   21  V(kAllocatingNonEmptyPackedArray, "Allocating non-empty packed array")       \ 
   22  V(kAllocationIsNotDoubleAligned, "Allocation is not double aligned")         \ 
   23  V(kExpectedOptimizationSentinel,                                             \ 
   24    "Expected optimized code cell or optimization sentinel")                   \ 
   25  V(kExpectedOsrCode, "Expected OSR code")                                     \ 
   26  V(kExpectedUndefinedOrCell, "Expected undefined or cell in register")        \ 
   27  V(kExpectedFeedbackCell, "Expected feedback cell")                           \ 
   28  V(kExpectedFeedbackVector, "Expected feedback vector")                       \ 
   29  V(kExpectedBaselineData, "Expected baseline data")                           \ 
   30  V(kFloat64IsNotAInt32,                                                       \ 
   31    "Float64 cannot be converted to Int32 without loss of precision")          \ 
   32  V(kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry,                      \ 
   33    "The function_data field should be a BytecodeArray on interpreter entry")  \ 
   34  V(kInputStringTooLong, "Input string too long")                              \ 
   35  V(kInputDoesNotFitSmi, "Input number is too large to fit in a Smi")          \ 
   36  V(kInvalidBytecode, "Invalid bytecode")                                      \ 
   37  V(kInvalidBytecodeAdvance, "Cannot advance current bytecode, ")              \ 
   38  V(kInvalidDeoptimizedCode, "Invoked code which is deoptimized")              \ 
   39  V(kInvalidHandleScopeLevel, "Invalid HandleScope level")                     \ 
   40  V(kInvalidJumpTableIndex, "Invalid jump table index")                        \ 
   41  V(kInvalidParametersAndRegistersInGenerator,                                 \ 
   42    "invalid parameters and registers in generator")                           \ 
   43  V(kMissingBytecodeArray, "Missing bytecode array from function")             \ 
   44  V(kObjectNotTagged, "The object is not tagged")                              \ 
   45  V(kObjectTagged, "The object is tagged")                                     \ 
   46  V(kOffsetOutOfRange, "Offset out of range")                                  \ 
   47  V(kOperandIsASmi, "Operand is a smi")                                        \ 
   48  V(kOperandIsASmiAndNotABoundFunction,                                        \ 
   49    "Operand is a smi and not a bound function")                               \ 
   50  V(kOperandIsASmiAndNotAConstructor,                                          \ 
   51    "Operand is a smi and not a constructor")                                  \ 
   52  V(kOperandIsASmiAndNotAFunction, "Operand is a smi and not a function")      \ 
   53  V(kOperandIsASmiAndNotAGeneratorObject,                                      \ 
   54    "Operand is a smi and not a generator object")                             \ 
   55  V(kOperandIsCleared, "Operand is cleared")                                   \ 
   56  V(kOperandIsNotABoundFunction, "Operand is not a bound function")            \ 
   57  V(kOperandIsNotAConstructor, "Operand is not a constructor")                 \ 
   58  V(kOperandIsNotAFixedArray, "Operand is not a fixed array")                  \ 
   59  V(kOperandIsNotAFunction, "Operand is not a function")                       \ 
   60  V(kOperandIsNotACallableFunction, "Operand is not a callable function")      \ 
   61  V(kOperandIsNotAGeneratorObject, "Operand is not a generator object")        \ 
   62  V(kOperandIsNotACode, "Operand is not a Code object")                        \ 
   63  V(kOperandIsNotAMap, "Operand is not a Map object")                          \ 
   64  V(kOperandIsNotASmi, "Operand is not a smi")                                 \ 
   65  V(kPromiseAlreadySettled, "Promise already settled")                         \ 
   66  V(kReceivedInvalidReturnAddress, "Received invalid return address")          \ 
   67  V(kRegisterDidNotMatchExpectedRoot, "Register did not match expected root")  \ 
   68  V(kReturnAddressNotFoundInFrame, "Return address not found in frame")        \ 
   69  V(kShouldNotDirectlyEnterOsrFunction,                                        \ 
   70    "Should not directly enter OSR-compiled function")                         \ 
   71  V(kStackAccessBelowStackPointer, "Stack access below stack pointer")         \ 
   72  V(kOsrUnexpectedStackSize, "Unexpected stack size on OSR entry")             \ 
   73  V(kStackFrameTypesMustMatch, "Stack frame types must match")                 \ 
   74  V(kUint32IsNotAInt32,                                                        \ 
   75    "Uint32 cannot be converted to Int32 without loss of precision")           \ 
   76  V(kUnalignedCellInWriteBarrier, "Unaligned cell in write barrier")           \ 
   77  V(kUnexpectedAdditionalPopValue, "Unexpected additional pop value")          \ 
   78  V(kUnexpectedElementsKindInArrayConstructor,                                 \ 
   79    "Unexpected ElementsKind in array constructor")                            \ 
   80  V(kUnexpectedFPCRMode, "Unexpected FPCR mode.")                              \ 
   81  V(kUnexpectedFunctionIDForInvokeIntrinsic,                                   \ 
   82    "Unexpected runtime function id for the InvokeIntrinsic bytecode")         \ 
   83  V(kUnexpectedInitialMapForArrayFunction,                                     \ 
   84    "Unexpected initial map for Array function")                               \ 
   85  V(kUnexpectedLevelAfterReturnFromApiCall,                                    \ 
   86    "Unexpected level after return from api call")                             \ 
   87  V(kUnexpectedNegativeValue, "Unexpected negative value")                     \ 
   88  V(kUnexpectedReturnFromFrameDropper,                                         \ 
   89    "Unexpectedly returned from dropping frames")                              \ 
   90  V(kUnexpectedReturnFromThrow, "Unexpectedly returned from a throw")          \ 
   91  V(kUnexpectedReturnFromWasmTrap,                                             \ 
   92    "Should not return after throwing a wasm trap")                            \ 
   93  V(kUnexpectedStackPointer, "The stack pointer is not the expected value")    \ 
   94  V(kUnexpectedValue, "Unexpected value")                                      \ 
   95  V(kUninhabitableType, "Uninhabitable type")                                  \ 
   96  V(kUnsupportedModuleOperation, "Unsupported module operation")               \ 
   97  V(kUnsupportedNonPrimitiveCompare, "Unsupported non-primitive compare")      \ 
   98  V(kWrongAddressOrValuePassedToRecordWrite,                                   \ 
   99    "Wrong address or value passed to RecordWrite")                            \ 
  100  V(kWrongArgumentCountForInvokeIntrinsic,                                     \ 
  101    "Wrong number of arguments for intrinsic")                                 \ 
  102  V(kWrongFunctionCodeStart, "Wrong value in code start register passed")      \ 
  103  V(kWrongFunctionContext, "Wrong context passed to function")                 \ 
  104  V(kWrongFunctionDispatchHandle,                                              \ 
  105    "Wrong value in dispatch handle register passed")                          \ 
  106  V(kUnexpectedThreadInWasmSet, "thread_in_wasm flag was already set")         \ 
  107  V(kUnexpectedThreadInWasmUnset, "thread_in_wasm flag was not set")           \ 
  108  V(kInvalidReceiver, "Expected JS object or primitive object")                \ 
  109  V(kUnexpectedInstanceType, "Unexpected instance type encountered")           \ 
  110  V(kTurboshaftTypeAssertionFailed,                                            \ 
  111    "A type assertion failed in Turboshaft-generated code")                    \ 
  112  V(kMetadataAreaStartDoesNotMatch,                                            \ 
  113    "The metadata doesn't belong to the chunk")                                \ 
  114  V(kExternalPointerTagMismatch,                                               \ 
  115    "Tag mismatch during external pointer access")                             \ 
  116  V(kJSSignatureMismatch, "Signature mismatch during JS function call")        \ 
  117  V(kWasmSignatureMismatch, "Signature mismatch during Wasm indirect call")    \ 
  118  V(kFastCallFallbackInvalid, "Fast call fallback returned incorrect type")    \ 
  119  V(k32BitValueInRegisterIsNotSignExtended,                                    \ 
  120    "32 bit value in register is not sign-extended") 
 
  121#define BAILOUT_MESSAGES_LIST(V)                                             \ 
  122  V(kNoReason, "no reason")                                                  \ 
  124  V(kBailedOutDueToDependencyChange, "Bailed out due to dependency change")  \ 
  125  V(kCancelled, "Job got cancelled")                                         \ 
  126  V(kConcurrentMapDeprecation, "Maps became deprecated during optimization") \ 
  127  V(kCodeGenerationFailed, "Code generation failed")                         \ 
  128  V(kFunctionBeingDebugged, "Function is being debugged")                    \ 
  129  V(kGraphBuildingFailed, "Optimized graph construction failed")             \ 
  130  V(kFunctionTooBig, "Function is too big to be optimized")                  \ 
  131  V(kTooManyArguments, "Function contains a call with too many arguments")   \ 
  132  V(kLiveEdit, "LiveEdit")                                                   \ 
  133  V(kNativeFunctionLiteral, "Native function literal")                       \ 
  134  V(kOptimizationDisabled, "Optimization disabled")                          \ 
  135  V(kHigherTierAvailable, "A higher tier is already available")              \ 
  136  V(kDetachedNativeContext, "The native context is detached")                \ 
  137  V(kNeverOptimize, "Optimization is always disabled") 
 
  139#define ERROR_MESSAGES_CONSTANTS(C, T) C, 
  147#undef ERROR_MESSAGES_CONSTANTS 
#define ERROR_MESSAGES_CONSTANTS(C, T)
const char * GetAbortReason(AbortReason reason)
const char * GetBailoutReason(BailoutReason reason)
bool IsValidAbortReason(int reason_id)