v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
heap-number.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_H_
6#define V8_OBJECTS_HEAP_NUMBER_H_
7
10
11// Has to be the last include (doesn't have include guards):
13
14namespace v8 {
15namespace internal {
16
17namespace maglev {
18class MaglevGraphBuilder;
19} // namespace maglev
20
21namespace compiler {
22class GraphAssembler;
23class JSContextSpecialization;
24} // namespace compiler
25
26// The HeapNumber class describes heap allocated numbers that cannot be
27// represented in a Smi (small integer).
29 public:
30 inline double value() const;
31 inline void set_value(double value);
32
33 inline uint64_t value_as_bits() const;
34 inline void set_value_as_bits(uint64_t bits);
35
36 static const uint32_t kSignMask = 0x80000000u;
37 static const uint32_t kExponentMask = 0x7ff00000u;
38 static const uint32_t kMantissaMask = 0xfffffu;
39 static const int kMantissaBits = 52;
40 static const int kExponentBits = 11;
41 static const int kExponentBias = 1023;
42 static const int kExponentShift = 20;
43 static const int kInfinityOrNanExponent =
45 static const int kMantissaBitsInTopWord = 20;
46 static const int kNonMantissaBitsInTopWord = 12;
47
50 V8_EXPORT_PRIVATE void HeapNumberShortPrint(std::ostream& os);
51
52 class BodyDescriptor;
53
54 private:
55 friend struct OffsetsForDebug;
56 friend class CodeStubAssembler;
57 friend class AccessorAssembler;
65
68
69} // namespace internal
70} // namespace v8
71
73
74#endif // V8_OBJECTS_HEAP_NUMBER_H_
void set_value_as_bits(uint64_t bits)
friend struct OffsetsForDebug
Definition heap-number.h:55
static const int kInfinityOrNanExponent
Definition heap-number.h:43
static const int kMantissaBits
Definition heap-number.h:39
friend class TorqueGeneratedHeapNumberAsserts
Definition heap-number.h:63
static const uint32_t kSignMask
Definition heap-number.h:36
V8_EXPORT_PRIVATE void HeapNumberShortPrint(std::ostream &os)
static const uint32_t kMantissaMask
Definition heap-number.h:38
static const uint32_t kExponentMask
Definition heap-number.h:37
static const int kMantissaBitsInTopWord
Definition heap-number.h:45
uint64_t value_as_bits() const
UnalignedDoubleMember value_
Definition heap-number.h:66
static const int kExponentBits
Definition heap-number.h:40
static const int kExponentBias
Definition heap-number.h:41
static const int kExponentShift
Definition heap-number.h:42
void set_value(double value)
static const int kNonMantissaBitsInTopWord
Definition heap-number.h:46
static AllocationAlignment RequiredAlignment(Tagged< Map > map)
v8::internal::LoadHandler V8_OBJECT_END
#define DECL_VERIFIER(Name)
#define V8_OBJECT
#define DECL_PRINTER(Name)
#define V8_EXPORT_PRIVATE
Definition macros.h:460