V8 Project
v8::internal::CompareICStub Class Reference

#include <code-stubs.h>

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

Classes

class  LeftStateBits
 
class  OpBits
 
class  RightStateBits
 
class  StateBits
 

Public Member Functions

 CompareICStub (Isolate *isolate, Token::Value op, CompareICState::State left, CompareICState::State right, CompareICState::State state)
 
void set_known_map (Handle< Map > map)
 
virtual InlineCacheState GetICState () const
 
Token::Value op () const
 
CompareICState::State left () const
 
CompareICState::State right () const
 
CompareICState::State state () const
 
- Public Member Functions inherited from v8::internal::PlatformCodeStub
virtual Handle< CodeGenerateCode () OVERRIDE
 

Private Member Functions

virtual Code::Kind GetCodeKind () const
 
void GenerateSmis (MacroAssembler *masm)
 
void GenerateNumbers (MacroAssembler *masm)
 
void GenerateInternalizedStrings (MacroAssembler *masm)
 
void GenerateStrings (MacroAssembler *masm)
 
void GenerateUniqueNames (MacroAssembler *masm)
 
void GenerateObjects (MacroAssembler *masm)
 
void GenerateMiss (MacroAssembler *masm)
 
void GenerateKnownObjects (MacroAssembler *masm)
 
void GenerateGeneric (MacroAssembler *masm)
 
bool strict () const
 
Condition GetCondition () const
 
virtual void AddToSpecialCache (Handle< Code > new_object)
 
virtual bool FindCodeInSpecialCache (Code **code_out)
 
virtual bool UseSpecialCache ()
 
 DEFINE_CALL_INTERFACE_DESCRIPTOR (BinaryOp)
 
 DEFINE_PLATFORM_CODE_STUB (CompareIC, PlatformCodeStub)
 

Private Attributes

Handle< Mapknown_map_
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::PlatformCodeStub
 PlatformCodeStub (Isolate *isolate)
 
virtual void Generate (MacroAssembler *masm)=0
 
 DEFINE_CODE_STUB_BASE (PlatformCodeStub, CodeStub)
 

Detailed Description

Definition at line 1254 of file code-stubs.h.

Constructor & Destructor Documentation

◆ CompareICStub()

v8::internal::CompareICStub::CompareICStub ( Isolate isolate,
Token::Value  op,
CompareICState::State  left,
CompareICState::State  right,
CompareICState::State  state 
)
inline

Definition at line 1256 of file code-stubs.h.

1258  : PlatformCodeStub(isolate) {
1262  }
static U encode(T value)
Definition: utils.h:217
CompareICState::State state() const
Definition: code-stubs.h:1278
Token::Value op() const
Definition: code-stubs.h:1268
CompareICState::State left() const
Definition: code-stubs.h:1272
CompareICState::State right() const
Definition: code-stubs.h:1275
PlatformCodeStub(Isolate *isolate)
Definition: code-stubs.h:341
static bool IsCompareOp(Value op)
Definition: token.h:202
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::encode(), v8::internal::EQ, v8::internal::Token::IsCompareOp(), left(), op(), right(), and state().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddToSpecialCache()

void v8::internal::CompareICStub::AddToSpecialCache ( Handle< Code new_object)
privatevirtual

Definition at line 359 of file code-stubs.cc.

359  {
360  DCHECK(*known_map_ != NULL);
361  Isolate* isolate = new_object->GetIsolate();
362  Factory* factory = isolate->factory();
364  strict() ?
365  factory->strict_compare_ic_string() :
366  factory->compare_ic_string(),
367  new_object);
368 }
static void UpdateCodeCache(Handle< Map > map, Handle< Name > name, Handle< Code > code)
Definition: objects.cc:7030
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

References DCHECK, v8::internal::Isolate::factory(), known_map_, NULL, strict(), and v8::internal::Map::UpdateCodeCache().

+ Here is the call graph for this function:

◆ DEFINE_CALL_INTERFACE_DESCRIPTOR()

v8::internal::CompareICStub::DEFINE_CALL_INTERFACE_DESCRIPTOR ( BinaryOp  )
private

