V8 Project
v8::internal::PropertyHandlerCompiler Class Reference

#include <handler-compiler.h>

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

Static Public Member Functions

static Handle< CodeFind (Handle< Name > name, Handle< Map > map, Code::Kind kind, CacheHolderFlag cache_holder, Code::StubType type)
 

Protected Member Functions

 PropertyHandlerCompiler (Isolate *isolate, Code::Kind kind, Handle< HeapType > type, Handle< JSObject > holder, CacheHolderFlag cache_holder)
 
virtual ~PropertyHandlerCompiler ()
 
virtual Register FrontendHeader (Register object_reg, Handle< Name > name, Label *miss)
 
virtual void FrontendFooter (Handle< Name > name, Label *miss)
 
Register Frontend (Register object_reg, Handle< Name > name)
 
void NonexistentFrontendHeader (Handle< Name > name, Label *miss, Register scratch1, Register scratch2)
 
Register CheckPrototypes (Register object_reg, Register holder_reg, Register scratch1, Register scratch2, Handle< Name > name, Label *miss, PrototypeCheckType check=CHECK_ALL_MAPS)
 
Handle< CodeGetCode (Code::Kind kind, Code::StubType type, Handle< Name > name)
 
void set_type_for_object (Handle< Object > object)
 
void set_holder (Handle< JSObject > holder)
 
Handle< HeapTypetype () const
 
Handle< JSObjectholder () const
 

Static Protected Member Functions

static void GenerateFastApiCall (MacroAssembler *masm, const CallOptimization &optimization, Handle< Map > receiver_map, Register receiver, Register scratch, bool is_store, int argc, Register *values)
 
static void GenerateDictionaryNegativeLookup (MacroAssembler *masm, Label *miss_label, Register receiver, Handle< Name > name, Register r0, Register r1)
 
static void GenerateCheckPropertyCell (MacroAssembler *masm, Handle< JSGlobalObject > global, Handle< Name > name, Register scratch, Label *miss)
 

Private Attributes

Handle< HeapTypetype_
 
Handle< JSObjectholder_
 

Detailed Description

Definition at line 18 of file handler-compiler.h.

Constructor & Destructor Documentation

◆ PropertyHandlerCompiler()

v8::internal::PropertyHandlerCompiler::PropertyHandlerCompiler ( Isolate isolate,
Code::Kind  kind,
Handle< HeapType type,
Handle< JSObject holder,
CacheHolderFlag  cache_holder 
)
inlineprotected

Definition at line 24 of file handler-compiler.h.

27  : PropertyAccessCompiler(isolate, kind, cache_holder),
28  type_(type),
29  holder_(holder) {}
Handle< JSObject > holder() const
Handle< HeapType > type() const

◆ ~PropertyHandlerCompiler()

virtual v8::internal::PropertyHandlerCompiler::~PropertyHandlerCompiler ( )
inlineprotectedvirtual

Definition at line 31 of file handler-compiler.h.

31 {}

Member Function Documentation

◆ CheckPrototypes()

Register v8::internal::PropertyHandlerCompiler::CheckPrototypes ( Register  object_reg,
Register  holder_reg,
Register  scratch1,
Register  scratch2,
Handle< Name name,
Label *  miss,
PrototypeCheckType  check = CHECK_ALL_MAPS 
)
protected

Referenced by v8::internal::NamedLoadHandlerCompiler::FrontendHeader(), and v8::internal::NamedStoreHandlerCompiler::FrontendHeader().

+ Here is the caller graph for this function:

◆ Find()

Handle< Code > v8::internal::PropertyHandlerCompiler::Find ( Handle< Name name,
Handle< Map map,
Code::Kind  kind,
CacheHolderFlag  cache_holder,
Code::StubType  type 
)
static

Definition at line 16 of file handler-compiler.cc.

