V8 Project
v8::internal::ByteArray Class Reference

#include <objects.h>

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

Public Member Functions

int Size ()
 
byte get (int index)
 
void set (int index, byte value)
 
int get_int (int index)
 
Address GetDataStartAddress ()
 
int ByteArraySize ()
 
- 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 int SizeFor (int length)
 
static int LengthFor (int size_in_bytes)
 
static ByteArrayFromDataStartAddress (Address address)
 
- 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 kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize)
 
static const int kMaxSize = 512 * MB
 
static const int kMaxLength = kMaxSize - kHeaderSize
 
- 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 (ByteArray)
 

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

Member Function Documentation

◆ ByteArraySize()

int v8::internal::ByteArray::ByteArraySize ( )
inline

Definition at line 4382 of file objects.h.

4382  {
4383  return SizeFor(this->length());
4384  }
static int SizeFor(int length)
Definition: objects.h:4360

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::ByteArray::DISALLOW_IMPLICIT_CONSTRUCTORS ( ByteArray  )
private

◆ FromDataStartAddress()

ByteArray * v8::internal::ByteArray::FromDataStartAddress ( Address  address)
inlinestatic

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

3788  {
3790  return reinterpret_cast<ByteArray*>(address - kHeaderSize + kHeapObjectTag);
3791 }
#define DCHECK_TAG_ALIGNED(address)
Definition: checks.h:57
static const int kHeaderSize
Definition: objects.h:2393
const int kHeapObjectTag
Definition: v8.h:5737

References v8::internal::HeapObject::address(), DCHECK_TAG_ALIGNED, v8::internal::FixedArrayBase::kHeaderSize, and v8::internal::kHeapObjectTag.

+ Here is the call graph for this function:

◆ get()

byte v8::internal::ByteArray::get ( int  index)
inline

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

3770  {
3771  DCHECK(index >= 0 && index < this->length());
3772  return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
3773 }
#define DCHECK(condition)
Definition: logging.h:205
const int kCharSize
Definition: globals.h:122
#define READ_BYTE_FIELD(p, offset)
Definition: objects-inl.h:1296

References DCHECK, v8::internal::kCharSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::FixedArrayBase::length(), and READ_BYTE_FIELD.

+ Here is the call graph for this function:

◆ get_int()

int v8::internal::ByteArray::get_int ( int  index)
inline

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

3782  {
3783  DCHECK(index >= 0 && (index * kIntSize) < this->length());
3784  return READ_INT_FIELD(this, kHeaderSize + index * kIntSize);
3785 }
const int kIntSize
Definition: globals.h:124
#define READ_INT_FIELD(p, offset)
Definition: objects-inl.h:1260

References DCHECK, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::kIntSize, v8::internal::FixedArrayBase::length(), and READ_INT_FIELD.

+ Here is the call graph for this function:

◆ GetDataStartAddress()

Address v8::internal::ByteArray::GetDataStartAddress ( )
inline

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

3794  {
3795  return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize;
3796 }
byte * Address
Definition: globals.h:101

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

Referenced by v8::internal::IsCodeEquivalent(), and v8::internal::Code::relocation_start().

+ Here is the caller graph for this function:

◆ LengthFor()

static int v8::internal::ByteArray::LengthFor ( int  size_in_bytes)
inlinestatic

Definition at line 4367 of file objects.h.

4367  {
4368  DCHECK(IsAligned(size_in_bytes, kPointerSize));
4369  DCHECK(size_in_bytes >= kHeaderSize);
4370  return size_in_bytes - kHeaderSize;
4371  }
const int kPointerSize
Definition: globals.h:129
bool IsAligned(T value, U alignment)
Definition: utils.h:123

References DCHECK, v8::internal::IsAligned(), v8::internal::Object::kHeaderSize, and v8::internal::kPointerSize.

+ Here is the call graph for this function:

◆ set()

void v8::internal::ByteArray::set ( int  index,
byte  value 
)
inline

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

3776  {
3777  DCHECK(index >= 0 && index < this->length());
3778  WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value);
3779 }
#define WRITE_BYTE_FIELD(p, offset, value)
Definition: objects-inl.h:1303

References DCHECK, v8::internal::kCharSize, v8::internal::FixedArrayBase::kHeaderSize, v8::internal::FixedArrayBase::length(), and WRITE_BYTE_FIELD.

+ Here is the call graph for this function:

◆ Size()

int v8::internal::ByteArray::Size ( )
inline

Definition at line 4351 of file objects.h.

4351 { return RoundUp(length() + kHeaderSize, kPointerSize); }
static void RoundUp(Vector< char > buffer, int *length, int *decimal_point)
Definition: fixed-dtoa.cc:171

References v8::internal::Object::kHeaderSize, v8::internal::kPointerSize, and v8::internal::RoundUp().

+ Here is the call graph for this function:

◆ SizeFor()

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

Definition at line 4360 of file objects.h.

4360  {
4362  }
#define OBJECT_POINTER_ALIGN(value)
Definition: globals.h:578

References v8::internal::Object::kHeaderSize, and OBJECT_POINTER_ALIGN.

Referenced by v8::internal::Heap::AllocateByteArray().

+ Here is the caller graph for this function:

Member Data Documentation

◆ kAlignedSize

const int v8::internal::ByteArray::kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize)
static

Definition at line 4389 of file objects.h.

◆ kMaxLength

const int v8::internal::ByteArray::kMaxLength = kMaxSize - kHeaderSize
static

Definition at line 4394 of file objects.h.

Referenced by v8::internal::Heap::AllocateByteArray().

◆ kMaxSize

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

Definition at line 4392 of file objects.h.


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