V8 Project
v8::internal::LoadIC Class Reference

#include <ic.h>

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

Public Member Functions

ContextualMode contextual_mode () const
 
 LoadIC (FrameDepth depth, Isolate *isolate)
 
bool IsUndeclaredGlobal (Handle< Object > receiver)
 
MUST_USE_RESULT MaybeHandle< ObjectLoad (Handle< Object > object, Handle< Name > name)
 
- 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 ExtraICState ComputeExtraICState (ContextualMode contextual_mode)
 
static void GenerateInitialize (MacroAssembler *masm)
 
static void GeneratePreMonomorphic (MacroAssembler *masm)
 
static void GenerateMiss (MacroAssembler *masm)
 
static void GenerateNormal (MacroAssembler *masm)
 
static void GenerateRuntimeGetProperty (MacroAssembler *masm)
 
static Handle< Codeinitialize_stub (Isolate *isolate, ExtraICState extra_state)
 
- 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)
 

Protected Member Functions

void set_target (Code *code)
 
Handle< Codeslow_stub () const
 
virtual Handle< Codemegamorphic_stub () OVERRIDE
 
void UpdateCaches (LookupIterator *lookup)
 
virtual Handle< CodeCompileHandler (LookupIterator *lookup, Handle< Object > unused, CacheHolderFlag cache_holder)
 
- 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())
 
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
 
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 ()
 

Private Member Functions

virtual Handle< Codepre_monomorphic_stub () const
 
Handle< CodeSimpleFieldLoad (FieldIndex index)
 

Static Private Member Functions

static Handle< Codepre_monomorphic_stub (Isolate *isolate, ExtraICState extra_state)
 
static void Clear (Isolate *isolate, Address address, Code *target, ConstantPoolArray *constant_pool)
 

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

Constructor & Destructor Documentation

◆ LoadIC()

v8::internal::LoadIC::LoadIC ( FrameDepth  depth,
Isolate isolate 
)
inlineexplicit

Definition at line 332 of file ic.h.

332  : IC(depth, isolate) {
333  DCHECK(IsLoadStub());
334  }
Isolate * isolate() const
Definition: ic.h:136
friend class IC
Definition: ic.h:394
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK.

Member Function Documentation

◆ Clear()

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

Definition at line 527 of file ic.cc.

528  {
529  if (IsCleared(target)) return;
530  Code* code = PropertyICCompiler::FindPreMonomorphic(isolate, Code::LOAD_IC,
531  target->extra_ic_state());
533 }
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
static bool IsCleared(Code *code)
Definition: ic.h:112
static Code * FindPreMonomorphic(Isolate *isolate, Code::Kind kind, ExtraICState extra_ic_state)
Definition: ic-compiler.cc:149

References v8::internal::IC::address(), v8::internal::IC::constant_pool(), v8::internal::PropertyICCompiler::FindPreMonomorphic(), v8::internal::IC::IsCleared(), v8::internal::IC::isolate(), v8::internal::IC::SetTargetAtAddress(), 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:

◆ CompileHandler()

Handle< Code > v8::internal::LoadIC::CompileHandler ( LookupIterator *  lookup,
Handle< Object unused,
CacheHolderFlag  cache_holder 
)
protectedvirtual

Reimplemented from v8::internal::IC.

Definition at line 947 of file ic.cc.

