V8 Project
v8::internal::CompareIC Class Reference

#include <ic.h>

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

Public Member Functions

 CompareIC (Isolate *isolate, Token::Value op)
 
CodeUpdateCaches (Handle< Object > x, Handle< Object > y)
 
- 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 Condition ComputeCondition (Token::Value op)
 
static Handle< CodeGetUninitialized (Isolate *isolate, Token::Value op)
 
- 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)
 

Private Member Functions

bool strict () const
 
Condition GetCondition () const
 

Static Private Member Functions

static bool HasInlinedSmiCode (Address address)
 
static CodeGetRawUninitialized (Isolate *isolate, Token::Value op)
 
static void Clear (Isolate *isolate, Address address, Code *target, ConstantPoolArray *constant_pool)
 

Private Attributes

Token::Value op_
 

Friends

class IC
 

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 616 of file ic.h.

Constructor & Destructor Documentation

◆ CompareIC()

v8::internal::CompareIC::CompareIC ( Isolate isolate,
Token::Value  op 
)
inline

Definition at line 618 of file ic.h.

619  : IC(EXTRA_CALL_FRAME, isolate), op_(op) {}
Token::Value op_
Definition: ic.h:641
friend class IC
Definition: ic.h:643
Isolate * isolate() const
Definition: ic.h:136
@ EXTRA_CALL_FRAME
Definition: ic.h:59

Member Function Documentation

◆ Clear()

void v8::internal::CompareIC::Clear ( Isolate isolate,
Address  address,
Code target,
ConstantPoolArray constant_pool 
)
staticprivate

Definition at line 555 of file ic.cc.

556  {
557  DCHECK(CodeStub::GetMajorKey(target) == CodeStub::CompareIC);
558  CompareICStub stub(target->stub_key(), isolate);
559  // Only clear CompareICs that can retain objects.
560  if (stub.state() != CompareICState::KNOWN_OBJECT) return;
562  constant_pool);
564 }
static Code * GetRawUninitialized(Isolate *isolate, Token::Value op)
Definition: ic.cc:2317
static void SetTargetAtAddress(Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic-inl.h:96
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
#define DCHECK(condition)
Definition: logging.h:205
@ DISABLE_INLINED_SMI_CHECK
Definition: ic.h:672
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check)

References v8::internal::IC::address(), v8::internal::IC::constant_pool(), DCHECK, v8::internal::DISABLE_INLINED_SMI_CHECK, GetRawUninitialized(), v8::internal::IC::isolate(), v8::internal::CompareICState::KNOWN_OBJECT, v8::internal::CompareICStub::op(), v8::internal::PatchInlinedSmiCode(), v8::internal::IC::SetTargetAtAddress(), v8::internal::CompareICStub::state(), and v8::internal::IC::target().

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

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

◆ ComputeCondition()

static Condition v8::internal::CompareIC::ComputeCondition ( Token::Value  op)
static

Referenced by v8::internal::CompareICStub::GetCondition().

+ Here is the caller graph for this function:

◆ GetCondition()

Condition v8::internal::CompareIC::GetCondition ( ) const
inlineprivate

Definition at line 634 of file ic.h.

634 { return ComputeCondition(op_); }
static Condition ComputeCondition(Token::Value op)

◆ GetRawUninitialized()

Code * v8::internal::CompareIC::GetRawUninitialized ( Isolate isolate,
Token::Value  op 
)
staticprivate

Definition at line 2317 of file ic.cc.

2317  {
2318  CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED,
2321  Code* code = NULL;
2322  CHECK(stub.FindCodeInCache(&code));
2323  return code;
2324 }
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

References CHECK, v8::internal::IC::isolate(), NULL, and v8::internal::CompareICState::UNINITIALIZED.

Referenced by Clear().

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

◆ GetUninitialized()

Handle< Code > v8::internal::CompareIC::GetUninitialized ( Isolate isolate,
Token::Value  op 
)
static

Definition at line 2327 of file ic.cc.

2327  {
2328  CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED,
2331  return stub.GetCode();
2332 }

References v8::internal::IC::isolate(), and v8::internal::CompareICState::UNINITIALIZED.

+ Here is the call graph for this function:

◆ HasInlinedSmiCode()

