V8 Project
v8::internal::ExternalReferenceDecoder Class Reference

#include <serialize.h>

+ Collaboration diagram for v8::internal::ExternalReferenceDecoder:

Public Member Functions

 ExternalReferenceDecoder (Isolate *isolate)
 
 ~ExternalReferenceDecoder ()
 
Address Decode (uint32_t key) const
 

Private Member Functions

AddressLookup (uint32_t key) const
 
void Put (uint32_t key, Address value)
 

Private Attributes

Address ** encodings_
 
Isolateisolate_
 

Detailed Description

Definition at line 114 of file serialize.h.

Constructor & Destructor Documentation

◆ ExternalReferenceDecoder()

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

Definition at line 461 of file serialize.cc.

462  : encodings_(NewArray<Address*>(kTypeCodeCount)),
463  isolate_(isolate) {
464  ExternalReferenceTable* external_references =
466  for (int type = kFirstTypeCode; type < kTypeCodeCount; ++type) {
467  int max = external_references->max_id(type) + 1;
468  encodings_[type] = NewArray<Address>(max + 1);
469  }
470  for (int i = 0; i < external_references->size(); ++i) {
471  Put(external_references->code(i), external_references->address(i));
472  }
473 }
void Put(uint32_t key, Address value)
Definition: serialize.h:134
static ExternalReferenceTable * instance(Isolate *isolate)
Definition: serialize.cc:48
const int kTypeCodeCount
Definition: serialize.h:33
const int kFirstTypeCode
Definition: serialize.h:34

References v8::internal::ExternalReferenceTable::address(), v8::internal::ExternalReferenceTable::code(), encodings_, v8::internal::ExternalReferenceTable::instance(), isolate_, v8::internal::kFirstTypeCode, v8::internal::kTypeCodeCount, v8::internal::ExternalReferenceTable::max_id(), Put(), and v8::internal::ExternalReferenceTable::size().

+ Here is the call graph for this function:

◆ ~ExternalReferenceDecoder()

v8::internal::ExternalReferenceDecoder::~ExternalReferenceDecoder ( )

Definition at line 476 of file serialize.cc.

476  {
477  for (int type = kFirstTypeCode; type < kTypeCodeCount; ++type) {
478  DeleteArray(encodings_[type]);
479  }
481 }
void DeleteArray(T *array)
Definition: allocation.h:68

References v8::internal::DeleteArray(), encodings_, v8::internal::kFirstTypeCode, and v8::internal::kTypeCodeCount.

+ Here is the call graph for this function:

Member Function Documentation

◆ Decode()

Address v8::internal::ExternalReferenceDecoder::Decode ( uint32_t  key) const
inline

Definition at line 119 of file serialize.h.

119  {
120  if (key == 0) return NULL;
121  return *Lookup(key);
122  }
Address * Lookup(uint32_t key) const
Definition: serialize.h:127
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

References Lookup(), and NULL.

+ Here is the call graph for this function:

◆ Lookup()

Address* v8::internal::ExternalReferenceDecoder::Lookup ( uint32_t  key) const
inlineprivate

Definition at line 127 of file serialize.h.

127  {
128  int type = key >> kReferenceTypeShift;
129  DCHECK(kFirstTypeCode <= type && type < kTypeCodeCount);
130  int id = key & kReferenceIdMask;
131  return &encodings_[type][id];
132  }
#define DCHECK(condition)
Definition: logging.h:205
const int kReferenceTypeShift
Definition: serialize.h:38
const int kReferenceIdMask
Definition: serialize.h:37

References DCHECK, encodings_, v8::internal::kFirstTypeCode, v8::internal::kReferenceIdMask, v8::internal::kReferenceTypeShift, and v8::internal::kTypeCodeCount.

Referenced by Decode(), and Put().

+ Here is the caller graph for this function:

◆ Put()

void v8::internal::ExternalReferenceDecoder::Put ( uint32_t  key,
Address  value 
)
inlineprivate

Definition at line 134 of file serialize.h.

134  {
135  *Lookup(key) = value;
136  }

References Lookup().

Referenced by ExternalReferenceDecoder().

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

Member Data Documentation

◆ encodings_

Address** v8::internal::ExternalReferenceDecoder::encodings_
private

Definition at line 125 of file serialize.h.

Referenced by ExternalReferenceDecoder(), Lookup(), and ~ExternalReferenceDecoder().

◆ isolate_

Isolate* v8::internal::ExternalReferenceDecoder::isolate_
private

Definition at line 138 of file serialize.h.

Referenced by ExternalReferenceDecoder().


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