949  {
950  Handle<Object> receiver = lookup->GetReceiver();
951  if (receiver->IsString() &&
952  Name::Equals(isolate()->factory()->length_string(), lookup->name())) {
953  FieldIndex index = FieldIndex::ForInObjectOffset(String::kLengthOffset);
954  return SimpleFieldLoad(index);
955  }
956 
957  if (receiver->IsStringWrapper() &&
958  Name::Equals(isolate()->factory()->length_string(), lookup->name())) {
959  StringLengthStub string_length_stub(isolate());
960  return string_length_stub.GetCode();
961  }
962 
963  // Use specialized code for getting prototype of functions.
964  if (receiver->IsJSFunction() &&
965  Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) &&
966  Handle<JSFunction>::cast(receiver)->should_have_prototype() &&
967  !Handle<JSFunction>::cast(receiver)
968  ->map()
969  ->has_non_instance_prototype()) {
970  Handle<Code> stub;
971  FunctionPrototypeStub function_prototype_stub(isolate());
972  return function_prototype_stub.GetCode();
973  }
974 
975  Handle<HeapType> type = receiver_type();
976  Handle<JSObject> holder = lookup->GetHolder<JSObject>();
977  bool receiver_is_holder = receiver.is_identical_to(holder);
978  switch (lookup->state()) {
979  case LookupIterator::INTERCEPTOR: {
980  DCHECK(!holder->GetNamedInterceptor()->getter()->IsUndefined());
981  NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
982  cache_holder);
983  // Perform a lookup behind the interceptor. Copy the LookupIterator since
984  // the original iterator will be used to fetch the value.
985  LookupIterator it = *lookup;
986  it.Next();
987  LookupForRead(&it);
988  return compiler.CompileLoadInterceptor(&it);
989  }
990 
992  // Use simple field loads for some well-known callback properties.
993  if (receiver_is_holder) {
994  DCHECK(receiver->IsJSObject());
995  Handle<JSObject> js_receiver = Handle<JSObject>::cast(receiver);
996  int object_offset;
997  if (Accessors::IsJSObjectFieldAccessor<HeapType>(type, lookup->name(),
998  &object_offset)) {
999  FieldIndex index =
1000  FieldIndex::ForInObjectOffset(object_offset, js_receiver->map());
1001  return SimpleFieldLoad(index);
1002  }
1003  }
1004 
1005  Handle<Object> accessors = lookup->GetAccessors();
1006  if (accessors->IsExecutableAccessorInfo()) {
1007  Handle<ExecutableAccessorInfo> info =
1009  if (v8::ToCData<Address>(info->getter()) == 0) break;
1011  type)) {
1012  break;
1013  }
1014  if (!holder->HasFastProperties()) break;
1015  NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
1016  cache_holder);
1017  return compiler.CompileLoadCallback(lookup->name(), info);
1018  }
1019  if (accessors->IsAccessorPair()) {
1020  Handle<Object> getter(Handle<AccessorPair>::cast(accessors)->getter(),
1021  isolate());
1022  if (!getter->IsJSFunction()) break;
1023  if (!holder->HasFastProperties()) break;
1024  Handle<JSFunction> function = Handle<JSFunction>::cast(getter);
1025  if (!receiver->IsJSObject() && !function->IsBuiltin() &&
1026  function->shared()->strict_mode() == SLOPPY) {
1027  // Calling sloppy non-builtins with a value as the receiver
1028  // requires boxing.
1029  break;
1030  }
1031  CallOptimization call_optimization(function);
1032  NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
1033  cache_holder);
1034  if (call_optimization.is_simple_api_call() &&
1035  call_optimization.IsCompatibleReceiver(receiver, holder)) {
1036  return compiler.CompileLoadCallback(lookup->name(),
1037  call_optimization);
1038  }
1039  return compiler.CompileLoadViaGetter(lookup->name(), function);
1040  }
1041  // TODO(dcarney): Handle correctly.
1042  DCHECK(accessors->IsDeclaredAccessorInfo());
1043  break;
1044  }
1045 
1046  case LookupIterator::DATA: {
1047  if (lookup->is_dictionary_holder()) {
1048  if (kind() != Code::LOAD_IC) break;
1049  if (holder->IsGlobalObject()) {
1050  NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
1051  cache_holder);
1052  Handle<PropertyCell> cell = lookup->GetPropertyCell();
1053  Handle<Code> code = compiler.CompileLoadGlobal(
1054  cell, lookup->name(), lookup->IsConfigurable());
1055  // TODO(verwaest): Move caching of these NORMAL stubs outside as well.
1057  Handle<Map> stub_holder_map = GetHandlerCacheHolder(
1058  *type, receiver_is_holder, isolate(), &flag);
1059  Map::UpdateCodeCache(stub_holder_map, lookup->name(), code);
1060  return code;
1061  }
1062  // There is only one shared stub for loading normalized
1063  // properties. It does not traverse the prototype chain, so the
1064  // property must be found in the object for the stub to be
1065  // applicable.
1066  if (!receiver_is_holder) break;
1067  return isolate()->builtins()->LoadIC_Normal();
1068  }
1069 
1070  // -------------- Fields --------------
1071  if (lookup->property_details().type() == FIELD) {
1072  FieldIndex field = lookup->GetFieldIndex();
1073  if (receiver_is_holder) {
1074  return SimpleFieldLoad(field);
1075  }
1076  NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
1077  cache_holder);
1078  return compiler.CompileLoadField(lookup->name(), field);
1079  }
1080 
1081  // -------------- Constant properties --------------
1082  DCHECK(lookup->property_details().type() == CONSTANT);
1083  if (receiver_is_holder) {
1084  LoadConstantStub stub(isolate(), lookup->GetConstantIndex());
1085  return stub.GetCode();
1086  }
1087  NamedLoadHandlerCompiler compiler(isolate(), receiver_type(), holder,
1088  cache_holder);
1089  return compiler.CompileLoadConstant(lookup->name(),
1090  lookup->GetConstantIndex());
1091  }
1092 
1093  case LookupIterator::ACCESS_CHECK:
1094  case LookupIterator::JSPROXY:
1095  case LookupIterator::NOT_FOUND:
1096  case LookupIterator::TRANSITION:
1097  UNREACHABLE();
1098  }
1099 
1100  return slow_stub();
1101 }
static bool IsCompatibleReceiverType(Isolate *isolate, Handle< AccessorInfo > info, Handle< HeapType > type)
Definition: objects.cc:467
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
Handle< HeapType > receiver_type()
Definition: ic.h:203
Code::Kind kind() const
Definition: ic.h:185
static Handle< Map > GetHandlerCacheHolder(HeapType *type, bool receiver_is_holder, Isolate *isolate, CacheHolderFlag *flag)
Definition: ic-inl.h:177
Builtins * builtins()
Definition: isolate.h:947
Handle< Code > SimpleFieldLoad(FieldIndex index)
Definition: ic.cc:853
Handle< Code > slow_stub() const
Definition: ic.h:365
static void UpdateCodeCache(Handle< Map > map, Handle< Name > name, Handle< Code > code)
Definition: objects.cc:7030
bool Equals(Name *other)
Definition: objects-inl.h:3309
static const int kLengthOffset
Definition: objects.h:8802
#define UNREACHABLE()
Definition: logging.h:30
static void LookupForRead(LookupIterator *it)
Definition: ic.cc:219
kFeedbackVectorOffset flag
Definition: objects-inl.h:5418

