chromium/v8/src/codegen/define-code-stub-assembler-macros.inc

// Copyright 2024 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.

// PRESUBMIT_INTENTIONALLY_MISSING_INCLUDE_GUARD

#ifdef V8_CODEGEN_CODE_STUB_ASSEMBLER_MACROS_DEFINED
#error \
    "Assembler macros already defined. Did you forget to #include \"src/codegen/undef-code-stub-assembler-macros.inc\" in a previous file?"
#endif

#define V8_CODEGEN_CODE_STUB_ASSEMBLER_MACROS_DEFINED

#ifdef DEBUG
#define CSA_CHECK
#else
#define CSA_CHECK
#endif

// This is a check that always calls into the runtime if it aborts.
// This also exits silently when --hole-fuzzing is enabled.
#define CSA_HOLE_SECURITY_CHECK

#ifdef DEBUG
// CSA_DCHECK_ARGS generates an
// std::initializer_list<CodeStubAssembler::ExtraNode> from __VA_ARGS__. It
// currently supports between 0 and 2 arguments.

#define CSA_DCHECK_0_ARGS
#define CSA_DCHECK_1_ARG
#define CSA_DCHECK_2_ARGS
#define SWITCH_CSA_DCHECK_ARGS
#define CSA_DCHECK_ARGS

// CSA_DCHECK(csa, <condition>, <extra values to print...>)

#define CSA_DCHECK

#define CSA_DCHECK_JS_ARGC_EQ

#define CSA_DEBUG_INFO
#define BIND
#define TYPED_VARIABLE_DEF
#define TYPED_VARIABLE_CONSTRUCTOR
#else  // DEBUG
#define CSA_DCHECK
#define CSA_DCHECK_JS_ARGC_EQ
#define BIND
#define TYPED_VARIABLE_DEF
#define TYPED_VARIABLE_CONSTRUCTOR
#endif  // DEBUG

#define TVARIABLE
#define TVARIABLE_CONSTRUCTOR

#ifdef ENABLE_SLOW_DCHECKS
#define CSA_SLOW_DCHECK
#else
#define CSA_SLOW_DCHECK
#endif

// Similar to SBXCHECK in C++, these become a CSA_CHECK in sandbox-enabled
// builds, otherwise a CSA_DCHECK.
#ifdef V8_ENABLE_SANDBOX
#define CSA_SBXCHECK
#else
#define CSA_SBXCHECK
#endif