v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
heap-number-inl.h
Go to the documentation of this file.
1// Copyright 2018 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_OBJECTS_HEAP_NUMBER_INL_H_
6#define V8_OBJECTS_HEAP_NUMBER_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
11#include "src/base/memory.h"
13
14// Has to be the last include (doesn't have include guards):
16
17namespace v8 {
18namespace internal {
19
20double HeapNumber::value() const { return value_.value(); }
21void HeapNumber::set_value(double value) {
22#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
23 // TODO(nicohartmann): Turn into DCHECK.
24 CHECK(!IsUndefinedNan(value));
25#endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
26 value_.set_value(value);
27}
28
29uint64_t HeapNumber::value_as_bits() const { return value_.value_as_bits(); }
30
31void HeapNumber::set_value_as_bits(uint64_t bits) {
32#ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
33 // TODO(nicohartmann): Turn into DCHECK.
34 CHECK_NE(bits, kUndefinedNanInt64);
35#endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
37}
38
39} // namespace internal
40} // namespace v8
41
43
44#endif // V8_OBJECTS_HEAP_NUMBER_INL_H_
void set_value_as_bits(uint64_t bits)
uint64_t value_as_bits() const
UnalignedDoubleMember value_
Definition heap-number.h:66
void set_value(double value)
void set_value_as_bits(uint64_t value)
#define CHECK(condition)
Definition logging.h:124
#define CHECK_NE(lhs, rhs)