References v8::internal::ACCESSOR, v8::internal::Isolate::builtins(), v8::internal::Handle< T >::cast(), v8::internal::NamedLoadHandlerCompiler::CompileLoadCallback(), v8::internal::NamedLoadHandlerCompiler::CompileLoadConstant(), v8::internal::NamedLoadHandlerCompiler::CompileLoadField(), v8::internal::NamedLoadHandlerCompiler::CompileLoadGlobal(), v8::internal::NamedLoadHandlerCompiler::CompileLoadInterceptor(), v8::internal::NamedLoadHandlerCompiler::CompileLoadViaGetter(), v8::internal::CONSTANT, DCHECK, v8::internal::Name::Equals(), v8::internal::FIELD, v8::internal::flag, v8::internal::IC::GetHandlerCacheHolder(), v8::internal::AccessorInfo::IsCompatibleReceiverType(), v8::internal::IC::isolate(), v8::internal::IC::kind(), v8::internal::String::kLengthOffset, v8::internal::LookupForRead(), v8::internal::IC::receiver_type(), SimpleFieldLoad(), v8::internal::SLOPPY, slow_stub(), UNREACHABLE, and v8::internal::Map::UpdateCodeCache().

+ Here is the call graph for this function:

◆ ComputeExtraICState()

static ExtraICState v8::internal::LoadIC::ComputeExtraICState ( ContextualMode  contextual_mode)
inlinestatic

Definition at line 324 of file ic.h.

324  {
325  return LoadICState(contextual_mode).GetExtraICState();
326  }
ContextualMode contextual_mode() const
Definition: ic.h:328