◆ DEFINE_PLATFORM_CODE_STUB()

v8::internal::CompareICStub::DEFINE_PLATFORM_CODE_STUB ( CompareIC  ,
PlatformCodeStub   
)
private

◆ FindCodeInSpecialCache()

bool v8::internal::CompareICStub::FindCodeInSpecialCache ( Code **  code_out)
privatevirtual

Definition at line 371 of file code-stubs.cc.

371  {
372  Factory* factory = isolate()->factory();
374  GetCodeKind(),
375  UNINITIALIZED);
376  DCHECK(op() == Token::EQ || op() == Token::EQ_STRICT);
377  Handle<Object> probe(
378  known_map_->FindInCodeCache(
379  strict() ?
380  *factory->strict_compare_ic_string() :
381  *factory->compare_ic_string(),
382  flags),
383  isolate());
384  if (probe->IsCode()) {
385  *code_out = Code::cast(*probe);
386 #ifdef DEBUG
387  CompareICStub decode((*code_out)->stub_key(), isolate());
388  DCHECK(op() == decode.op());
389  DCHECK(left() == decode.left());
390  DCHECK(right() == decode.right());
391  DCHECK(state() == decode.state());
392 #endif
393  return true;
394  }
395  return false;
396 }
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
Definition: objects-inl.h:4954
uint32_t Flags
Definition: objects.h:4929
virtual Code::Kind GetCodeKind() const
Definition: code-stubs.h:1281
CompareICStub(Isolate *isolate, Token::Value op, CompareICState::State left, CompareICState::State right, CompareICState::State state)
Definition: code-stubs.h:1256
@ UNINITIALIZED
Definition: globals.h:446

References v8::internal::Code::ComputeFlags(), DCHECK, v8::internal::EQ, v8::internal::anonymous_namespace{flags.cc}::flags, GetCodeKind(), known_map_, left(), op(), right(), state(), strict(), and v8::internal::UNINITIALIZED.

+ Here is the call graph for this function:

◆ GenerateGeneric()

void v8::internal::CompareICStub::GenerateGeneric ( MacroAssembler masm)
private

◆ GenerateInternalizedStrings()

void v8::internal::CompareICStub::GenerateInternalizedStrings ( MacroAssembler masm)
private

◆ GenerateKnownObjects()

void v8::internal::CompareICStub::GenerateKnownObjects ( MacroAssembler masm)
private

◆ GenerateMiss()

void v8::internal::CompareICStub::GenerateMiss ( MacroAssembler masm)
private

◆ GenerateNumbers()

void v8::internal::CompareICStub::GenerateNumbers ( MacroAssembler masm)
private

◆ GenerateObjects()

void v8::internal::CompareICStub::GenerateObjects ( MacroAssembler masm)
private

◆ GenerateSmis()

void v8::internal::CompareICStub::GenerateSmis ( MacroAssembler masm)
private

◆ GenerateStrings()

void v8::internal::CompareICStub::GenerateStrings ( MacroAssembler masm)
private

◆ GenerateUniqueNames()

void v8::internal::CompareICStub::GenerateUniqueNames ( MacroAssembler masm)
private

◆ GetCodeKind()

virtual Code::Kind v8::internal::CompareICStub::GetCodeKind ( ) const
inlineprivatevirtual

Reimplemented from v8::internal::PlatformCodeStub.

Definition at line 1281 of file code-stubs.h.

1281 { return Code::COMPARE_IC; }

Referenced by FindCodeInSpecialCache().

+ Here is the caller graph for this function:

◆ GetCondition()

Condition v8::internal::CompareICStub::GetCondition ( ) const
private

Definition at line 354 of file code-stubs.cc.

354  {
356 }
static Condition ComputeCondition(Token::Value op)

References v8::internal::CompareIC::ComputeCondition(), and op().

+ Here is the call graph for this function:

◆ GetICState()

InlineCacheState v8::internal::CompareICStub::GetICState ( ) const
virtual

Definition at line 333 of file code-stubs.cc.