20  {
21  Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder);
22  Object* probe = stub_holder->FindInCodeCache(*name, flags);
23  if (probe->IsCode()) return handle(Code::cast(probe));
24  return Handle<Code>::null();
25 }
static Flags ComputeHandlerFlags(Kind handler_kind, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
Definition: objects-inl.h:4975
uint32_t Flags
Definition: objects.h:4929
static Handle< T > null()
Definition: handles.h:123
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
kSerializedDataOffset Object
Definition: objects-inl.h:5322
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::Code::ComputeHandlerFlags(), v8::internal::anonymous_namespace{flags.cc}::flags, v8::internal::handle(), name, v8::internal::Handle< T >::null(), and type().

Referenced by v8::internal::IC::ComputeHandler(), and v8::internal::NamedLoadHandlerCompiler::ComputeLoadNonexistent().

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

◆ Frontend()

Register v8::internal::PropertyHandlerCompiler::Frontend ( Register  object_reg,
Handle< Name name 
)
protected

Definition at line 132 of file handler-compiler.cc.

133  {
134  Label miss;
135  Register reg = FrontendHeader(object_reg, name, &miss);
136  FrontendFooter(name, &miss);
137  return reg;
138 }
virtual void FrontendFooter(Handle< Name > name, Label *miss)
virtual Register FrontendHeader(Register object_reg, Handle< Name > name, Label *miss)

References FrontendFooter(), FrontendHeader(), and name.

Referenced by v8::internal::NamedLoadHandlerCompiler::CompileLoadCallback(), v8::internal::NamedLoadHandlerCompiler::CompileLoadConstant(), v8::internal::NamedLoadHandlerCompiler::CompileLoadField(), v8::internal::NamedLoadHandlerCompiler::CompileLoadInterceptor(), v8::internal::NamedLoadHandlerCompiler::CompileLoadViaGetter(), v8::internal::NamedStoreHandlerCompiler::CompileStoreCallback(), v8::internal::NamedStoreHandlerCompiler::CompileStoreViaSetter(), and v8::internal::NamedLoadHandlerCompiler::GenerateLoadPostInterceptor().

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

◆ FrontendFooter()

virtual void v8::internal::PropertyHandlerCompiler::FrontendFooter ( Handle< Name name,
Label *  miss 
)
inlineprotectedvirtual

Reimplemented in v8::internal::NamedStoreHandlerCompiler, and v8::internal::NamedLoadHandlerCompiler.

Definition at line 39 of file handler-compiler.h.

39 { UNREACHABLE(); }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

Referenced by Frontend().

+ Here is the caller graph for this function:

◆ FrontendHeader()

virtual Register v8::internal::PropertyHandlerCompiler::FrontendHeader ( Register  object_reg,
Handle< Name name,
Label *  miss 
)
inlineprotectedvirtual

Reimplemented in v8::internal::NamedStoreHandlerCompiler, and v8::internal::NamedLoadHandlerCompiler.

Definition at line 33 of file handler-compiler.h.

34  {
35  UNREACHABLE();
36  return receiver();
37  }

References UNREACHABLE.

Referenced by Frontend(), and NonexistentFrontendHeader().

+ Here is the caller graph for this function:

◆ GenerateCheckPropertyCell()

static void v8::internal::PropertyHandlerCompiler::GenerateCheckPropertyCell ( MacroAssembler masm,
Handle< JSGlobalObject global,
Handle< Name name,
Register  scratch,
Label *  miss 
)
staticprotected

Referenced by NonexistentFrontendHeader().

+ Here is the caller graph for this function:

◆ GenerateDictionaryNegativeLookup()

static void v8::internal::PropertyHandlerCompiler::GenerateDictionaryNegativeLookup ( MacroAssembler masm,
Label *  miss_label,
Register  receiver,
Handle< Name name,
Register  r0,
Register  r1 
)
staticprotected

Referenced by NonexistentFrontendHeader().

+ Here is the caller graph for this function:

◆ GenerateFastApiCall()

static void v8::internal::PropertyHandlerCompiler::GenerateFastApiCall ( MacroAssembler masm,
const CallOptimization &  optimization,
Handle< Map receiver_map,
Register  receiver,
Register  scratch,
bool  is_store,
int  argc,
Register values 
)
staticprotected

Referenced by v8::internal::NamedLoadHandlerCompiler::CompileLoadCallback(), and v8::internal::NamedStoreHandlerCompiler::CompileStoreCallback().

+ Here is the caller graph for this function:

◆ GetCode()

Handle< Code > v8::internal::PropertyHandlerCompiler::GetCode ( Code::Kind  kind,
Code::StubType  type,
Handle< Name name 
)
protected

Definition at line 72 of file handler-compiler.cc.

74  {
75  Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder());
76  Handle<Code> code = GetCodeWithFlags(flags, name);
77  PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, *name));
78  return code;
79 }
#define PROFILE(IsolateGetter, Call)
Definition: cpu-profiler.h:181

References v8::internal::Code::ComputeHandlerFlags(), v8::internal::anonymous_namespace{flags.cc}::flags, name, PROFILE, and type().

Referenced by v8::internal::NamedLoadHandlerCompiler::CompileLoadCallback(), v8::internal::NamedLoadHandlerCompiler::CompileLoadConstant(), v8::internal::NamedLoadHandlerCompiler::CompileLoadField(), v8::internal::NamedLoadHandlerCompiler::CompileLoadInterceptor(), v8::internal::NamedLoadHandlerCompiler::CompileLoadNonexistent(), v8::internal::NamedLoadHandlerCompiler::CompileLoadViaGetter(), v8::internal::NamedStoreHandlerCompiler::CompileStoreCallback(), v8::internal::NamedStoreHandlerCompiler::CompileStoreField(), v8::internal::NamedStoreHandlerCompiler::CompileStoreTransition(), and v8::internal::NamedStoreHandlerCompiler::CompileStoreViaSetter().

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

