V8 Project
v8::internal::DescriptorLookupCache Class Reference

#include <heap.h>

+ Collaboration diagram for v8::internal::DescriptorLookupCache:

Classes

struct  Key
 

Public Member Functions

int Lookup (Map *source, Name *name)
 
void Update (Map *source, Name *name, int result)
 
void Clear ()
 

Static Public Attributes

static const int kAbsent = -2
 

Private Member Functions

 DescriptorLookupCache ()
 
 DISALLOW_COPY_AND_ASSIGN (DescriptorLookupCache)
 

Static Private Member Functions

static int Hash (Object *source, Name *name)
 

Private Attributes

Key keys_ [kLength]
 
int results_ [kLength]
 

Static Private Attributes

static const int kLength = 64
 

Friends

class Isolate
 

Detailed Description

Definition at line 2303 of file heap.h.

Constructor & Destructor Documentation

◆ DescriptorLookupCache()

v8::internal::DescriptorLookupCache::DescriptorLookupCache ( )
inlineprivate

Definition at line 2333 of file heap.h.

2333  {
2334  for (int i = 0; i < kLength; ++i) {
2335  keys_[i].source = NULL;
2336  keys_[i].name = NULL;
2337  results_[i] = kAbsent;
2338  }
2339  }
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 kAbsent, keys_, kLength, v8::internal::DescriptorLookupCache::Key::name, NULL, results_, and v8::internal::DescriptorLookupCache::Key::source.

Member Function Documentation

◆ Clear()

void v8::internal::DescriptorLookupCache::Clear ( )

Definition at line 5967 of file heap.cc.

5967  {
5968  for (int index = 0; index < kLength; index++) keys_[index].source = NULL;
5969 }

References keys_, kLength, and NULL.

Referenced by v8::internal::Heap::CreateInitialObjects(), v8::internal::Heap::MarkCompactPrologue(), and v8::internal::Heap::Scavenge().

+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::DescriptorLookupCache::DISALLOW_COPY_AND_ASSIGN ( DescriptorLookupCache  )
private

◆ Hash()

static int v8::internal::DescriptorLookupCache::Hash ( Object source,
Name name 
)
inlinestaticprivate

Definition at line 2341 of file heap.h.

2341  {
2342  // Uses only lower 32 bits if pointers are larger.
2343  uint32_t source_hash =
2344  static_cast<uint32_t>(reinterpret_cast<uintptr_t>(source)) >>
2346  uint32_t name_hash =
2347  static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)) >>
2349  return (source_hash ^ name_hash) % kLength;
2350  }
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 name
const int kPointerSizeLog2
Definition: globals.h:147

References kLength, v8::internal::kPointerSizeLog2, and name.

Referenced by Lookup(), and Update().

+ Here is the caller graph for this function:

◆ Lookup()

int v8::internal::DescriptorLookupCache::Lookup ( Map source,
Name name 
)
inline

Definition at line 2307 of file heap.h.

2307  {
2308  if (!name->IsUniqueName()) return kAbsent;
2309  int index = Hash(source, name);
2310  Key& key = keys_[index];
2311  if ((key.source == source) && (key.name == name)) return results_[index];
2312  return kAbsent;
2313  }
static int Hash(Object *source, Name *name)
Definition: heap.h:2341

References Hash(), kAbsent, keys_, name, v8::internal::DescriptorLookupCache::Key::name, results_, and v8::internal::DescriptorLookupCache::Key::source.

+ Here is the call graph for this function:

◆ Update()

void v8::internal::DescriptorLookupCache::Update ( Map source,
Name name,
int  result 
)
inline

Definition at line 2316 of file heap.h.

2316  {
2317  DCHECK(result != kAbsent);
2318  if (name->IsUniqueName()) {
2319  int index = Hash(source, name);
2320  Key& key = keys_[index];
2321  key.source = source;
2322  key.name = name;
2323  results_[index] = result;
2324  }
2325  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, Hash(), kAbsent, keys_, name, v8::internal::DescriptorLookupCache::Key::name, results_, and v8::internal::DescriptorLookupCache::Key::source.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ Isolate

friend class Isolate
friend

Definition at line 2361 of file heap.h.

Member Data Documentation

◆ kAbsent

const int v8::internal::DescriptorLookupCache::kAbsent = -2
static

Definition at line 2330 of file heap.h.

Referenced by DescriptorLookupCache(), Lookup(), and Update().

◆ keys_

Key v8::internal::DescriptorLookupCache::keys_[kLength]
private

Definition at line 2358 of file heap.h.

Referenced by Clear(), DescriptorLookupCache(), Lookup(), and Update().

◆ kLength

const int v8::internal::DescriptorLookupCache::kLength = 64
staticprivate

Definition at line 2352 of file heap.h.

Referenced by Clear(), DescriptorLookupCache(), and Hash().

◆ results_

int v8::internal::DescriptorLookupCache::results_[kLength]
private

Definition at line 2359 of file heap.h.

Referenced by DescriptorLookupCache(), Lookup(), and Update().


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