References contextual_mode().

+ Here is the call graph for this function:

◆ contextual_mode()

ContextualMode v8::internal::LoadIC::contextual_mode ( ) const
inline

Definition at line 328 of file ic.h.

328  {
329  return LoadICState::GetContextualMode(extra_ic_state());
330  }
ExtraICState extra_ic_state() const
Definition: ic.h:200

References v8::internal::IC::extra_ic_state().

Referenced by ComputeExtraICState(), IsUndeclaredGlobal(), and v8::internal::ThrowReferenceError().

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

◆ GenerateInitialize()

static void v8::internal::LoadIC::GenerateInitialize ( MacroAssembler masm)
inlinestatic

Definition at line 348 of file ic.h.

348 { GenerateMiss(masm); }
static void GenerateMiss(MacroAssembler *masm)

References GenerateMiss().

Referenced by v8::internal::PropertyICCompiler::CompileLoadInitialize().

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

◆ GenerateMiss()

◆ GenerateNormal()

static void v8::internal::LoadIC::GenerateNormal ( MacroAssembler masm)
static

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

+ Here is the caller graph for this function:

◆ GeneratePreMonomorphic()

static void v8::internal::LoadIC::GeneratePreMonomorphic ( MacroAssembler masm)
inlinestatic

Definition at line 349 of file ic.h.

349  {
350  GenerateMiss(masm);
351  }

References GenerateMiss().

Referenced by v8::internal::PropertyICCompiler::CompileLoadPreMonomorphic().

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

◆ GenerateRuntimeGetProperty()

static void v8::internal::LoadIC::GenerateRuntimeGetProperty ( MacroAssembler masm)
static

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

+ Here is the caller graph for this function:

◆ initialize_stub()

Handle< Code > v8::internal::LoadIC::initialize_stub ( Isolate isolate,
ExtraICState  extra_state 
)
static

Definition at line 815 of file ic.cc.

816  {
818 }
static Handle< Code > ComputeLoad(Isolate *isolate, InlineCacheState ic_state, ExtraICState extra_state)
Definition: ic-compiler.cc:170
@ UNINITIALIZED
Definition: globals.h:446

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

+ Here is the call graph for this function:

◆ IsUndeclaredGlobal()

bool v8::internal::LoadIC::IsUndeclaredGlobal ( Handle< Object receiver)
inline

Definition at line 338 of file ic.h.

338  {
339  if (receiver->IsGlobalObject()) {
340  return contextual_mode() == CONTEXTUAL;
341  } else {
343  return false;
344  }
345  }

References v8::internal::CONTEXTUAL, contextual_mode(), and DCHECK.

Referenced by Load().

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

◆ Load()

MaybeHandle< Object > v8::internal::LoadIC::Load ( Handle< Object object,
Handle< Name name 
)

Definition at line 586 of file ic.cc.

