V8 Project
v8::internal::CompareNilIC Class Reference

#include <ic.h>

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

Public Member Functions

 CompareNilIC (Isolate *isolate)
 
Handle< ObjectCompareNil (Handle< Object > object)
 
- Public Member Functions inherited from v8::internal::IC
 IC (FrameDepth depth, Isolate *isolate)
 
virtual ~IC ()
 
State state () const
 
Address address () const
 
void UpdateState (Handle< Object > receiver, Handle< Object > name)
 
bool IsNameCompatibleWithPrototypeFailure (Handle< Object > name)
 
void MarkPrototypeFailure (Handle< Object > name)
 

Static Public Member Functions

static Handle< CodeGetUninitialized ()
 
static void Clear (Address address, Code *target, ConstantPoolArray *constant_pool)
 
static Handle< ObjectDoCompareNilSlow (Isolate *isolate, NilValue nil, Handle< Object > object)
 
- Static Public Member Functions inherited from v8::internal::IC
static Address AddressFromUtilityId (UtilityId id)
 
static void RegisterWeakMapDependency (Handle< Code > stub)
 
static void InvalidateMaps (Code *stub)
 
static void Clear (Isolate *isolate, Address address, ConstantPoolArray *constant_pool)
 
template<class TypeClass >
static JSFunctionGetRootConstructor (TypeClass *type, Context *native_context)
 
static Handle< MapGetHandlerCacheHolder (HeapType *type, bool receiver_is_holder, Isolate *isolate, CacheHolderFlag *flag)
 
static Handle< MapGetICCacheHolder (HeapType *type, Isolate *isolate, CacheHolderFlag *flag)
 
static bool IsCleared (Code *code)
 
static Handle< MapTypeToMap (HeapType *type, Isolate *isolate)
 
template<class T >
static T::TypeHandle MapToType (Handle< Map > map, typename T::Region *region)
 
static Handle< HeapTypeCurrentTypeOf (Handle< Object > object, Isolate *isolate)
 

Additional Inherited Members

- Public Types inherited from v8::internal::IC
enum  UtilityId { kUtilityCount }
 
enum  FrameDepth { NO_EXTRA_FRAME = 0 , EXTRA_CALL_FRAME = 1 }
 
typedef InlineCacheState State
 
- Protected Member Functions inherited from v8::internal::IC
Handle< Codetarget () const
 
Address fp () const
 
Address pc () const
 
Isolateisolate () const
 
SharedFunctionInfoGetSharedFunctionInfo () const
 
CodeGetCode () const
 
CodeGetOriginalCode () const
 
void set_target (Code *code)
 
bool is_target_set ()
 
char TransitionMarkFromState (IC::State state)
 
void TraceIC (const char *type, Handle< Object > name)
 
void TraceIC (const char *type, Handle< Object > name, State old_state, State new_state)
 
MaybeHandle< ObjectTypeError (const char *type, Handle< Object > object, Handle< Object > key)
 
MaybeHandle< ObjectReferenceError (const char *type, Handle< Name > name)
 
Handle< CodeComputeHandler (LookupIterator *lookup, Handle< Object > value=Handle< Code >::null())
 
virtual Handle< CodeCompileHandler (LookupIterator *lookup, Handle< Object > value, CacheHolderFlag cache_holder)
 
void UpdateMonomorphicIC (Handle< Code > handler, Handle< Name > name)
 
bool UpdatePolymorphicIC (Handle< Name > name, Handle< Code > code)
 
void UpdateMegamorphicCache (HeapType *type, Name *name, Code *code)
 
void CopyICToMegamorphicCache (Handle< Name > name)
 
bool IsTransitionOfMonomorphicTarget (Map *source_map, Map *target_map)
 
void PatchCache (Handle< Name > name, Handle< Code > code)
 
Code::Kind kind () const
 
Code::Kind handler_kind () const
 
virtual Handle< Codemegamorphic_stub ()
 
bool TryRemoveInvalidPrototypeDependentStub (Handle< Object > receiver, Handle< String > name)
 
ExtraICState extra_ic_state () const
 
void set_extra_ic_state (ExtraICState state)
 
Handle< HeapTypereceiver_type ()
 
void update_receiver_type (Handle< Object > receiver)
 
void TargetMaps (MapHandleList *list)
 
void TargetTypes (TypeHandleList *list)
 
MapFirstTargetMap ()
 
void UpdateTarget ()
 
- Static Protected Member Functions inherited from v8::internal::IC
static CodeGetTargetAtAddress (Address address, ConstantPoolArray *constant_pool)
 
static void SetTargetAtAddress (Address address, Code *target, ConstantPoolArray *constant_pool)
 
static void OnTypeFeedbackChanged (Isolate *isolate, Address address, State old_state, State new_state, bool target_remains_ic_stub)
 
static void PostPatching (Address address, Code *target, Code *old_target)
 

Detailed Description

Definition at line 647 of file ic.h.

