V8 Project
v8::internal::NamedStoreHandlerCompiler Class Reference

#include <handler-compiler.h>

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

Public Member Functions

 NamedStoreHandlerCompiler (Isolate *isolate, Handle< HeapType > type, Handle< JSObject > holder)
 
virtual ~NamedStoreHandlerCompiler ()
 
Handle< CodeCompileStoreTransition (Handle< Map > transition, Handle< Name > name)
 
Handle< CodeCompileStoreField (LookupIterator *it)
 
Handle< CodeCompileStoreCallback (Handle< JSObject > object, Handle< Name > name, Handle< ExecutableAccessorInfo > callback)
 
Handle< CodeCompileStoreCallback (Handle< JSObject > object, Handle< Name > name, const CallOptimization &call_optimization)
 
Handle< CodeCompileStoreViaSetter (Handle< JSObject > object, Handle< Name > name, Handle< JSFunction > setter)
 
Handle< CodeCompileStoreInterceptor (Handle< Name > name)
 

Static Public Member Functions

static void GenerateStoreViaSetter (MacroAssembler *masm, Handle< HeapType > type, Register receiver, Handle< JSFunction > setter)
 
static void GenerateStoreViaSetterForDeopt (MacroAssembler *masm)
 
static void GenerateSlow (MacroAssembler *masm)
 
- Static Public Member Functions inherited from v8::internal::PropertyHandlerCompiler
static Handle< CodeFind (Handle< Name > name, Handle< Map > map, Code::Kind kind, CacheHolderFlag cache_holder, Code::StubType type)
 

Protected Member Functions

virtual Register FrontendHeader (Register object_reg, Handle< Name > name, Label *miss)
 
virtual void FrontendFooter (Handle< Name > name, Label *miss)
 
void GenerateRestoreName (Label *label, Handle< Name > name)
 
- Protected Member Functions inherited from v8::internal::PropertyHandlerCompiler
 PropertyHandlerCompiler (Isolate *isolate, Code::Kind kind, Handle< HeapType > type, Handle< JSObject > holder, CacheHolderFlag cache_holder)
 
virtual ~PropertyHandlerCompiler ()
 
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
 

Private Member Functions

void GenerateStoreTransition (Handle< Map > transition, Handle< Name > name, Register receiver_reg, Register name_reg, Register value_reg, Register scratch1, Register scratch2, Register scratch3, Label *miss_label, Label *slow)
 
void GenerateStoreField (LookupIterator *lookup, Register value_reg, Label *miss_label)
 

Static Private Member Functions

static Builtins::Name SlowBuiltin (Code::Kind kind)
 
static Register value ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from v8::internal::PropertyHandlerCompiler
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)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ NamedStoreHandlerCompiler()

v8::internal::NamedStoreHandlerCompiler::NamedStoreHandlerCompiler ( Isolate isolate,
Handle< HeapType type,
Handle< JSObject holder 
)
inlineexplicit

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

198  : PropertyHandlerCompiler(isolate, Code::STORE_IC, type, holder,
199  kCacheOnReceiver) {}
Handle< JSObject > holder() const
PropertyHandlerCompiler(Isolate *isolate, Code::Kind kind, Handle< HeapType > type, Handle< JSObject > holder, CacheHolderFlag cache_holder)
Handle< HeapType > type() const
@ kCacheOnReceiver
Definition: globals.h:488

◆ ~NamedStoreHandlerCompiler()

virtual v8::internal::NamedStoreHandlerCompiler::~NamedStoreHandlerCompiler ( )
inlinevirtual

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

201 {}

Member Function Documentation

◆ CompileStoreCallback() [1/2]

Handle< Code > v8::internal::NamedStoreHandlerCompiler::CompileStoreCallback ( Handle< JSObject object,
Handle< Name name,
const CallOptimization &  call_optimization 
)

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

