V8 Project
v8::internal::FixedDoubleArray Class Reference

#include <objects.h>

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

Public Member Functions

double get_scalar (int index)
 
int64_t get_representation (int index)
 
void set (int index, double value)
 
void set_the_hole (int index)
 
bool is_the_hole (int index)
 
double * data_start ()
 
void FillWithHoles (int from, int to)
 
- Public Member Functions inherited from v8::internal::FixedArrayBase
int length () const
 
void set_length (int value)
 
int synchronized_length () const
 
void synchronized_set_length (int value)
 
- 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 Member Functions

static Handle< Objectget (Handle< FixedDoubleArray > array, int index)
 
static int SizeFor (int length)
 
static int OffsetOfElementAt (int index)
 
static bool is_the_hole_nan (double value)
 
static double hole_nan_as_double ()
 
static double canonical_not_the_hole_nan_as_double ()
 
- 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)
 

Static Public Attributes

static const int kMaxSize = 512 * MB
 
static const int kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize
 
- Static Public Attributes inherited from v8::internal::FixedArrayBase
static const int kLengthOffset = HeapObject::kHeaderSize
 
static const int kHeaderSize = kLengthOffset + kPointerSize
 
- 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 (FixedDoubleArray)
 

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 }
 
- 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 2518 of file objects.h.

Member Function Documentation

◆ canonical_not_the_hole_nan_as_double()

double v8::internal::FixedDoubleArray::canonical_not_the_hole_nan_as_double ( )
inlinestatic

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

2210  {
2211  DCHECK(bit_cast<uint64_t>(base::OS::nan_value()) != kHoleNanInt64);
2212  DCHECK((bit_cast<uint64_t>(base::OS::nan_value()) >> 32) != kHoleNanUpper32);
2213  return base::OS::nan_value();
2214 }
static double nan_value()
#define DCHECK(condition)
Definition: logging.h:205
const uint64_t kHoleNanInt64
Definition: globals.h:660
const uint32_t kHoleNanUpper32
Definition: globals.h:656

References DCHECK, v8::internal::kHoleNanInt64, v8::internal::kHoleNanUpper32, and v8::base::OS::nan_value().

Referenced by set().

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

◆ data_start()

double * v8::internal::FixedDoubleArray::data_start ( )
inline

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

2267  {
2268  return reinterpret_cast<double*>(FIELD_ADDR(this, kHeaderSize));
2269 }
static const int kHeaderSize
Definition: objects.h:2393
#define FIELD_ADDR(p, offset)
Definition: objects-inl.h:1173

References FIELD_ADDR, and v8::internal::FixedArrayBase::kHeaderSize.

Referenced by v8::internal::MoveDoubleElements().

+ Here is the caller graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::FixedDoubleArray::DISALLOW_IMPLICIT_CONSTRUCTORS ( FixedDoubleArray  )
private

◆ FillWithHoles()

void v8::internal::FixedDoubleArray::FillWithHoles ( int  from,
int  to 
)
inline

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

