V8 Project
v8::internal::VariableMap Class Reference

#include <scopes.h>

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

Public Member Functions

 VariableMap (Zone *zone)
 
virtual ~VariableMap ()
 
VariableDeclare (Scope *scope, const AstRawString *name, VariableMode mode, bool is_valid_lhs, Variable::Kind kind, InitializationFlag initialization_flag, MaybeAssignedFlag maybe_assigned_flag=kNotAssigned, Interface *interface=Interface::NewValue())
 
VariableLookup (const AstRawString *name)
 
Zonezone () const
 
- Public Member Functions inherited from v8::internal::TemplateHashMapImpl< ZoneAllocationPolicy >
 TemplateHashMapImpl (MatchFun match, uint32_t capacity=kDefaultHashMapCapacity, ZoneAllocationPolicy allocator=ZoneAllocationPolicy())
 
 ~TemplateHashMapImpl ()
 
Entry * Lookup (void *key, uint32_t hash, bool insert, ZoneAllocationPolicy allocator=ZoneAllocationPolicy())
 
void * Remove (void *key, uint32_t hash)
 
void Clear ()
 
uint32_t occupancy () const
 
uint32_t capacity () const
 
Entry * Start () const
 
Entry * Next (Entry *p) const
 

Private Attributes

Zonezone_
 

Additional Inherited Members

- Public Types inherited from v8::internal::TemplateHashMapImpl< ZoneAllocationPolicy >
typedef bool(* MatchFun) (void *key1, void *key2)
 
- Static Public Member Functions inherited from v8::internal::TemplateHashMapImpl< ZoneAllocationPolicy >
static bool PointersMatch (void *key1, void *key2)
 
- Static Public Attributes inherited from v8::internal::TemplateHashMapImpl< ZoneAllocationPolicy >
static const uint32_t kDefaultHashMapCapacity
 

Detailed Description

Definition at line 18 of file scopes.h.

Constructor & Destructor Documentation

◆ VariableMap()

v8::internal::VariableMap::VariableMap ( Zone zone)
explicit

Definition at line 27 of file scopes.cc.

28  : ZoneHashMap(ZoneHashMap::PointersMatch, 8, ZoneAllocationPolicy(zone)),
29  zone_(zone) {}
static bool PointersMatch(void *key1, void *key2)
Definition: hashmap.h:80
Zone * zone() const
Definition: scopes.h:32
TemplateHashMapImpl< ZoneAllocationPolicy > ZoneHashMap
Definition: zone.h:245

◆ ~VariableMap()

v8::internal::VariableMap::~VariableMap ( )
virtual

Definition at line 30 of file scopes.cc.

30 {}

Member Function Documentation

◆ Declare()

Variable * v8::internal::VariableMap::Declare ( Scope scope,
const AstRawString name,
VariableMode  mode,
bool  is_valid_lhs,
Variable::Kind  kind,
InitializationFlag  initialization_flag,
MaybeAssignedFlag  maybe_assigned_flag = kNotAssigned,
Interface interface = Interface::NewValue() 
)

Definition at line 33 of file scopes.cc.

38  {
39  // AstRawStrings are unambiguous, i.e., the same string is always represented
40  // by the same AstRawString*.
41  // FIXME(marja): fix the type of Lookup.
42  Entry* p = ZoneHashMap::Lookup(const_cast<AstRawString*>(name), name->hash(),
43  true, ZoneAllocationPolicy(zone()));
44  if (p->value == NULL) {
45  // The variable has not been declared yet -> insert it.
46  DCHECK(p->key == name);
47  p->value = new (zone())
48  Variable(scope, name, mode, is_valid_lhs, kind, initialization_flag,
49  maybe_assigned_flag, interface);
50  }
51  return reinterpret_cast<Variable*>(p->value);
52 }
Entry * Lookup(void *key, uint32_t hash, bool insert, ZoneAllocationPolicy allocator=ZoneAllocationPolicy())
Definition: hashmap.h:114
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
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 mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
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 DCHECK, v8::internal::TemplateHashMapImpl< ZoneAllocationPolicy >::Lookup(), mode(), name, NULL, and zone().

Referenced by v8::internal::Scope::DeclareDynamicGlobal(), v8::internal::Scope::DeclareLocal(), v8::internal::Scope::DeclareParameter(), v8::internal::Scope::Initialize(), v8::internal::Scope::LookupLocal(), and v8::internal::Scope::Scope().

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

◆ Lookup()

Variable * v8::internal::VariableMap::Lookup ( const AstRawString name)

Definition at line 55 of file scopes.cc.

55  {
56  Entry* p = ZoneHashMap::Lookup(const_cast<AstRawString*>(name), name->hash(),
57  false, ZoneAllocationPolicy(NULL));
58  if (p != NULL) {
59  DCHECK(reinterpret_cast<const AstRawString*>(p->key) == name);
60  DCHECK(p->value != NULL);
61  return reinterpret_cast<Variable*>(p->value);
62  }
63  return NULL;
64 }

References DCHECK, v8::internal::TemplateHashMapImpl< ZoneAllocationPolicy >::Lookup(), name, and NULL.

Referenced by v8::internal::Scope::CheckConflictingVarDeclarations(), v8::internal::Scope::IsDeclared(), and v8::internal::Scope::LookupLocal().

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

◆ zone()

Zone* v8::internal::VariableMap::zone ( ) const
inline

Definition at line 32 of file scopes.h.

32 { return zone_; }

References zone_.

Referenced by Declare().

+ Here is the caller graph for this function:

Member Data Documentation

◆ zone_

Zone* v8::internal::VariableMap::zone_
private

Definition at line 35 of file scopes.h.

Referenced by zone().


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