333  {
335  switch (state) {
338  case CompareICState::SMI:
345  return MONOMORPHIC;
348  }
349  UNREACHABLE();
351 }
#define UNREACHABLE()
Definition: logging.h:30
static LifetimePosition Max(LifetimePosition a, LifetimePosition b)

References v8::internal::GENERIC, v8::internal::CompareICState::GENERIC, v8::internal::CompareICState::INTERNALIZED_STRING, v8::internal::CompareICState::KNOWN_OBJECT, left(), v8::internal::Max(), v8::internal::MONOMORPHIC, v8::internal::CompareICState::NUMBER, v8::internal::CompareICState::OBJECT, right(), v8::internal::CompareICState::SMI, state(), v8::internal::CompareICState::STRING, v8::internal::UNINITIALIZED, v8::internal::CompareICState::UNINITIALIZED, v8::internal::CompareICState::UNIQUE_NAME, and UNREACHABLE.

+ Here is the call graph for this function:

◆ left()

CompareICState::State v8::internal::CompareICStub::left ( ) const
inline

Definition at line 1272 of file code-stubs.h.

1272  {
1273  return LeftStateBits::decode(minor_key_);
1274  }
static T decode(U value)
Definition: utils.h:228

References v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by CompareICStub(), v8::internal::TypeFeedbackOracle::CompareType(), FindCodeInSpecialCache(), GetICState(), and v8::internal::CompareIC::UpdateCaches().

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

◆ op()

Token::Value v8::internal::CompareICStub::op ( ) const
inline

Definition at line 1268 of file code-stubs.h.

1268  {
1269  return static_cast<Token::Value>(Token::EQ + OpBits::decode(minor_key_));
1270  }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and v8::internal::EQ.

Referenced by v8::internal::CompareIC::Clear(), CompareICStub(), FindCodeInSpecialCache(), GetCondition(), and strict().

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

◆ right()

CompareICState::State v8::internal::CompareICStub::right ( ) const
inline

Definition at line 1275 of file code-stubs.h.

1275  {
1276  return RightStateBits::decode(minor_key_);
1277  }

References v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by CompareICStub(), v8::internal::TypeFeedbackOracle::CompareType(), FindCodeInSpecialCache(), GetICState(), and v8::internal::CompareIC::UpdateCaches().

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

◆ set_known_map()

void v8::internal::CompareICStub::set_known_map ( Handle< Map map)
inline

Definition at line 1264 of file code-stubs.h.

1264 { known_map_ = map; }
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

References known_map_, and map.

Referenced by v8::internal::CompareIC::UpdateCaches().

+ Here is the caller graph for this function:

◆ state()

CompareICState::State v8::internal::CompareICStub::state ( ) const
inline

Definition at line 1278 of file code-stubs.h.

1278 { return StateBits::decode(minor_key_); }

References v8::internal::BitFieldBase< T, shift, size, U >::decode().

Referenced by v8::internal::CompareIC::Clear(), CompareICStub(), v8::internal::TypeFeedbackOracle::CompareType(), FindCodeInSpecialCache(), GetICState(), v8::internal::CompareIC::UpdateCaches(), and UseSpecialCache().

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

◆ strict()

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

Definition at line 1293 of file code-stubs.h.

1293 { return op() == Token::EQ_STRICT; }

References op().

Referenced by AddToSpecialCache(), and FindCodeInSpecialCache().

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

◆ UseSpecialCache()

virtual bool v8::internal::CompareICStub::UseSpecialCache ( )
inlineprivatevirtual

Definition at line 1298 of file code-stubs.h.

1298  {
1299  return state() == CompareICState::KNOWN_OBJECT;
1300  }

References v8::internal::CompareICState::KNOWN_OBJECT, and state().

+ Here is the call graph for this function:

Member Data Documentation

◆ known_map_

Handle<Map> v8::internal::CompareICStub::known_map_
private

Definition at line 1307 of file code-stubs.h.

Referenced by AddToSpecialCache(), FindCodeInSpecialCache(), and set_known_map().


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