586  {
587  // If the object is undefined or null it's illegal to try to get any
588  // of its properties; throw a TypeError in that case.
589  if (object->IsUndefined() || object->IsNull()) {
590  return TypeError("non_object_property_load", object, name);
591  }
592 
593  // Check if the name is trivially convertible to an index and get
594  // the element or char if so.
595  uint32_t index;
596  if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) {
597  // Rewrite to the generic keyed load stub.
598  if (FLAG_use_ic) {
600  TRACE_IC("LoadIC", name);
601  TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index");
602  }
603  Handle<Object> result;
605  isolate(), result,
606  Runtime::GetElementOrCharAt(isolate(), object, index), Object);
607  return result;
608  }
609 
610  bool use_ic = MigrateDeprecated(object) ? false : FLAG_use_ic;
611 
612  // Named lookup in the object.
613  LookupIterator it(object, name);
614  LookupForRead(&it);
615 
616  if (it.IsFound() || !IsUndeclaredGlobal(object)) {
617  // Update inline cache and stub cache.
618  if (use_ic) UpdateCaches(&it);
619 
620  // Get the property.
621  Handle<Object> result;
623  Object);
624  if (it.IsFound()) {
625  return result;
626  } else if (!IsUndeclaredGlobal(object)) {
627  LOG(isolate(), SuspectReadEvent(*name, *object));
628  return result;
629  }
630  }
631  return ReferenceError("not_defined", name);
632 }
MaybeHandle< Object > TypeError(const char *type, Handle< Object > object, Handle< Object > key)
Definition: ic.cc:340
MaybeHandle< Object > ReferenceError(const char *type, Handle< Name > name)
Definition: ic.cc:348
Handle< Code > generic_stub() const
Definition: ic.h:435
void UpdateCaches(LookupIterator *lookup)
Definition: ic.cc:859
void set_target(Code *code)
Definition: ic-inl.h:130
bool IsUndeclaredGlobal(Handle< Object > receiver)
Definition: ic.h:338
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
Definition: objects.cc:109
static MUST_USE_RESULT MaybeHandle< Object > GetElementOrCharAt(Isolate *isolate, Handle< Object > object, uint32_t index)
Definition: runtime.cc:1850
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
#define TRACE_GENERIC_IC(isolate, type, reason)
Definition: ic.cc:79
#define TRACE_IC(type, name)
Definition: ic.cc:137
#define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T)
Definition: isolate.h:135
#define LOG(isolate, Call)
Definition: log.h:69
kSerializedDataOffset Object
Definition: objects-inl.h:5322
static bool MigrateDeprecated(Handle< Object > object)
Definition: ic.cc:577

References ASSIGN_RETURN_ON_EXCEPTION, false, v8::internal::KeyedLoadIC::generic_stub(), v8::internal::Runtime::GetElementOrCharAt(), v8::internal::Object::GetProperty(), v8::internal::IC::isolate(), IsUndeclaredGlobal(), v8::internal::IC::kind(), LOG, v8::internal::LookupForRead(), v8::internal::MigrateDeprecated(), name, v8::internal::IC::ReferenceError(), set_target(), TRACE_GENERIC_IC, TRACE_IC, v8::internal::IC::TypeError(), and UpdateCaches().

Referenced by v8::internal::KeyedLoadIC::Load(), and v8::internal::RUNTIME_FUNCTION().

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

◆ megamorphic_stub()

Handle< Code > v8::internal::LoadIC::megamorphic_stub ( )
protectedvirtual

Reimplemented from v8::internal::IC.

Definition at line 821 of file ic.cc.

821  {
822  if (kind() == Code::LOAD_IC) {
823  MegamorphicLoadStub stub(isolate(), LoadICState(extra_ic_state()));
824  return stub.GetCode();
825  } else {
826  DCHECK_EQ(Code::KEYED_LOAD_IC, kind());
828  }
829 }
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

References DCHECK_EQ, v8::internal::IC::extra_ic_state(), v8::internal::KeyedLoadIC::generic_stub(), v8::internal::IC::isolate(), and v8::internal::IC::kind().

+ Here is the call graph for this function:

◆ pre_monomorphic_stub() [1/2]

Handle< Code > v8::internal::LoadIC::pre_monomorphic_stub ( ) const
privatevirtual

Reimplemented in v8::internal::KeyedLoadIC.

Definition at line 843 of file ic.cc.

843  {
844  if (kind() == Code::LOAD_IC) {
846  } else {
847  DCHECK_EQ(Code::KEYED_LOAD_IC, kind());
849  }
850 }
virtual Handle< Code > pre_monomorphic_stub() const
Definition: ic.h:430
virtual Handle< Code > pre_monomorphic_stub() const
Definition: ic.cc:843

References DCHECK_EQ, v8::internal::IC::extra_ic_state(), v8::internal::IC::isolate(), v8::internal::IC::kind(), and v8::internal::KeyedLoadIC::pre_monomorphic_stub().

Referenced by v8::internal::KeyedLoadIC::pre_monomorphic_stub(), v8::internal::StoreIC::pre_monomorphic_stub(), v8::internal::KeyedStoreIC::pre_monomorphic_stub(), and UpdateCaches().

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

◆ pre_monomorphic_stub() [2/2]

Handle< Code > v8::internal::LoadIC::pre_monomorphic_stub ( Isolate isolate,
ExtraICState  extra_state 
)
staticprivate

