v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IC Class Reference

#include <ic.h>

Inheritance diagram for IC:

Public Types

enum  UtilityId { kUtilityCount }
 
enum  FrameDepth { NO_EXTRA_FRAME = 0, EXTRA_CALL_FRAME = 1 }
 
typedef InlineCacheState State
 

Public Member Functions

 IC (FrameDepth depth, Isolate *isolate)
 
virtual ~IC ()
 
State state () const
 
Address address () const
 
void UpdateState (Handle< Object > receiver, Handle< Object > name)
 
void MarkMonomorphicPrototypeFailure ()
 

Static Public Member Functions

static Address AddressFromUtilityId (UtilityId id)
 
static void Clear (Isolate *isolate, Address address, ConstantPoolArray *constant_pool)
 
static InlineCacheHolderFlag GetCodeCacheForObject (Object *object)
 
static HeapObjectGetCodeCacheHolder (Isolate *isolate, Object *object, InlineCacheHolderFlag holder)
 
static InlineCacheHolderFlag GetCodeCacheFlag (HeapType *type)
 
static Handle< MapGetCodeCacheHolder (InlineCacheHolderFlag flag, HeapType *type, Isolate *isolate)
 
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)
 

Protected Member Functions

Handle< Codetarget () const
 
Address fp () const
 
Address pc () const
 
Isolateisolate () const
 
void set_target (Code *code)
 
bool is_target_set ()
 
FailureTypeError (const char *type, Handle< Object > object, Handle< Object > key)
 
FailureReferenceError (const char *type, Handle< String > name)
 
Handle< CodeComputeHandler (LookupResult *lookup, Handle< Object > object, Handle< String > name, Handle< Object > value=Handle< Code >::null())
 
virtual Handle< CodeCompileHandler (LookupResult *lookup, Handle< Object > object, Handle< String > name, Handle< Object > value, InlineCacheHolderFlag cache_holder)
 
void UpdateMonomorphicIC (Handle< HeapType > type, Handle< Code > handler, Handle< String > name)
 
bool UpdatePolymorphicIC (Handle< HeapType > type, Handle< String > name, Handle< Code > code)
 
virtual void UpdateMegamorphicCache (HeapType *type, Name *name, Code *code)
 
void CopyICToMegamorphicCache (Handle< String > name)
 
bool IsTransitionOfMonomorphicTarget (Map *source_map, Map *target_map)
 
void PatchCache (Handle< HeapType > type, Handle< String > name, Handle< Code > code)
 
virtual Code::Kind kind () const
 
virtual Handle< Codeslow_stub () const
 
virtual Handle< Codemegamorphic_stub ()
 
virtual Handle< Codegeneric_stub () const
 
bool TryRemoveInvalidPrototypeDependentStub (Handle< Object > receiver, Handle< String > name)
 
void TryRemoveInvalidHandlers (Handle< Map > map, Handle< String > name)
 
ExtraICState extra_ic_state () const
 
void set_extra_ic_state (ExtraICState state)
 
void UpdateTarget ()
 

Static Protected Member Functions

static CodeGetTargetAtAddress (Address address, ConstantPoolArray *constant_pool)
 
static void SetTargetAtAddress (Address address, Code *target, ConstantPoolArray *constant_pool)
 
static void PostPatching (Address address, Code *target, Code *old_target)
 

Detailed Description

Definition at line 66 of file ic.h.

Member Typedef Documentation

Definition at line 80 of file ic.h.

Member Enumeration Documentation

enum FrameDepth
Enumerator
NO_EXTRA_FRAME 
EXTRA_CALL_FRAME 

Definition at line 84 of file ic.h.

enum UtilityId
Enumerator
kUtilityCount 

Definition at line 69 of file ic.h.

Constructor & Destructor Documentation

virtual ~IC ( )
inlinevirtual

Definition at line 92 of file ic.h.

Member Function Documentation

Address AddressFromUtilityId ( IC::UtilityId  id)
static

Definition at line 2838 of file ic.cc.

void Clear ( Isolate isolate,
Address  address,
ConstantPoolArray constant_pool 
)
static
virtual Handle<Code> CompileHandler ( LookupResult *  lookup,
Handle< Object object,
Handle< String name,
Handle< Object value,
InlineCacheHolderFlag  cache_holder 
)
inlineprotectedvirtual

Reimplemented in StoreIC, and LoadIC.

Definition at line 200 of file ic.h.