Constructor & Destructor Documentation

◆ CompareNilIC()

v8::internal::CompareNilIC::CompareNilIC ( Isolate isolate)
inlineexplicit

Definition at line 649 of file ic.h.

Isolate * isolate() const
Definition: ic.h:136
IC(FrameDepth depth, Isolate *isolate)
Definition: ic.cc:141
@ EXTRA_CALL_FRAME
Definition: ic.h:59

Member Function Documentation

◆ Clear()

void v8::internal::CompareNilIC::Clear ( Address  address,
Code target,
ConstantPoolArray constant_pool 
)
static

Definition at line 2385 of file ic.cc.

2386  {
2387  if (IsCleared(target)) return;
2388  ExtraICState state = target->extra_ic_state();
2389 
2390  CompareNilICStub stub(target->GetIsolate(), state,
2392  stub.ClearState();
2393 
2394  Code* code = NULL;
2395  CHECK(stub.FindCodeInCache(&code));
2396 
2398 }
static void SetTargetAtAddress(Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic-inl.h:96
State state() const
Definition: ic.h:66
ConstantPoolArray * constant_pool() const
Definition: ic-inl.h:51
Address address() const
Definition: ic-inl.h:19
Handle< Code > target() const
Definition: ic.h:132
static bool IsCleared(Code *code)
Definition: ic.h:112
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 CHECK(condition)
Definition: logging.h:36
int ExtraICState
Definition: objects.h:305

References v8::internal::IC::address(), CHECK, v8::internal::CompareNilICStub::ClearState(), v8::internal::IC::constant_pool(), v8::internal::IC::IsCleared(), NULL, v8::internal::IC::SetTargetAtAddress(), v8::internal::IC::state(), v8::internal::IC::target(), and v8::internal::HydrogenCodeStub::UNINITIALIZED.

Referenced by v8::internal::IC::Clear().

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

◆ CompareNil()

Handle< Object > v8::internal::CompareNilIC::CompareNil ( Handle< Object object)

Definition at line 2410 of file ic.cc.

2410  {
2411  ExtraICState extra_ic_state = target()->extra_ic_state();
2412 
2413  CompareNilICStub stub(isolate(), extra_ic_state);
2414 
2415  // Extract the current supported types from the patched IC and calculate what
2416  // types must be supported as a result of the miss.
2417  bool already_monomorphic = stub.IsMonomorphic();
2418 
2419  stub.UpdateStatus(object);
2420 
2421  NilValue nil = stub.nil_value();
2422 
2423  // Find or create the specialized stub to support the new set of types.
2424  Handle<Code> code;
2425  if (stub.IsMonomorphic()) {
2426  Handle<Map> monomorphic_map(already_monomorphic && FirstTargetMap() != NULL
2427  ? FirstTargetMap()
2428  : HeapObject::cast(*object)->map());
2429  code = PropertyICCompiler::ComputeCompareNil(monomorphic_map, &stub);
2430  } else {
2431  code = stub.GetCode();
2432  }
2433  set_target(*code);
2434  return DoCompareNilSlow(isolate(), nil, object);
2435 }
static Handle< Object > DoCompareNilSlow(Isolate *isolate, NilValue nil, Handle< Object > object)
Definition: ic.cc:2401
Map * FirstTargetMap()
Definition: ic.h:222
ExtraICState extra_ic_state() const
Definition: ic.h:200
void set_target(Code *code)
Definition: ic-inl.h:121
static Handle< Code > ComputeCompareNil(Handle< Map > receiver_map, CompareNilICStub *stub)
Definition: ic-compiler.cc:221
NilValue
Definition: v8.h:97

References v8::internal::PropertyICCompiler::ComputeCompareNil(), DoCompareNilSlow(), v8::internal::IC::extra_ic_state(), v8::internal::IC::FirstTargetMap(), v8::internal::CompareNilICStub::IsMonomorphic(), v8::internal::IC::isolate(), v8::internal::HeapObject::map(), v8::internal::CompareNilICStub::nil_value(), NULL, v8::internal::IC::set_target(), v8::internal::IC::target(), and v8::internal::CompareNilICStub::UpdateStatus().

+ Here is the call graph for this function:

◆ DoCompareNilSlow()

Handle< Object > v8::internal::CompareNilIC::DoCompareNilSlow ( Isolate isolate,
NilValue  nil,
Handle< Object object 
)
static

Definition at line 2401 of file ic.cc.

2402  {
2403  if (object->IsNull() || object->IsUndefined()) {
2404  return handle(Smi::FromInt(true), isolate);
2405  }
2406  return handle(Smi::FromInt(object->IsUndetectableObject()), isolate);
2407 }
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::Smi::FromInt(), v8::internal::handle(), and v8::internal::IC::isolate().

Referenced by CompareNil().

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

◆ GetUninitialized()

static Handle<Code> v8::internal::CompareNilIC::GetUninitialized ( )
static

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