Commit c3ca8158 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[codegen] Optimize out calls to TurboAssembler::Assert*

In release builds, FLAG_debug_code is statically false. Without LTO,
this information is not available to callers of the various Assert
functions though.
This CL defines the methods as empty if V8_ENABLE_DEBUG_CODE is not set.
This removes some calls from non-LTO builds, and might even slightly
improve LTO builds if we enable more optimizations earlier in the
pipeline.

R=tebbi@chromium.org

Change-Id: I93a8f2f6322053e56f3d0fd8aae73cc3dd62d6ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3805887
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82255}
parent d69c7937
......@@ -2013,6 +2013,7 @@ void MacroAssembler::EmitDecrementCounter(StatsCounter* counter, int value,
}
}
#ifdef V8_ENABLE_DEBUG_CODE
void TurboAssembler::Assert(Condition cond, AbortReason reason) {
if (FLAG_debug_code) Check(cond, reason);
}
......@@ -2021,6 +2022,111 @@ void TurboAssembler::AssertUnreachable(AbortReason reason) {
if (FLAG_debug_code) Abort(reason);
}
void MacroAssembler::AssertNotSmi(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmi);
}
void MacroAssembler::AssertSmi(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(eq, AbortReason::kOperandIsNotASmi);
}
void MacroAssembler::AssertConstructor(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAConstructor);
push(object);
LoadMap(object, object);
ldrb(object, FieldMemOperand(object, Map::kBitFieldOffset));
tst(object, Operand(Map::Bits1::IsConstructorBit::kMask));
pop(object);
Check(ne, AbortReason::kOperandIsNotAConstructor);
}
void MacroAssembler::AssertFunction(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAFunction);
push(object);
LoadMap(object, object);
CompareInstanceTypeRange(object, object, FIRST_JS_FUNCTION_TYPE,
LAST_JS_FUNCTION_TYPE);
pop(object);
Check(ls, AbortReason::kOperandIsNotAFunction);
}
void MacroAssembler::AssertCallableFunction(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAFunction);
push(object);
LoadMap(object, object);
CompareInstanceTypeRange(object, object, FIRST_CALLABLE_JS_FUNCTION_TYPE,
LAST_CALLABLE_JS_FUNCTION_TYPE);
pop(object);
Check(ls, AbortReason::kOperandIsNotACallableFunction);
}
void MacroAssembler::AssertBoundFunction(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction);
push(object);
CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
pop(object);
Check(eq, AbortReason::kOperandIsNotABoundFunction);
}
void MacroAssembler::AssertGeneratorObject(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject);
// Load map
Register map = object;
push(object);
LoadMap(map, object);
// Check if JSGeneratorObject
Register instance_type = object;
CompareInstanceTypeRange(map, instance_type, FIRST_JS_GENERATOR_OBJECT_TYPE,
LAST_JS_GENERATOR_OBJECT_TYPE);
// Restore generator object to register and perform assertion
pop(object);
Check(ls, AbortReason::kOperandIsNotAGeneratorObject);
}
void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
Register scratch) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
Label done_checking;
AssertNotSmi(object);
CompareRoot(object, RootIndex::kUndefinedValue);
b(eq, &done_checking);
LoadMap(scratch, object);
CompareInstanceType(scratch, scratch, ALLOCATION_SITE_TYPE);
Assert(eq, AbortReason::kExpectedUndefinedOrCell);
bind(&done_checking);
}
#endif // V8_ENABLE_DEBUG_CODE
void TurboAssembler::Check(Condition cond, AbortReason reason) {
Label L;
b(cond, &L);
......@@ -2126,110 +2232,6 @@ void MacroAssembler::JumpIfNotSmi(Register value, Label* not_smi_label) {
b(ne, not_smi_label);
}
void MacroAssembler::AssertNotSmi(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmi);
}
void MacroAssembler::AssertSmi(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(eq, AbortReason::kOperandIsNotASmi);
}
void MacroAssembler::AssertConstructor(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAConstructor);
push(object);
LoadMap(object, object);
ldrb(object, FieldMemOperand(object, Map::kBitFieldOffset));
tst(object, Operand(Map::Bits1::IsConstructorBit::kMask));
pop(object);
Check(ne, AbortReason::kOperandIsNotAConstructor);
}
void MacroAssembler::AssertFunction(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAFunction);
push(object);
LoadMap(object, object);
CompareInstanceTypeRange(object, object, FIRST_JS_FUNCTION_TYPE,
LAST_JS_FUNCTION_TYPE);
pop(object);
Check(ls, AbortReason::kOperandIsNotAFunction);
}
void MacroAssembler::AssertCallableFunction(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAFunction);
push(object);
LoadMap(object, object);
CompareInstanceTypeRange(object, object, FIRST_CALLABLE_JS_FUNCTION_TYPE,
LAST_CALLABLE_JS_FUNCTION_TYPE);
pop(object);
Check(ls, AbortReason::kOperandIsNotACallableFunction);
}
void MacroAssembler::AssertBoundFunction(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
static_assert(kSmiTag == 0);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotABoundFunction);
push(object);
CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
pop(object);
Check(eq, AbortReason::kOperandIsNotABoundFunction);
}
void MacroAssembler::AssertGeneratorObject(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
tst(object, Operand(kSmiTagMask));
Check(ne, AbortReason::kOperandIsASmiAndNotAGeneratorObject);
// Load map
Register map = object;
push(object);
LoadMap(map, object);
// Check if JSGeneratorObject
Register instance_type = object;
CompareInstanceTypeRange(map, instance_type, FIRST_JS_GENERATOR_OBJECT_TYPE,
LAST_JS_GENERATOR_OBJECT_TYPE);
// Restore generator object to register and perform assertion
pop(object);
Check(ls, AbortReason::kOperandIsNotAGeneratorObject);
}
void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
Register scratch) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
Label done_checking;
AssertNotSmi(object);
CompareRoot(object, RootIndex::kUndefinedValue);
b(eq, &done_checking);
LoadMap(scratch, object);
CompareInstanceType(scratch, scratch, ALLOCATION_SITE_TYPE);
Assert(eq, AbortReason::kExpectedUndefinedOrCell);
bind(&done_checking);
}
void TurboAssembler::CheckFor32DRegs(Register scratch) {
ASM_CODE_COMMENT(this);
Move(scratch, ExternalReference::cpu_features());
......
......@@ -265,11 +265,11 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
// Calls Abort(msg) if the condition cond is not satisfied.
// Use --debug-code to enable.
void Assert(Condition cond, AbortReason reason);
void Assert(Condition cond, AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but without condition.
// Use --debug-code to enable.
void AssertUnreachable(AbortReason reason);
void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but always enabled.
void Check(Condition cond, AbortReason reason);
......@@ -831,30 +831,31 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
void JumpIfNotSmi(Register value, Label* not_smi_label);
// Abort execution if argument is a smi, enabled via --debug-code.
void AssertNotSmi(Register object);
void AssertSmi(Register object);
void AssertNotSmi(Register object) NOOP_UNLESS_DEBUG_CODE;
void AssertSmi(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a Constructor, enabled via --debug-code.
void AssertConstructor(Register object);
void AssertConstructor(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSFunction, enabled via --debug-code.
void AssertFunction(Register object);
void AssertFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a callable JSFunction, enabled via
// --debug-code.
void AssertCallableFunction(Register object);
void AssertCallableFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSBoundFunction,
// enabled via --debug-code.
void AssertBoundFunction(Register object);
void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSGeneratorObject (or subclass),
// enabled via --debug-code.
void AssertGeneratorObject(Register object);
void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not undefined or an AllocationSite, enabled
// via --debug-code.
void AssertUndefinedOrAllocationSite(Register object, Register scratch);
void AssertUndefinedOrAllocationSite(Register object,
Register scratch) NOOP_UNLESS_DEBUG_CODE;
template <typename Field>
void DecodeField(Register dst, Register src) {
......
This diff is collapsed.
......@@ -564,14 +564,15 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
// Calls Abort(msg) if the condition cond is not satisfied.
// Use --debug_code to enable.
void Assert(Condition cond, AbortReason reason);
void Assert(Condition cond, AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but without condition.
// Use --debug_code to enable.
void AssertUnreachable(AbortReason reason);
void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
void AssertSmi(Register object,
AbortReason reason = AbortReason::kOperandIsNotASmi);
AbortReason reason = AbortReason::kOperandIsNotASmi)
NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but always enabled.
void Check(Condition cond, AbortReason reason);
......@@ -694,7 +695,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
const VRegister& fm, Condition cond);
// Emits a runtime assert that the stack pointer is aligned.
void AssertSpAligned();
void AssertSpAligned() NOOP_UNLESS_DEBUG_CODE;
// Copy slot_count stack slots from the stack offset specified by src to
// the stack offset specified by dst. The offsets and count are expressed in
......@@ -778,7 +779,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
// Abort execution if argument is not a positive or zero integer, enabled via
// --debug-code.
void AssertPositiveOrZero(Register value);
void AssertPositiveOrZero(Register value) NOOP_UNLESS_DEBUG_CODE;
#define DECLARE_FUNCTION(FN, REGTYPE, REG, OP) \
inline void FN(const REGTYPE REG, const MemOperand& addr);
......@@ -1141,7 +1142,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
ucvtf(vd, vn, fbits);
}
void AssertFPCRState(Register fpcr = NoReg);
void AssertFPCRState(Register fpcr = NoReg) NOOP_UNLESS_DEBUG_CODE;
void CanonicalizeNaN(const VRegister& dst, const VRegister& src);
void CanonicalizeNaN(const VRegister& reg) { CanonicalizeNaN(reg, reg); }
......@@ -1849,32 +1850,33 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
// Abort execution if argument is a smi, enabled via --debug-code.
void AssertNotSmi(Register object,
AbortReason reason = AbortReason::kOperandIsASmi);
AbortReason reason = AbortReason::kOperandIsASmi)
NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a CodeT, enabled via --debug-code.
void AssertCodeT(Register object);
void AssertCodeT(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a Constructor, enabled via --debug-code.
void AssertConstructor(Register object);
void AssertConstructor(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSFunction, enabled via --debug-code.
void AssertFunction(Register object);
void AssertFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a callable JSFunction, enabled via
// --debug-code.
void AssertCallableFunction(Register object);
void AssertCallableFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSGeneratorObject (or subclass),
// enabled via --debug-code.
void AssertGeneratorObject(Register object);
void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSBoundFunction,
// enabled via --debug-code.
void AssertBoundFunction(Register object);
void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not undefined or an AllocationSite, enabled
// via --debug-code.
void AssertUndefinedOrAllocationSite(Register object);
void AssertUndefinedOrAllocationSite(Register object) NOOP_UNLESS_DEBUG_CODE;
// ---- Calling / Jumping helpers ----
......
......@@ -477,6 +477,17 @@ class V8_EXPORT_PRIVATE V8_NODISCARD CpuFeatureScope {
#define ASM_CODE_COMMENT_STRING(asm, ...)
#endif
// Use this macro to mark functions that are only defined if
// V8_ENABLE_DEBUG_CODE is set, and are a no-op otherwise.
// Use like:
// void AssertMyCondition() NOOP_UNLESS_DEBUG_CODE;
#ifdef V8_ENABLE_DEBUG_CODE
#define NOOP_UNLESS_DEBUG_CODE
#else
#define NOOP_UNLESS_DEBUG_CODE \
{ static_assert(FLAG_debug_code.value() == false); }
#endif
} // namespace internal
} // namespace v8
#endif // V8_CODEGEN_ASSEMBLER_H_
......@@ -721,6 +721,7 @@ Immediate MacroAssembler::ClearedValue() const {
static_cast<int32_t>(HeapObjectReference::ClearedValue(isolate()).ptr()));
}
#ifdef V8_ENABLE_DEBUG_CODE
void MacroAssembler::AssertSmi(Register object) {
if (FLAG_debug_code) {
ASM_CODE_COMMENT(this);
......@@ -829,6 +830,15 @@ void MacroAssembler::AssertNotSmi(Register object) {
}
}
void TurboAssembler::Assert(Condition cc, AbortReason reason) {
if (FLAG_debug_code) Check(cc, reason);
}
void TurboAssembler::AssertUnreachable(AbortReason reason) {
if (FLAG_debug_code) Abort(reason);
}
#endif // V8_ENABLE_DEBUG_CODE
void TurboAssembler::StubPrologue(StackFrame::Type type) {
ASM_CODE_COMMENT(this);
push(ebp); // Caller's frame pointer.
......@@ -1686,14 +1696,6 @@ void MacroAssembler::EmitDecrementCounter(StatsCounter* counter, int value,
}
}
void TurboAssembler::Assert(Condition cc, AbortReason reason) {
if (FLAG_debug_code) Check(cc, reason);
}
void TurboAssembler::AssertUnreachable(AbortReason reason) {
if (FLAG_debug_code) Abort(reason);
}
void TurboAssembler::Check(Condition cc, AbortReason reason) {
Label L;
j(cc, &L);
......
......@@ -107,11 +107,11 @@ class V8_EXPORT_PRIVATE TurboAssembler
// Calls Abort(msg) if the condition cc is not satisfied.
// Use --debug_code to enable.
void Assert(Condition cc, AbortReason reason);
void Assert(Condition cc, AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but without condition.
// Use --debug_code to enable.
void AssertUnreachable(AbortReason reason);
void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but always enabled.
void Check(Condition cc, AbortReason reason);
......@@ -554,32 +554,34 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
Immediate ClearedValue() const;
// Abort execution if argument is not a smi, enabled via --debug-code.
void AssertSmi(Register object);
void AssertSmi(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is a smi, enabled via --debug-code.
void AssertNotSmi(Register object);
void AssertNotSmi(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSFunction, enabled via --debug-code.
void AssertFunction(Register object, Register scratch);
void AssertFunction(Register object, Register scratch) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a callable JSFunction, enabled via
// --debug-code.
void AssertCallableFunction(Register object, Register scratch);
void AssertCallableFunction(Register object,
Register scratch) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a Constructor, enabled via --debug-code.
void AssertConstructor(Register object);
void AssertConstructor(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSBoundFunction,
// enabled via --debug-code.
void AssertBoundFunction(Register object);
void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSGeneratorObject (or subclass),
// enabled via --debug-code.
void AssertGeneratorObject(Register object);
void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not undefined or an AllocationSite, enabled
// via --debug-code.
void AssertUndefinedOrAllocationSite(Register object, Register scratch);
void AssertUndefinedOrAllocationSite(Register object,
Register scratch) NOOP_UNLESS_DEBUG_CODE;
// ---------------------------------------------------------------------------
// Exception handling
......
......@@ -668,14 +668,6 @@ void MacroAssembler::RecordWrite(Register object, Register slot_address,
}
}
void TurboAssembler::Assert(Condition cc, AbortReason reason) {
if (FLAG_debug_code) Check(cc, reason);
}
void TurboAssembler::AssertUnreachable(AbortReason reason) {
if (FLAG_debug_code) Abort(reason);
}
void TurboAssembler::Check(Condition cc, AbortReason reason) {
Label L;
j(cc, &L, Label::kNear);
......@@ -2459,6 +2451,7 @@ Immediate MacroAssembler::ClearedValue() const {
static_cast<int32_t>(HeapObjectReference::ClearedValue(isolate()).ptr()));
}
#ifdef V8_ENABLE_DEBUG_CODE
void TurboAssembler::AssertNotSmi(Register object) {
if (!FLAG_debug_code) return;
ASM_CODE_COMMENT(this);
......@@ -2586,6 +2579,15 @@ void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) {
bind(&done_checking);
}
void TurboAssembler::Assert(Condition cc, AbortReason reason) {
if (FLAG_debug_code) Check(cc, reason);
}
void TurboAssembler::AssertUnreachable(AbortReason reason) {
if (FLAG_debug_code) Abort(reason);
}
#endif // V8_ENABLE_DEBUG_CODE
void MacroAssembler::LoadWeakValue(Register in_out, Label* target_if_cleared) {
cmpl(in_out, Immediate(kClearedWeakHeapObjectLower32));
j(equal, target_if_cleared);
......
......@@ -228,11 +228,11 @@ class V8_EXPORT_PRIVATE TurboAssembler
Condition CheckSmi(Operand src);
// Abort execution if argument is a smi, enabled via --debug-code.
void AssertNotSmi(Register object);
void AssertNotSmi(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a smi, enabled via --debug-code.
void AssertSmi(Register object);
void AssertSmi(Operand object);
void AssertSmi(Register object) NOOP_UNLESS_DEBUG_CODE;
void AssertSmi(Operand object) NOOP_UNLESS_DEBUG_CODE;
// Test-and-jump functions. Typically combines a check function
// above with a conditional jump.
......@@ -457,15 +457,15 @@ class V8_EXPORT_PRIVATE TurboAssembler
// Calls Abort(msg) if the condition cc is not satisfied.
// Use --debug_code to enable.
void Assert(Condition cc, AbortReason reason);
void Assert(Condition cc, AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but without condition.
// Use --debug_code to enable.
void AssertUnreachable(AbortReason reason);
void AssertUnreachable(AbortReason reason) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if a 64 bit register containing a 32 bit payload does not
// have zeros in the top 32 bits, enabled via --debug-code.
void AssertZeroExtended(Register reg);
void AssertZeroExtended(Register reg) NOOP_UNLESS_DEBUG_CODE;
// Like Assert(), but always enabled.
void Check(Condition cc, AbortReason reason);
......@@ -829,29 +829,29 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
Immediate ClearedValue() const;
// Abort execution if argument is not a CodeT, enabled via --debug-code.
void AssertCodeT(Register object);
void AssertCodeT(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a Constructor, enabled via --debug-code.
void AssertConstructor(Register object);
void AssertConstructor(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSFunction, enabled via --debug-code.
void AssertFunction(Register object);
void AssertFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a callable JSFunction, enabled via
// --debug-code.
void AssertCallableFunction(Register object);
void AssertCallableFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSBoundFunction,
// enabled via --debug-code.
void AssertBoundFunction(Register object);
void AssertBoundFunction(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not a JSGeneratorObject (or subclass),
// enabled via --debug-code.
void AssertGeneratorObject(Register object);
void AssertGeneratorObject(Register object) NOOP_UNLESS_DEBUG_CODE;
// Abort execution if argument is not undefined or an AllocationSite, enabled
// via --debug-code.
void AssertUndefinedOrAllocationSite(Register object);
void AssertUndefinedOrAllocationSite(Register object) NOOP_UNLESS_DEBUG_CODE;
// ---------------------------------------------------------------------------
// Exception handling
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment