2014-09-24 07:08:27 +00:00
|
|
|
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef V8_BAILOUT_REASON_H_
|
|
|
|
#define V8_BAILOUT_REASON_H_
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2018-01-03 23:27:03 +00:00
|
|
|
#define ABORT_MESSAGES_LIST(V) \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kNoReason, "no reason") \
|
|
|
|
\
|
|
|
|
V(k32BitValueInRegisterIsNotZeroExtended, \
|
|
|
|
"32 bit value in register is not zero-extended") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kAPICallReturnedInvalidObject, "API call returned invalid object") \
|
2016-07-05 15:49:52 +00:00
|
|
|
V(kAllocatingNonEmptyPackedArray, "Allocating non-empty packed array") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kAllocationIsNotDoubleAligned, "Allocation is not double aligned") \
|
|
|
|
V(kCodeObjectNotProperlyPatched, "Code object not properly patched") \
|
|
|
|
V(kExpectedAllocationSite, "Expected allocation site") \
|
2017-06-15 14:53:38 +00:00
|
|
|
V(kExpectedFeedbackVector, "Expected feedback vector") \
|
|
|
|
V(kExpectedOptimizationSentinel, \
|
|
|
|
"Expected optimized code cell or optimization sentinel") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kExpectedUndefinedOrCell, "Expected undefined or cell in register") \
|
2015-07-30 11:36:26 +00:00
|
|
|
V(kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, \
|
|
|
|
"The function_data field should be a BytecodeArray on interpreter entry") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kInputStringTooLong, "Input string too long") \
|
2016-03-21 17:08:21 +00:00
|
|
|
V(kInvalidBytecode, "Invalid bytecode") \
|
2018-01-26 16:34:27 +00:00
|
|
|
V(kInvalidBytecodeAdvance, "Cannot advance current bytecode, ") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kInvalidElementsKindForInternalArrayOrInternalPackedArray, \
|
|
|
|
"Invalid ElementsKind for InternalArray or InternalPackedArray") \
|
|
|
|
V(kInvalidHandleScopeLevel, "Invalid HandleScope level") \
|
2016-05-13 16:01:15 +00:00
|
|
|
V(kInvalidJumpTableIndex, "Invalid jump table index") \
|
2018-05-24 09:29:53 +00:00
|
|
|
V(kInvalidParametersAndRegistersInGenerator, \
|
|
|
|
"invalid parameters and registers in generator") \
|
2018-03-22 16:09:55 +00:00
|
|
|
V(kInvalidSharedFunctionInfoData, "Invalid SharedFunctionInfo data") \
|
2016-11-21 12:25:11 +00:00
|
|
|
V(kMissingBytecodeArray, "Missing bytecode array from function") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kObjectNotTagged, "The object is not tagged") \
|
|
|
|
V(kObjectTagged, "The object is tagged") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kOffsetOutOfRange, "Offset out of range") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kOperandIsASmi, "Operand is a smi") \
|
2015-12-27 06:30:53 +00:00
|
|
|
V(kOperandIsASmiAndNotABoundFunction, \
|
|
|
|
"Operand is a smi and not a bound function") \
|
2018-03-23 14:23:20 +00:00
|
|
|
V(kOperandIsASmiAndNotAConstructor, \
|
|
|
|
"Operand is a smi and not a constructor") \
|
2017-06-08 18:31:59 +00:00
|
|
|
V(kOperandIsASmiAndNotAFixedArray, "Operand is a smi and not a fixed array") \
|
[builtins] Unify the various versions of [[Call]] with a Call builtin.
The new Call and CallFunction builtins supersede the current
CallFunctionStub (and CallIC magic) and will be the single bottleneck
for all calling, including the currently special Function.prototype.call
and Function.prototype.apply builtins, which had handwritten (and
not fully compliant) versions of CallFunctionStub, and also the
CallIC(s), which where also slightly different.
This also reduces the overhead for API function calls, which is still
unnecessary high, but let's do that step-by-step.
This also fixes a bunch of cases where the implicit ToObject for
sloppy receivers was done in the wrong context (in the caller
context instead of the callee context), which basically meant
that we allowed cross context access to %ObjectPrototype%.
MIPS and MIPS64 ports contributed by akos.palfi@imgtec.com.
R=mstarzinger@chromium.org, jarin@chromium.org, mvstanton@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_layout_dbg,v8_linux_nosnap_dbg
BUG=v8:4413
LOG=n
Committed: https://crrev.com/ef268a83be4dead004047c25b702319ea4be7277
Cr-Commit-Position: refs/heads/master@{#30627}
Review URL: https://codereview.chromium.org/1311013008
Cr-Commit-Position: refs/heads/master@{#30629}
2015-09-08 07:50:22 +00:00
|
|
|
V(kOperandIsASmiAndNotAFunction, "Operand is a smi and not a function") \
|
2016-04-06 08:37:09 +00:00
|
|
|
V(kOperandIsASmiAndNotAGeneratorObject, \
|
|
|
|
"Operand is a smi and not a generator object") \
|
2015-12-27 06:30:53 +00:00
|
|
|
V(kOperandIsNotABoundFunction, "Operand is not a bound function") \
|
2018-03-23 14:23:20 +00:00
|
|
|
V(kOperandIsNotAConstructor, "Operand is not a constructor") \
|
2017-06-08 18:31:59 +00:00
|
|
|
V(kOperandIsNotAFixedArray, "Operand is not a fixed array") \
|
[builtins] Unify the various versions of [[Call]] with a Call builtin.
The new Call and CallFunction builtins supersede the current
CallFunctionStub (and CallIC magic) and will be the single bottleneck
for all calling, including the currently special Function.prototype.call
and Function.prototype.apply builtins, which had handwritten (and
not fully compliant) versions of CallFunctionStub, and also the
CallIC(s), which where also slightly different.
This also reduces the overhead for API function calls, which is still
unnecessary high, but let's do that step-by-step.
This also fixes a bunch of cases where the implicit ToObject for
sloppy receivers was done in the wrong context (in the caller
context instead of the callee context), which basically meant
that we allowed cross context access to %ObjectPrototype%.
MIPS and MIPS64 ports contributed by akos.palfi@imgtec.com.
R=mstarzinger@chromium.org, jarin@chromium.org, mvstanton@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_layout_dbg,v8_linux_nosnap_dbg
BUG=v8:4413
LOG=n
Committed: https://crrev.com/ef268a83be4dead004047c25b702319ea4be7277
Cr-Commit-Position: refs/heads/master@{#30627}
Review URL: https://codereview.chromium.org/1311013008
Cr-Commit-Position: refs/heads/master@{#30629}
2015-09-08 07:50:22 +00:00
|
|
|
V(kOperandIsNotAFunction, "Operand is not a function") \
|
2016-04-06 08:37:09 +00:00
|
|
|
V(kOperandIsNotAGeneratorObject, "Operand is not a generator object") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kOperandIsNotASmi, "Operand is not a smi") \
|
|
|
|
V(kReceivedInvalidReturnAddress, "Received invalid return address") \
|
|
|
|
V(kRegisterDidNotMatchExpectedRoot, "Register did not match expected root") \
|
|
|
|
V(kRegisterWasClobbered, "Register was clobbered") \
|
|
|
|
V(kReturnAddressNotFoundInFrame, "Return address not found in frame") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kShouldNotDirectlyEnterOsrFunction, \
|
|
|
|
"Should not directly enter OSR-compiled function") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kStackAccessBelowStackPointer, "Stack access below stack pointer") \
|
|
|
|
V(kStackFrameTypesMustMatch, "Stack frame types must match") \
|
|
|
|
V(kTheStackWasCorruptedByMacroAssemblerCall, \
|
|
|
|
"The stack was corrupted by MacroAssembler::Call()") \
|
|
|
|
V(kUnalignedCellInWriteBarrier, "Unaligned cell in write barrier") \
|
|
|
|
V(kUnexpectedElementsKindInArrayConstructor, \
|
|
|
|
"Unexpected ElementsKind in array constructor") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kUnexpectedFPCRMode, "Unexpected FPCR mode.") \
|
|
|
|
V(kUnexpectedFunctionIDForInvokeIntrinsic, \
|
|
|
|
"Unexpected runtime function id for the InvokeIntrinsic bytecode") \
|
|
|
|
V(kUnexpectedInitialMapForArrayFunction, \
|
|
|
|
"Unexpected initial map for Array function") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kUnexpectedInitialMapForArrayFunction1, \
|
|
|
|
"Unexpected initial map for Array function (1)") \
|
|
|
|
V(kUnexpectedInitialMapForArrayFunction2, \
|
|
|
|
"Unexpected initial map for Array function (2)") \
|
|
|
|
V(kUnexpectedInitialMapForInternalArrayFunction, \
|
|
|
|
"Unexpected initial map for InternalArray function") \
|
|
|
|
V(kUnexpectedLevelAfterReturnFromApiCall, \
|
|
|
|
"Unexpected level after return from api call") \
|
|
|
|
V(kUnexpectedNegativeValue, "Unexpected negative value") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kUnexpectedReturnFromFrameDropper, \
|
|
|
|
"Unexpectedly returned from dropping frames") \
|
|
|
|
V(kUnexpectedReturnFromThrow, "Unexpectedly returned from a throw") \
|
|
|
|
V(kUnexpectedReturnFromWasmTrap, \
|
|
|
|
"Should not return after throwing a wasm trap") \
|
2015-10-02 18:13:41 +00:00
|
|
|
V(kUnexpectedStackPointer, "The stack pointer is not the expected value") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kUnexpectedValue, "Unexpected value") \
|
2016-11-08 11:01:03 +00:00
|
|
|
V(kUnsupportedModuleOperation, "Unsupported module operation") \
|
2014-09-24 07:08:27 +00:00
|
|
|
V(kUnsupportedNonPrimitiveCompare, "Unsupported non-primitive compare") \
|
|
|
|
V(kWrongAddressOrValuePassedToRecordWrite, \
|
|
|
|
"Wrong address or value passed to RecordWrite") \
|
2016-03-22 11:35:09 +00:00
|
|
|
V(kWrongArgumentCountForInvokeIntrinsic, \
|
|
|
|
"Wrong number of arguments for intrinsic") \
|
2018-02-02 12:18:02 +00:00
|
|
|
V(kWrongFunctionCodeStart, "Wrong value in code start register passed") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kWrongFunctionContext, "Wrong context passed to function")
|
|
|
|
|
|
|
|
#define BAILOUT_MESSAGES_LIST(V) \
|
|
|
|
V(kNoReason, "no reason") \
|
|
|
|
\
|
|
|
|
V(kBailedOutDueToDependencyChange, "Bailed out due to dependency change") \
|
|
|
|
V(kCodeGenerationFailed, "Code generation failed") \
|
|
|
|
V(kCyclicObjectStateDetectedInEscapeAnalysis, \
|
|
|
|
"Cyclic object state detected by escape analysis") \
|
|
|
|
V(kFunctionBeingDebugged, "Function is being debugged") \
|
|
|
|
V(kGraphBuildingFailed, "Optimized graph construction failed") \
|
2018-02-26 21:06:46 +00:00
|
|
|
V(kFunctionTooBig, "Function is too big to be optimized") \
|
2018-01-03 23:27:03 +00:00
|
|
|
V(kLiveEdit, "LiveEdit") \
|
|
|
|
V(kNativeFunctionLiteral, "Native function literal") \
|
|
|
|
V(kNotEnoughVirtualRegistersRegalloc, \
|
|
|
|
"Not enough virtual registers (regalloc)") \
|
|
|
|
V(kOptimizationDisabled, "Optimization disabled") \
|
|
|
|
V(kOptimizationDisabledForTest, "Optimization disabled for test")
|
2014-09-24 07:08:27 +00:00
|
|
|
|
|
|
|
#define ERROR_MESSAGES_CONSTANTS(C, T) C,
|
2018-01-03 23:27:03 +00:00
|
|
|
enum class BailoutReason {
|
|
|
|
BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class AbortReason {
|
|
|
|
ABORT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
|
2014-09-24 07:08:27 +00:00
|
|
|
};
|
|
|
|
#undef ERROR_MESSAGES_CONSTANTS
|
|
|
|
|
|
|
|
const char* GetBailoutReason(BailoutReason reason);
|
2018-01-03 23:27:03 +00:00
|
|
|
const char* GetAbortReason(AbortReason reason);
|
2015-02-27 08:03:57 +00:00
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
2014-09-24 07:08:27 +00:00
|
|
|
|
|
|
|
#endif // V8_BAILOUT_REASON_H_
|