References Handle< T >::null(), and UNREACHABLE.

Referenced by IC::ComputeHandler().

void CopyICToMegamorphicCache ( Handle< String name)
protected

Definition at line 727 of file ic.cc.

References List< T, P >::at(), v8::internal::name, IC::target(), and IC::UpdateMegamorphicCache().

Referenced by IC::PatchCache().

Handle< HeapType > CurrentTypeOf ( Handle< Object object,
Isolate isolate 
)
static
Address fp ( ) const
inlineprotected

Definition at line 155 of file ic.h.

Referenced by IC::IC().

virtual Handle<Code> generic_stub ( ) const
inlineprotectedvirtual

Reimplemented in StoreIC, and KeyedLoadIC.

Definition at line 236 of file ic.h.

References Handle< T >::null(), and UNREACHABLE.

Referenced by LoadIC::Load().

InlineCacheHolderFlag GetCodeCacheFlag ( HeapType type)
inlinestatic
InlineCacheHolderFlag GetCodeCacheForObject ( Object object)
inlinestatic

Definition at line 150 of file ic-inl.h.

References ASSERT, v8::internal::OWN_MAP, and v8::internal::PROTOTYPE_MAP.

Referenced by IC::ComputeHandler().

HeapObject * GetCodeCacheHolder ( Isolate isolate,
Object object,
InlineCacheHolderFlag  holder 
)
inlinestatic
Code * GetTargetAtAddress ( Address  address,
ConstantPoolArray constant_pool 
)
inlinestaticprotected
bool is_target_set ( )
inlineprotected

Definition at line 174 of file ic.h.

Referenced by KeyedLoadIC::Load(), and KeyedStoreIC::Store().

static bool IsCleared ( Code code)
inlinestatic
bool IsTransitionOfMonomorphicTarget ( Map source_map,
Map target_map 
)
protected
virtual Code::Kind kind ( ) const
inlineprotectedvirtual

Reimplemented in KeyedStoreIC, StoreIC, KeyedLoadIC, and LoadIC.

Definition at line 224 of file ic.h.

References v8::internal::STUB, and UNREACHABLE.

Referenced by IC::ComputeHandler(), IC::UpdateMonomorphicIC(), and IC::UpdatePolymorphicIC().

template Handle< HeapType > MapToType< HeapType > ( Handle< Map map,
typename T::Region *  region 
)
static

Definition at line 696 of file ic.cc.

References v8::internal::HEAP_NUMBER_TYPE, and v8::internal::ODDBALL_TYPE.

void MarkMonomorphicPrototypeFailure ( )
inline

Definition at line 99 of file ic.h.

References v8::internal::MONOMORPHIC_PROTOTYPE_FAILURE.

Referenced by IC::UpdateState().

virtual Handle<Code> megamorphic_stub ( )
inlineprotectedvirtual

Reimplemented in KeyedStoreIC, StoreIC, KeyedLoadIC, and LoadIC.

Definition at line 232 of file ic.h.

References Handle< T >::null(), and UNREACHABLE.

Referenced by IC::PatchCache().

Address pc ( ) const
inlineprotected

Definition at line 156 of file ic.h.

Referenced by IC::address().

Failure * ReferenceError ( const char *  type,
Handle< String name 
)
protected
void set_extra_ic_state ( ExtraICState  state)
inlineprotected

Definition at line 246 of file ic.h.

References IC::state().

virtual Handle<Code> slow_stub ( ) const
inlineprotectedvirtual

Reimplemented in KeyedStoreIC, StoreIC, KeyedLoadIC, and LoadIC.

Definition at line 228 of file ic.h.

References Handle< T >::null(), and UNREACHABLE.

void TryRemoveInvalidHandlers ( Handle< Map map,
Handle< String name 
)
protected

Definition at line 325 of file ic.cc.

References List< T, P >::at(), and IC::target().

Referenced by IC::TryRemoveInvalidPrototypeDependentStub(), and IC::UpdateState().

Failure * TypeError ( const char *  type,
Handle< Object object,
Handle< Object key 
)
protected
void UpdateMegamorphicCache ( HeapType type,
Name name,
Code code 
)
protectedvirtual
void UpdateMonomorphicIC ( Handle< HeapType type,
Handle< Code handler,
Handle< String name 
)
protected
void UpdateTarget ( )
inlineprotected

Definition at line 251 of file ic.h.

References v8::internal::handle().

Referenced by BinaryOpIC::Transition().


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