v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
checks.h
Go to the documentation of this file.
1// Copyright 2012 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_COMMON_CHECKS_H_
6#define V8_COMMON_CHECKS_H_
7
9#include "src/base/logging.h"
10#include "src/common/globals.h"
11
12#ifdef ENABLE_SLOW_DCHECKS
13#include "src/flags/flags.h"
14#endif
15
16#ifdef ENABLE_SLOW_DCHECKS
17#define SLOW_DCHECK(condition) \
18 CHECK(!v8::internal::v8_flags.enable_slow_asserts.value() || (condition))
19#define SLOW_DCHECK_IMPLIES(lhs, rhs) SLOW_DCHECK(!(lhs) || (rhs))
20#else
21#define SLOW_DCHECK(condition) ((void)0)
22#define SLOW_DCHECK_IMPLIES(v1, v2) ((void)0)
23#endif
24
25#define DCHECK_TAG_ALIGNED(address) \
26 DCHECK((address & ::v8::internal::kHeapObjectTagMask) == 0)
27
28#define DCHECK_SIZE_TAG_ALIGNED(size) \
29 DCHECK((size & ::v8::internal::kHeapObjectTagMask) == 0)
30
31#endif // V8_COMMON_CHECKS_H_