static bool v8::internal::CompareIC::HasInlinedSmiCode ( Address  address)
staticprivate

Referenced by UpdateCaches().

+ Here is the caller graph for this function:

◆ strict()

bool v8::internal::CompareIC::strict ( ) const
inlineprivate

Definition at line 633 of file ic.h.

633 { return op_ == Token::EQ_STRICT; }

◆ UpdateCaches()

Code * v8::internal::CompareIC::UpdateCaches ( Handle< Object x,
Handle< Object y 
)

Definition at line 2335 of file ic.cc.

2335  {
2336  HandleScope scope(isolate());
2337  CompareICStub old_stub(target()->stub_key(), isolate());
2338  CompareICState::State new_left =
2339  CompareICState::NewInputState(old_stub.left(), x);
2340  CompareICState::State new_right =
2341  CompareICState::NewInputState(old_stub.right(), y);
2343  old_stub.state(), old_stub.left(), old_stub.right(), op_,
2344  HasInlinedSmiCode(address()), x, y);
2345  CompareICStub stub(isolate(), op_, new_left, new_right, state);
2347  stub.set_known_map(
2348  Handle<Map>(Handle<JSObject>::cast(x)->map(), isolate()));
2349  }
2350  Handle<Code> new_target = stub.GetCode();
2351  set_target(*new_target);
2352 
2353  if (FLAG_trace_ic) {
2354  PrintF("[CompareIC in ");
2355  JavaScriptFrame::PrintTop(isolate(), stdout, false, true);
2356  PrintF(" ((%s+%s=%s)->(%s+%s=%s))#%s @ %p]\n",
2357  CompareICState::GetStateName(old_stub.left()),
2358  CompareICState::GetStateName(old_stub.right()),
2359  CompareICState::GetStateName(old_stub.state()),
2360  CompareICState::GetStateName(new_left),
2361  CompareICState::GetStateName(new_right),
2363  static_cast<void*>(*stub.GetCode()));
2364  }
2365 
2366  // Activate inlined smi code.
2367  if (old_stub.state() == CompareICState::UNINITIALIZED) {
2369  }
2370 
2371  return *new_target;
2372 }
static const char * GetStateName(CompareICState::State state)
Definition: ic-state.cc:457
static State NewInputState(State old_state, Handle< Object > value)
Definition: ic-state.cc:509
static State TargetState(State old_state, State old_left, State old_right, Token::Value op, bool has_inlined_smi_code, Handle< Object > x, Handle< Object > y)
Definition: ic-state.cc:552
static bool HasInlinedSmiCode(Address address)
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
State state() const
Definition: ic.h:66
void set_target(Code *code)
Definition: ic-inl.h:121
static void PrintTop(Isolate *isolate, FILE *file, bool print_args, bool print_line_number)
Definition: frames.cc:811
static const char * Name(Value tok)
Definition: token.h:180
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
@ ENABLE_INLINED_SMI_CHECK
Definition: ic.h:672
void PrintF(const char *format,...)
Definition: utils.cc:80

References v8::internal::IC::address(), v8::internal::ENABLE_INLINED_SMI_CHECK, v8::internal::CompareICState::GetStateName(), HasInlinedSmiCode(), v8::internal::IC::isolate(), v8::internal::CompareICState::KNOWN_OBJECT, v8::internal::CompareICStub::left(), map, v8::internal::Token::Name(), v8::internal::CompareICState::NewInputState(), op_, v8::internal::PatchInlinedSmiCode(), v8::internal::PrintF(), v8::internal::JavaScriptFrame::PrintTop(), v8::internal::CompareICStub::right(), v8::internal::CompareICStub::set_known_map(), v8::internal::IC::set_target(), v8::internal::CompareICStub::state(), v8::internal::IC::state(), v8::internal::IC::target(), v8::internal::CompareICState::TargetState(), v8::internal::CompareICState::UNINITIALIZED, and v8::base::internal::y.

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

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

Friends And Related Function Documentation

◆ IC

friend class IC
friend

Definition at line 643 of file ic.h.

Member Data Documentation

◆ op_

Token::Value v8::internal::CompareIC::op_
private

Definition at line 641 of file ic.h.

Referenced by UpdateCaches().


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