Definition at line 832 of file ic.cc.

833  {
835 }
@ PREMONOMORPHIC
Definition: globals.h:448

References v8::internal::PropertyICCompiler::ComputeLoad(), v8::internal::IC::isolate(), and v8::internal::PREMONOMORPHIC.

+ Here is the call graph for this function:

◆ set_target()

void v8::internal::LoadIC::set_target ( Code code)
inlineprotected

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

130  {
131  // The contextual mode must be preserved across IC patching.
132  DCHECK(LoadICState::GetContextualMode(code->extra_ic_state()) ==
133  LoadICState::GetContextualMode(target()->extra_ic_state()));
134 
135  IC::set_target(code);
136 }
void set_target(Code *code)
Definition: ic-inl.h:121

References DCHECK, v8::internal::Code::extra_ic_state(), v8::internal::IC::extra_ic_state(), v8::internal::IC::set_target(), and v8::internal::IC::target().

Referenced by Load(), v8::internal::KeyedLoadIC::Load(), and UpdateCaches().

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

◆ SimpleFieldLoad()

Handle< Code > v8::internal::LoadIC::SimpleFieldLoad ( FieldIndex  index)
private

Definition at line 853 of file ic.cc.

853  {
854  LoadFieldStub stub(isolate(), index);
855  return stub.GetCode();
856 }

References v8::internal::IC::isolate().

Referenced by CompileHandler().

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

◆ slow_stub()

Handle<Code> v8::internal::LoadIC::slow_stub ( ) const
inlineprotected

Definition at line 365 of file ic.h.

365  {
366  if (kind() == Code::LOAD_IC) {
367  return isolate()->builtins()->LoadIC_Slow();
368  } else {
369  DCHECK_EQ(Code::KEYED_LOAD_IC, kind());
370  return isolate()->builtins()->KeyedLoadIC_Slow();
371  }
372  }

References v8::internal::Isolate::builtins(), DCHECK_EQ, v8::internal::IC::isolate(), and v8::internal::IC::kind().

Referenced by CompileHandler(), and UpdateCaches().

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

◆ UpdateCaches()

void v8::internal::LoadIC::UpdateCaches ( LookupIterator *  lookup)
protected

Definition at line 859 of file ic.cc.

859  {
860  if (state() == UNINITIALIZED) {
861  // This is the first time we execute this inline cache. Set the target to
862  // the pre monomorphic stub to delay setting the monomorphic state.
864  TRACE_IC("LoadIC", lookup->name());
865  return;
866  }
867 
868  Handle<Code> code;
869  if (lookup->state() == LookupIterator::JSPROXY ||
870  lookup->state() == LookupIterator::ACCESS_CHECK) {
871  code = slow_stub();
872  } else if (!lookup->IsFound()) {
873  if (kind() == Code::LOAD_IC) {
875  receiver_type());
876  // TODO(jkummerow/verwaest): Introduce a builtin that handles this case.
877  if (code.is_null()) code = slow_stub();
878  } else {
879  code = slow_stub();
880  }
881  } else {
882  code = ComputeHandler(lookup);
883  }
884 
885  PatchCache(lookup->name(), code);
886  TRACE_IC("LoadIC", lookup->name());
887 }
State state() const
Definition: ic.h:66
void PatchCache(Handle< Name > name, Handle< Code > code)
Definition: ic.cc:787
Handle< Code > ComputeHandler(LookupIterator *lookup, Handle< Object > value=Handle< Code >::null())
Definition: ic.cc:897
static Handle< Code > ComputeLoadNonexistent(Handle< Name > name, Handle< HeapType > type)

References v8::internal::IC::ComputeHandler(), v8::internal::NamedLoadHandlerCompiler::ComputeLoadNonexistent(), v8::internal::Handle< T >::is_null(), v8::internal::IC::kind(), v8::internal::IC::PatchCache(), pre_monomorphic_stub(), v8::internal::IC::receiver_type(), set_target(), slow_stub(), v8::internal::IC::state(), TRACE_IC, and v8::internal::UNINITIALIZED.

Referenced by Load().

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


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