V8 Project
v8::internal::ExternalReferenceEncoder Class Reference

#include <serialize.h>

+ Collaboration diagram for v8::internal::ExternalReferenceEncoder:

Public Member Functions

 ExternalReferenceEncoder (Isolate *isolate)
 
uint32_t Encode (Address key) const
 
const char * NameOfAddress (Address key) const
 

Private Member Functions

int IndexOf (Address key) const
 
void Put (Address key, int index)
 

Static Private Member Functions

static uint32_t Hash (Address key)
 

Private Attributes

HashMap encodings_
 
Isolateisolate_
 

Detailed Description

Definition at line 92 of file serialize.h.

Constructor & Destructor Documentation

◆ ExternalReferenceEncoder()

v8::internal::ExternalReferenceEncoder::ExternalReferenceEncoder ( Isolate isolate)
explicit

Definition at line 419 of file serialize.cc.

421  isolate_(isolate) {
422  ExternalReferenceTable* external_references =
424  for (int i = 0; i < external_references->size(); ++i) {
425  Put(external_references->address(i), i);
426  }
427 }
void Put(Address key, int index)
Definition: serialize.cc:455
static ExternalReferenceTable * instance(Isolate *isolate)
Definition: serialize.cc:48
static bool PointersMatch(void *key1, void *key2)
Definition: hashmap.h:80

References v8::internal::ExternalReferenceTable::address(), v8::internal::ExternalReferenceTable::instance(), isolate_, Put(), and v8::internal::ExternalReferenceTable::size().

+ Here is the call graph for this function:

Member Function Documentation

◆ Encode()

uint32_t v8::internal::ExternalReferenceEncoder::Encode ( Address  key) const

Definition at line 430 of file serialize.cc.

430  {
431  int index = IndexOf(key);
432  DCHECK(key == NULL || index >= 0);
433  return index >= 0 ?
435 }
int IndexOf(Address key) const
Definition: serialize.cc:445
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 NULL
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::ExternalReferenceTable::code(), DCHECK, IndexOf(), v8::internal::ExternalReferenceTable::instance(), isolate_, and NULL.

Referenced by v8::internal::Serializer::EncodeExternalReference().

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

◆ Hash()

static uint32_t v8::internal::ExternalReferenceEncoder::Hash ( Address  key)
inlinestaticprivate

Definition at line 102 of file serialize.h.

102  {
103  return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key) >> 2);
104  }

Referenced by IndexOf(), and Put().

+ Here is the caller graph for this function:

◆ IndexOf()

int v8::internal::ExternalReferenceEncoder::IndexOf ( Address  key) const
private

Definition at line 445 of file serialize.cc.

445  {
446  if (key == NULL) return -1;
447  HashMap::Entry* entry =
448  const_cast<HashMap&>(encodings_).Lookup(key, Hash(key), false);
449  return entry == NULL
450  ? -1
451  : static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
452 }
static uint32_t Hash(Address key)
Definition: serialize.h:102
TemplateHashMapImpl< FreeStoreAllocationPolicy > HashMap
Definition: hashmap.h:96

References encodings_, Hash(), and NULL.

Referenced by Encode(), and NameOfAddress().

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

◆ NameOfAddress()

const char * v8::internal::ExternalReferenceEncoder::NameOfAddress ( Address  key) const

Definition at line 438 of file serialize.cc.

438  {
439  int index = IndexOf(key);
440  return index >= 0 ? ExternalReferenceTable::instance(isolate_)->name(index)
441  : "<unknown>";
442 }

References IndexOf(), v8::internal::ExternalReferenceTable::instance(), isolate_, and v8::internal::ExternalReferenceTable::name().

+ Here is the call graph for this function:

◆ Put()

void v8::internal::ExternalReferenceEncoder::Put ( Address  key,
int  index 
)
private

Definition at line 455 of file serialize.cc.

455  {
456  HashMap::Entry* entry = encodings_.Lookup(key, Hash(key), true);
457  entry->value = reinterpret_cast<void*>(index);
458 }
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
Definition: hashmap.h:114

References encodings_, Hash(), and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup().

Referenced by ExternalReferenceEncoder().

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

Member Data Documentation

◆ encodings_

HashMap v8::internal::ExternalReferenceEncoder::encodings_
private

Definition at line 101 of file serialize.h.

Referenced by IndexOf(), and Put().

◆ isolate_

Isolate* v8::internal::ExternalReferenceEncoder::isolate_
private

Definition at line 110 of file serialize.h.

Referenced by Encode(), ExternalReferenceEncoder(), and NameOfAddress().


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