366  {
367  Frontend(receiver(), name);
368  Register values[] = {value()};
369  GenerateFastApiCall(masm(), call_optimization, handle(object->map()),
370  receiver(), scratch1(), true, 1, values);
371  return GetCode(kind(), Code::FAST, name);
372 }
Handle< Code > GetCode(Code::Kind kind, Code::StubType type, Handle< Name > name)
static void GenerateFastApiCall(MacroAssembler *masm, const CallOptimization &optimization, Handle< Map > receiver_map, Register receiver, Register scratch, bool is_store, int argc, Register *values)
Register Frontend(Register object_reg, Handle< Name > 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 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
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::Code::FAST, v8::internal::PropertyHandlerCompiler::Frontend(), v8::internal::PropertyHandlerCompiler::GenerateFastApiCall(), v8::internal::PropertyHandlerCompiler::GetCode(), v8::internal::handle(), name, and value().

+ Here is the call graph for this function:

◆ CompileStoreCallback() [2/2]

Handle<Code> v8::internal::NamedStoreHandlerCompiler::CompileStoreCallback ( Handle< JSObject object,
Handle< Name name,
Handle< ExecutableAccessorInfo callback 
)

Referenced by v8::internal::StoreIC::CompileHandler().

+ Here is the caller graph for this function:

◆ CompileStoreField()

Handle< Code > v8::internal::NamedStoreHandlerCompiler::CompileStoreField ( LookupIterator *  it)

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

346  {
347  Label miss;
348  GenerateStoreField(it, value(), &miss);
349  __ bind(&miss);
350  TailCallBuiltin(masm(), MissBuiltin(kind()));
351  return GetCode(kind(), Code::FAST, it->name());
352 }
void GenerateStoreField(LookupIterator *lookup, Register value_reg, Label *miss_label)
#define __

References __, v8::internal::Code::FAST, GenerateStoreField(), v8::internal::PropertyHandlerCompiler::GetCode(), and value().

Referenced by v8::internal::StoreIC::CompileHandler().

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

◆ CompileStoreInterceptor()

Handle<Code> v8::internal::NamedStoreHandlerCompiler::CompileStoreInterceptor ( Handle< Name name)

Referenced by v8::internal::StoreIC::CompileHandler().

+ Here is the caller graph for this function:

◆ CompileStoreTransition()

Handle< Code > v8::internal::NamedStoreHandlerCompiler::CompileStoreTransition ( Handle< Map transition,
Handle< Name name 
)

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

311  {
312  Label miss, slow;
313 
314  // Ensure no transitions to deprecated maps are followed.
315  __ CheckMapDeprecated(transition, scratch1(), &miss);
316 
317  // Check that we are allowed to write this.
318  bool is_nonexistent = holder()->map() == transition->GetBackPointer();
319  if (is_nonexistent) {
320  // Find the top object.
321  Handle<JSObject> last;
322  PrototypeIterator iter(isolate(), holder());
323  while (!iter.IsAtEnd()) {
325  iter.Advance();
326  }
327  if (!last.is_null()) set_holder(last);
328  NonexistentFrontendHeader(name, &miss, scratch1(), scratch2());
329  } else {
330  FrontendHeader(receiver(), name, &miss);
331  DCHECK(holder()->HasFastProperties());
332  }
333 
334  GenerateStoreTransition(transition, name, receiver(), this->name(), value(),
335  scratch1(), scratch2(), scratch3(), &miss, &slow);
336 
337  GenerateRestoreName(&miss, name);
338  TailCallBuiltin(masm(), MissBuiltin(kind()));
339 
340  GenerateRestoreName(&slow, name);
341  TailCallBuiltin(masm(), SlowBuiltin(kind()));
342  return GetCode(kind(), Code::FAST, name);
343 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
void GenerateRestoreName(Label *label, Handle< Name > name)
static Builtins::Name SlowBuiltin(Code::Kind kind)
void GenerateStoreTransition(Handle< Map > transition, Handle< Name > name, Register receiver_reg, Register name_reg, Register value_reg, Register scratch1, Register scratch2, Register scratch3, Label *miss_label, Label *slow)
virtual Register FrontendHeader(Register object_reg, Handle< Name > name, Label *miss)
void NonexistentFrontendHeader(Handle< Name > name, Label *miss, Register scratch1, Register scratch2)
void set_holder(Handle< JSObject > holder)
Object * GetCurrent() const
Definition: prototype.h:62
#define DCHECK(condition)
Definition: logging.h:205

References __, v8::internal::PrototypeIterator::Advance(), v8::internal::Handle< T >::cast(), DCHECK, v8::internal::Code::FAST, FrontendHeader(), GenerateRestoreName(), GenerateStoreTransition(), v8::internal::PropertyHandlerCompiler::GetCode(), v8::internal::PrototypeIterator::GetCurrent(), v8::internal::PropertyHandlerCompiler::holder(), v8::internal::Handle< T >::is_null(), v8::internal::PrototypeIterator::IsAtEnd(), name, v8::internal::PropertyHandlerCompiler::NonexistentFrontendHeader(), v8::internal::PropertyHandlerCompiler::set_holder(), SlowBuiltin(), and value().

Referenced by v8::internal::StoreIC::CompileHandler().

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

◆ CompileStoreViaSetter()

Handle< Code > v8::internal::NamedStoreHandlerCompiler::CompileStoreViaSetter ( Handle< JSObject object,
Handle< Name name,
Handle< JSFunction setter 
)

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

356  {
357  Frontend(receiver(), name);
358  GenerateStoreViaSetter(masm(), type(), receiver(), setter);
359 
360  return GetCode(kind(), Code::FAST, name);
361 }
static void GenerateStoreViaSetter(MacroAssembler *masm, Handle< HeapType > type, Register receiver, Handle< JSFunction > setter)

References v8::internal::Code::FAST, v8::internal::PropertyHandlerCompiler::Frontend(), GenerateStoreViaSetter(), v8::internal::PropertyHandlerCompiler::GetCode(), name, and v8::internal::PropertyHandlerCompiler::type().

Referenced by v8::internal::StoreIC::CompileHandler().

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

◆ FrontendFooter()

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

◆ FrontendHeader()

Register v8::internal::NamedStoreHandlerCompiler::FrontendHeader ( Register  object_reg,
Handle< Name name,
Label *  miss 
)
protectedvirtual

Reimplemented from v8::internal::PropertyHandlerCompiler.

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

126  {
127  return CheckPrototypes(object_reg, this->name(), scratch1(), scratch2(), name,
128  miss, SKIP_RECEIVER);
129 }
Register CheckPrototypes(Register object_reg, Register holder_reg, Register scratch1, Register scratch2, Handle< Name > name, Label *miss, PrototypeCheckType check=CHECK_ALL_MAPS)

References v8::internal::PropertyHandlerCompiler::CheckPrototypes(), name, and v8::internal::SKIP_RECEIVER.

Referenced by CompileStoreTransition().

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

◆ GenerateRestoreName()

void v8::internal::NamedStoreHandlerCompiler::GenerateRestoreName ( Label *  label,
Handle< Name name 
)
protected

Referenced by CompileStoreTransition().

+ Here is the caller graph for this function:

◆ GenerateSlow()

static void v8::internal::NamedStoreHandlerCompiler::GenerateSlow ( MacroAssembler masm)
static

Referenced by v8::internal::Generate_StoreIC_Slow().

+ Here is the caller graph for this function:

◆ GenerateStoreField()

void v8::internal::NamedStoreHandlerCompiler::GenerateStoreField ( LookupIterator *  lookup,
Register  value_reg,
Label *  miss_label 
)
private

Referenced by CompileStoreField().

+ Here is the caller graph for this function:

◆ GenerateStoreTransition()

void v8::internal::NamedStoreHandlerCompiler::GenerateStoreTransition ( Handle< Map transition,
Handle< Name name,
Register  receiver_reg,
Register  name_reg,
Register  value_reg,
Register  scratch1,
Register  scratch2,
Register  scratch3,
Label *  miss_label,
Label *  slow 
)
private

Referenced by CompileStoreTransition().

+ Here is the caller graph for this function:

◆ GenerateStoreViaSetter()

static void v8::internal::NamedStoreHandlerCompiler::GenerateStoreViaSetter ( MacroAssembler masm,
Handle< HeapType type,
Register  receiver,
Handle< JSFunction setter 
)
static

Referenced by CompileStoreViaSetter(), and GenerateStoreViaSetterForDeopt().

+ Here is the caller graph for this function:

◆ GenerateStoreViaSetterForDeopt()

static void v8::internal::NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt ( MacroAssembler masm)
inlinestatic

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

218  {
220  Handle<JSFunction>());
221  }
static Handle< T > null()
Definition: handles.h:123
const Register no_reg

References GenerateStoreViaSetter(), and v8::internal::no_reg.

Referenced by v8::internal::Generate_StoreIC_Setter_ForDeopt().

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

◆ SlowBuiltin()

static Builtins::Name v8::internal::NamedStoreHandlerCompiler::SlowBuiltin ( Code::Kind  kind)
inlinestaticprivate

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

242  {
243  switch (kind) {
244  case Code::STORE_IC:
245  return Builtins::kStoreIC_Slow;
246  case Code::KEYED_STORE_IC:
247  return Builtins::kKeyedStoreIC_Slow;
248  default:
249  UNREACHABLE();
250  }
251  return Builtins::kStoreIC_Slow;
252  }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

Referenced by CompileStoreTransition().

+ Here is the caller graph for this function:

◆ value()

static Register v8::internal::NamedStoreHandlerCompiler::value ( )
staticprivate

Referenced by CompileStoreCallback(), CompileStoreField(), and CompileStoreTransition().

+ Here is the caller graph for this function:

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