◆ holder()

Handle<JSObject> v8::internal::PropertyHandlerCompiler::holder ( ) const
inlineprotected

Definition at line 92 of file handler-compiler.h.

92 { return holder_; }

References holder_.

Referenced by v8::internal::NamedStoreHandlerCompiler::CompileStoreTransition(), v8::internal::NamedLoadHandlerCompiler::GenerateLoadPostInterceptor(), NonexistentFrontendHeader(), and set_holder().

+ Here is the caller graph for this function:

◆ NonexistentFrontendHeader()

void v8::internal::PropertyHandlerCompiler::NonexistentFrontendHeader ( Handle< Name name,
Label *  miss,
Register  scratch1,
Register  scratch2 
)
protected

Definition at line 141 of file handler-compiler.cc.

144  {
145  Register holder_reg;
146  Handle<Map> last_map;
147  if (holder().is_null()) {
148  holder_reg = receiver();
149  last_map = IC::TypeToMap(*type(), isolate());
150  // If |type| has null as its prototype, |holder()| is
151  // Handle<JSObject>::null().
152  DCHECK(last_map->prototype() == isolate()->heap()->null_value());
153  } else {
154  holder_reg = FrontendHeader(receiver(), name, miss);
155  last_map = handle(holder()->map());
156  }
157 
158  if (last_map->is_dictionary_map()) {
159  if (last_map->IsJSGlobalObjectMap()) {
160  Handle<JSGlobalObject> global =
161  holder().is_null()
162  ? Handle<JSGlobalObject>::cast(type()->AsConstant()->Value())
163  : Handle<JSGlobalObject>::cast(holder());
164  GenerateCheckPropertyCell(masm(), global, name, scratch1, miss);
165  } else {
166  if (!name->IsUniqueName()) {
167  DCHECK(name->IsString());
168  name = factory()->InternalizeString(Handle<String>::cast(name));
169  }
170  DCHECK(holder().is_null() ||
171  holder()->property_dictionary()->FindEntry(name) ==
173  GenerateDictionaryNegativeLookup(masm(), miss, holder_reg, name, scratch1,
174  scratch2);
175  }
176  }
177 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static const int kNotFound
Definition: objects.h:3283
static Handle< Map > TypeToMap(HeapType *type, Isolate *isolate)
Definition: ic.cc:719
static void GenerateDictionaryNegativeLookup(MacroAssembler *masm, Label *miss_label, Register receiver, Handle< Name > name, Register r0, Register r1)
static void GenerateCheckPropertyCell(MacroAssembler *masm, Handle< JSGlobalObject > global, Handle< Name > name, Register scratch, Label *miss)
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 map
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::Handle< T >::cast(), DCHECK, FrontendHeader(), GenerateCheckPropertyCell(), GenerateDictionaryNegativeLookup(), v8::internal::handle(), holder(), v8::internal::HashTable< Derived, Shape, Key >::kNotFound, map, name, type(), and v8::internal::IC::TypeToMap().

Referenced by v8::internal::NamedLoadHandlerCompiler::CompileLoadNonexistent(), and v8::internal::NamedStoreHandlerCompiler::CompileStoreTransition().

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

◆ set_holder()

void v8::internal::PropertyHandlerCompiler::set_holder ( Handle< JSObject holder)
inlineprotected

Definition at line 90 of file handler-compiler.h.

90 { holder_ = holder; }

References holder(), and holder_.

Referenced by v8::internal::NamedStoreHandlerCompiler::CompileStoreTransition(), and v8::internal::NamedLoadHandlerCompiler::GenerateLoadPostInterceptor().

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

◆ set_type_for_object()

void v8::internal::PropertyHandlerCompiler::set_type_for_object ( Handle< Object object)
protected

Definition at line 82 of file handler-compiler.cc.

82  {
83  type_ = IC::CurrentTypeOf(object, isolate());
84 }
static Handle< HeapType > CurrentTypeOf(Handle< Object > object, Isolate *isolate)
Definition: ic.cc:712

References v8::internal::IC::CurrentTypeOf(), and type_.

Referenced by v8::internal::NamedLoadHandlerCompiler::FrontendHeader(), and v8::internal::NamedLoadHandlerCompiler::GenerateLoadPostInterceptor().

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

◆ type()

Handle<HeapType> v8::internal::PropertyHandlerCompiler::type ( ) const
inlineprotected

Member Data Documentation

◆ holder_

Handle<JSObject> v8::internal::PropertyHandlerCompiler::holder_
private

Definition at line 96 of file handler-compiler.h.

Referenced by holder(), and set_holder().

◆ type_

Handle<HeapType> v8::internal::PropertyHandlerCompiler::type_
private

Definition at line 95 of file handler-compiler.h.

Referenced by set_type_for_object(), and type().


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