V8 Project
v8::internal::HeapNumber Class Reference

#include <objects.h>

+ Inheritance diagram for v8::internal::HeapNumber:
+ Collaboration diagram for v8::internal::HeapNumber:

Public Member Functions

double value () const
 
void set_value (double value)
 
bool HeapNumberBooleanValue ()
 
void HeapNumberPrint (OStream &os)
 
int get_exponent ()
 
int get_sign ()
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Attributes

static const int kValueOffset = HeapObject::kHeaderSize
 
static const int kSize = kValueOffset + kDoubleSize
 
static const uint32_t kSignMask = 0x80000000u
 
static const uint32_t kExponentMask = 0x7ff00000u
 
static const uint32_t kMantissaMask = 0xfffffu
 
static const int kMantissaBits = 52
 
static const int kExponentBits = 11
 
static const int kExponentBias = 1023
 
static const int kExponentShift = 20
 
static const int kInfinityOrNanExponent
 
static const int kMantissaBitsInTopWord = 20
 
static const int kNonMantissaBitsInTopWord = 12
 
- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (HeapNumber)
 

Additional Inherited Members

- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 
- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 

Detailed Description

Definition at line 1488 of file objects.h.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::HeapNumber::DISALLOW_IMPLICIT_CONSTRUCTORS ( HeapNumber  )
private

◆ get_exponent()

int v8::internal::HeapNumber::get_exponent ( )
inline

Definition at line 1525 of file objects-inl.h.

1525  {
1526  return ((READ_INT_FIELD(this, kExponentOffset) & kExponentMask) >>
1528 }
static const uint32_t kExponentMask
Definition: objects.h:1523
static const int kExponentBias
Definition: objects.h:1527
static const int kExponentShift
Definition: objects.h:1528
#define READ_INT_FIELD(p, offset)
Definition: objects-inl.h:1260

References kExponentBias, kExponentMask, kExponentShift, and READ_INT_FIELD.

◆ get_sign()

int v8::internal::HeapNumber::get_sign ( )
inline

Definition at line 1531 of file objects-inl.h.

1531  {
1532  return READ_INT_FIELD(this, kExponentOffset) & kSignMask;
1533 }
static const uint32_t kSignMask
Definition: objects.h:1522

References kSignMask, and READ_INT_FIELD.

◆ HeapNumberBooleanValue()

bool v8::internal::HeapNumber::HeapNumberBooleanValue ( )

Definition at line 1666 of file objects.cc.

1666  {
1667  return DoubleToBoolean(value());
1668 }
bool DoubleToBoolean(double d)
Definition: utils.cc:397

◆ HeapNumberPrint()

void v8::internal::HeapNumber::HeapNumberPrint ( OStream os)

Definition at line 1671 of file objects.cc.

1671  { // NOLINT
1672  os << value();
1673 }

◆ set_value()

void v8::internal::HeapNumber::set_value ( double  value)
inline

Definition at line 1520 of file objects-inl.h.

1520  {
1522 }
static const int kValueOffset
Definition: objects.h:1506
#define WRITE_DOUBLE_FIELD(p, offset, value)
Definition: objects-inl.h:1240

References kValueOffset, value(), and WRITE_DOUBLE_FIELD.

Referenced by v8::internal::JSObject::WriteToField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ value()

double v8::internal::HeapNumber::value ( ) const
inline

Definition at line 1515 of file objects-inl.h.

1515  {
1516  return READ_DOUBLE_FIELD(this, kValueOffset);
1517 }
#define READ_DOUBLE_FIELD(p, offset)
Definition: objects-inl.h:1220

References kValueOffset, and READ_DOUBLE_FIELD.

Referenced by v8::internal::Object::Number(), v8::internal::RUNTIME_FUNCTION(), and set_value().

+ Here is the caller graph for this function:

Member Data Documentation

◆ kExponentBias

const int v8::internal::HeapNumber::kExponentBias = 1023
static

Definition at line 1527 of file objects.h.

Referenced by get_exponent().

◆ kExponentBits

const int v8::internal::HeapNumber::kExponentBits = 11
static

Definition at line 1526 of file objects.h.

◆ kExponentMask

const uint32_t v8::internal::HeapNumber::kExponentMask = 0x7ff00000u
static

Definition at line 1523 of file objects.h.

Referenced by get_exponent().

◆ kExponentShift

const int v8::internal::HeapNumber::kExponentShift = 20
static

Definition at line 1528 of file objects.h.

Referenced by get_exponent().

◆ kInfinityOrNanExponent

const int v8::internal::HeapNumber::kInfinityOrNanExponent
static
Initial value:

Definition at line 1529 of file objects.h.

◆ kMantissaBits

const int v8::internal::HeapNumber::kMantissaBits = 52
static

Definition at line 1525 of file objects.h.

◆ kMantissaBitsInTopWord

const int v8::internal::HeapNumber::kMantissaBitsInTopWord = 20
static

Definition at line 1531 of file objects.h.

◆ kMantissaMask

const uint32_t v8::internal::HeapNumber::kMantissaMask = 0xfffffu
static

Definition at line 1524 of file objects.h.

◆ kNonMantissaBitsInTopWord

const int v8::internal::HeapNumber::kNonMantissaBitsInTopWord = 12
static

Definition at line 1532 of file objects.h.

◆ kSignMask

const uint32_t v8::internal::HeapNumber::kSignMask = 0x80000000u
static

◆ kSize

◆ kValueOffset


The documentation for this class was generated from the following files: