2012-01-04 14:45:29 +00:00
|
|
|
// Copyright 2012 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2008-07-03 15:10:15 +00:00
|
|
|
|
|
|
|
#ifndef V8_CHECKS_H_
|
|
|
|
#define V8_CHECKS_H_
|
|
|
|
|
2015-01-30 09:29:25 +00:00
|
|
|
#include "include/v8.h"
|
2014-06-30 13:25:46 +00:00
|
|
|
#include "src/base/logging.h"
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2013-10-25 11:10:28 +00:00
|
|
|
namespace v8 {
|
2014-06-30 13:25:46 +00:00
|
|
|
|
|
|
|
class Value;
|
|
|
|
|
2013-10-25 11:10:28 +00:00
|
|
|
namespace internal {
|
2014-06-30 13:25:46 +00:00
|
|
|
|
2014-08-04 11:34:54 +00:00
|
|
|
#ifdef ENABLE_SLOW_DCHECKS
|
|
|
|
#define SLOW_DCHECK(condition) \
|
2013-10-25 11:10:28 +00:00
|
|
|
CHECK(!v8::internal::FLAG_enable_slow_asserts || (condition))
|
2011-10-13 11:54:19 +00:00
|
|
|
extern bool FLAG_enable_slow_asserts;
|
2013-10-25 11:10:28 +00:00
|
|
|
#else
|
2014-08-04 11:34:54 +00:00
|
|
|
#define SLOW_DCHECK(condition) ((void) 0)
|
2013-10-25 11:10:28 +00:00
|
|
|
const bool FLAG_enable_slow_asserts = false;
|
|
|
|
#endif
|
2014-03-17 13:33:19 +00:00
|
|
|
|
|
|
|
} } // namespace v8::internal
|
2010-11-05 13:33:40 +00:00
|
|
|
|
2015-01-30 09:29:25 +00:00
|
|
|
#define DCHECK_TAG_ALIGNED(address) \
|
|
|
|
DCHECK((reinterpret_cast<intptr_t>(address) & \
|
|
|
|
::v8::internal::kHeapObjectTagMask) == 0)
|
2010-11-05 13:33:40 +00:00
|
|
|
|
2015-01-30 09:29:25 +00:00
|
|
|
#define DCHECK_SIZE_TAG_ALIGNED(size) \
|
|
|
|
DCHECK((size & ::v8::internal::kHeapObjectTagMask) == 0)
|
2012-09-05 16:06:53 +00:00
|
|
|
|
2008-07-03 15:10:15 +00:00
|
|
|
#endif // V8_CHECKS_H_
|