2272  {
2273  for (int i = from; i < to; i++) {
2274  set_the_hole(i);
2275  }
2276 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file

References set_the_hole(), and to().

+ Here is the call graph for this function:

◆ get()

Handle< Object > v8::internal::FixedDoubleArray::get ( Handle< FixedDoubleArray array,
int  index 
)
inlinestatic

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

2235  {
2236  if (array->is_the_hole(index)) {
2237  return array->GetIsolate()->factory()->the_hole_value();
2238  } else {
2239  return array->GetIsolate()->factory()->NewNumber(array->get_scalar(index));
2240  }
2241 }

Referenced by v8::internal::CopyDoubleToObjectElements().

+ Here is the caller graph for this function:

◆ get_representation()

int64_t v8::internal::FixedDoubleArray::get_representation ( int  index)
inline

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

2226  {
2227  DCHECK(map() != GetHeap()->fixed_cow_array_map() &&
2228  map() != GetHeap()->fixed_array_map());
2229  DCHECK(index >= 0 && index < this->length());
2230  return READ_INT64_FIELD(this, kHeaderSize + index * kDoubleSize);
2231 }
Heap * GetHeap() const
Definition: objects-inl.h:1379
const int kDoubleSize
Definition: globals.h:127
#define READ_INT64_FIELD(p, offset)
Definition: objects-inl.h:1284

References DCHECK, v8::internal::HeapObject::GetHeap(), v8::internal::kDoubleSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::FixedArrayBase::length(), v8::internal::HeapObject::map(), and READ_INT64_FIELD.

+ Here is the call graph for this function:

◆ get_scalar()

double v8::internal::FixedDoubleArray::get_scalar ( int  index)
inline

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

2217  {
2218  DCHECK(map() != GetHeap()->fixed_cow_array_map() &&
2219  map() != GetHeap()->fixed_array_map());
2220  DCHECK(index >= 0 && index < this->length());
2221  double result = READ_DOUBLE_FIELD(this, kHeaderSize + index * kDoubleSize);
2222  DCHECK(!is_the_hole_nan(result));
2223  return result;
2224 }
static bool is_the_hole_nan(double value)
Definition: objects-inl.h:2200
#define READ_DOUBLE_FIELD(p, offset)
Definition: objects-inl.h:1220

References DCHECK, v8::internal::HeapObject::GetHeap(), is_the_hole_nan(), v8::internal::kDoubleSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::FixedArrayBase::length(), v8::internal::HeapObject::map(), and READ_DOUBLE_FIELD.

Referenced by v8::internal::JSObject::PrepareElementsForSort(), and v8::internal::RUNTIME_FUNCTION().

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

◆ hole_nan_as_double()

double v8::internal::FixedDoubleArray::hole_nan_as_double ( )
inlinestatic

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

2205  {
2206  return bit_cast<double, uint64_t>(kHoleNanInt64);
2207 }

References v8::internal::kHoleNanInt64.

Referenced by set_the_hole(), and v8::internal::HOptimizedGraphBuilder::TryInlineBuiltinMethodCall().

+ Here is the caller graph for this function:

◆ is_the_hole()

bool v8::internal::FixedDoubleArray::is_the_hole ( int  index)
inline

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

2261  {
2262  int offset = kHeaderSize + index * kDoubleSize;
2263  return is_the_hole_nan(READ_DOUBLE_FIELD(this, offset));
2264 }

References is_the_hole_nan(), v8::internal::kDoubleSize, v8::internal::FixedArrayBase::kHeaderSize, and READ_DOUBLE_FIELD.

Referenced by v8::internal::JSObject::GetElementsCapacityAndUsage(), v8::internal::JSObject::PrepareElementsForSort(), and v8::internal::RUNTIME_FUNCTION().

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

◆ is_the_hole_nan()

bool v8::internal::FixedDoubleArray::is_the_hole_nan ( double  value)
inlinestatic

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

2200  {
2201  return bit_cast<uint64_t, double>(value) == kHoleNanInt64;
2202 }

References v8::internal::kHoleNanInt64.

Referenced by get_scalar(), is_the_hole(), v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsSpecialDouble(), and v8::internal::FINAL< kOperandKind, kNumCachedOperands >::IsTheHole().

+ Here is the caller graph for this function:

◆ OffsetOfElementAt()

static int v8::internal::FixedDoubleArray::OffsetOfElementAt ( int  index)
inlinestatic

Definition at line 2541 of file objects.h.

2541 { return SizeFor(index); }
static int SizeFor(int length)
Definition: objects.h:2531

◆ set()

void v8::internal::FixedDoubleArray::set ( int  index,
double  value 
)
inline

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

2244  {
2245  DCHECK(map() != GetHeap()->fixed_cow_array_map() &&
2246  map() != GetHeap()->fixed_array_map());
2247  int offset = kHeaderSize + index * kDoubleSize;
2248  if (std::isnan(value)) value = canonical_not_the_hole_nan_as_double();
2249  WRITE_DOUBLE_FIELD(this, offset, value);
2250 }
static double canonical_not_the_hole_nan_as_double()
Definition: objects-inl.h:2210
#define WRITE_DOUBLE_FIELD(p, offset, value)
Definition: objects-inl.h:1240

References canonical_not_the_hole_nan_as_double(), DCHECK, v8::internal::HeapObject::GetHeap(), v8::internal::kDoubleSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::HeapObject::map(), and WRITE_DOUBLE_FIELD.

Referenced by v8::internal::JSObject::PrepareElementsForSort(), and v8::internal::RUNTIME_FUNCTION().

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

◆ set_the_hole()

void v8::internal::FixedDoubleArray::set_the_hole ( int  index)
inline

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

2253  {
2254  DCHECK(map() != GetHeap()->fixed_cow_array_map() &&
2255  map() != GetHeap()->fixed_array_map());
2256  int offset = kHeaderSize + index * kDoubleSize;
2257  WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double());
2258 }
static double hole_nan_as_double()
Definition: objects-inl.h:2205

References DCHECK, v8::internal::HeapObject::GetHeap(), hole_nan_as_double(), v8::internal::kDoubleSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::HeapObject::map(), and WRITE_DOUBLE_FIELD.

Referenced by FillWithHoles(), and v8::internal::JSObject::PrepareElementsForSort().

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

◆ SizeFor()

static int v8::internal::FixedDoubleArray::SizeFor ( int  length)
inlinestatic

Member Data Documentation

◆ kMaxLength

const int v8::internal::FixedDoubleArray::kMaxLength = (kMaxSize - kHeaderSize) / kDoubleSize
static

◆ kMaxSize

const int v8::internal::FixedDoubleArray::kMaxSize = 512 * MB
static

Definition at line 2552 of file objects.h.


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