23 if (probe->IsCode())
return handle(Code::cast(probe));
29 for (
int i = 0;
i < types->length(); ++
i) {
30 if (types->
at(
i)->Is(HeapType::Number()))
return true;
43 handlers.
Add(handler);
53 if (handler.is_identical_to(isolate->
builtins()->LoadIC_Normal()) ||
54 handler.is_identical_to(isolate->
builtins()->StoreIC_Normal())) {
65 bool can_be_cached = !type->Is(HeapType::String());
67 ic =
Find(
name, stub_holder, kind, extra_ic_state,
flag);
72 if (kind == Code::KEYED_STORE_IC) {
88 Isolate* isolate = receiver_map->GetIsolate();
95 ElementsKind elements_kind = receiver_map->elements_kind();
97 if (receiver_map->has_indexed_interceptor()) {
99 }
else if (receiver_map->has_sloppy_arguments_elements()) {
101 }
else if (receiver_map->has_fast_elements() ||
102 receiver_map->has_external_array_elements() ||
103 receiver_map->has_fixed_typed_array_elements()) {
106 elements_kind).GetCode();
123 Isolate* isolate = receiver_map->GetIsolate();
153 isolate->
heap()->non_monomorphic_cache();
159 return reinterpret_cast<Code*
>(code);
165 isolate->
factory()->non_monomorphic_cache(), code->flags(), code);
175 isolate->
factory()->non_monomorphic_cache();
176 int entry = cache->FindEntry(isolate,
flags);
177 if (entry != -1)
return Handle<Code>(Code::cast(cache->ValueAt(entry)));
198 isolate->
factory()->non_monomorphic_cache();
199 int entry = cache->FindEntry(isolate,
flags);
200 if (entry != -1)
return Handle<Code>(Code::cast(cache->ValueAt(entry)));
208 }
else if (ic_state ==
GENERIC) {
223 Isolate* isolate = receiver_map->GetIsolate();
225 if (!receiver_map->is_dictionary_map()) {
228 if (!cached_ic.
is_null())
return cached_ic;
232 pattern.
Add(isolate->
factory()->meta_map(), receiver_map);
235 if (!receiver_map->is_dictionary_map()) {
246 Isolate* isolate = receiver_maps->
at(0)->GetIsolate();
249 isolate->
factory()->polymorphic_code_cache();
254 for (
int i = 0;
i < receiver_maps->length();
i++) {
265 isolate->
counters()->keyed_load_polymorphic_stubs()->Increment();
277 DCHECK(kind == Code::LOAD_IC || kind == Code::STORE_IC);
286 Isolate* isolate = receiver_maps->
at(0)->GetIsolate();
292 isolate->
factory()->polymorphic_code_cache();
311 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_INITIALIZE_TAG, *code, 0));
320 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0));
328 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_INITIALIZE_TAG, *code, 0));
337 CodeCreateEvent(Logger::STORE_PREMONOMORPHIC_TAG, *code, 0));
347 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_GENERIC_TAG, *code, 0));
355 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_MEGAMORPHIC_TAG, *code, 0));
377 for (
int i = 0;
i < receiver_maps->length(); ++
i) {
381 receiver_map->FindTransitionedMap(receiver_maps);
388 bool is_js_array = receiver_map->instance_type() ==
JS_ARRAY_TYPE;
389 ElementsKind elements_kind = receiver_map->elements_kind();
390 if (!transitioned_map.
is_null()) {
393 transitioned_map->elements_kind(),
394 is_js_array, store_mode).GetCode();
396 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow();
398 if (receiver_map->has_fast_elements() ||
399 receiver_map->has_external_array_elements() ||
400 receiver_map->has_fixed_typed_array_elements()) {
402 elements_kind, store_mode).GetCode();
408 handlers.
Add(cached_stub);
409 transitioned_maps.
Add(transitioned_map);
414 isolate()->counters()->keyed_store_polymorphic_stubs()->Increment();
420 #define __ ACCESS_MASM(masm())
425 ElementsKind elements_kind = receiver_map->elements_kind();
426 bool is_jsarray = receiver_map->instance_type() ==
JS_ARRAY_TYPE;
428 if (receiver_map->has_fast_elements() ||
429 receiver_map->has_external_array_elements() ||
430 receiver_map->has_fixed_typed_array_elements()) {
432 store_mode).GetCode();
437 __ DispatchMap(receiver(), scratch1(), receiver_map, stub,
DO_SMI_CHECK);
439 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss);
void Add(Handle< Map > map_to_find, Handle< Object > obj_to_replace)
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
static Flags ComputeMonomorphicFlags(Kind kind, ExtraICState extra_ic_state=kNoExtraICState, CacheHolderFlag holder=kCacheOnReceiver, StubType type=NORMAL)
static ExtraICState ExtractExtraICStateFromFlags(Flags flags)
virtual ExtraICState GetExtraICState() const
Object * ValueAt(int entry)
void CompileElementHandlers(MapHandleList *receiver_maps, CodeHandleList *handlers)
static Handle< T > cast(Handle< S > that)
static Handle< T > null()
void public_set_non_monomorphic_cache(UnseededNumberDictionary *value)
static Handle< Map > GetICCacheHolder(HeapType *type, Isolate *isolate, CacheHolderFlag *flag)
static void RegisterWeakMapDependency(Handle< Code > stub)
static ExtraICState ComputeExtraICState(StrictMode flag, KeyedAccessStoreMode mode)
static KeyedAccessStoreMode GetKeyedAccessStoreMode(ExtraICState extra_state)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
static void GeneratePreMonomorphic(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm)
static void UpdateCodeCache(Handle< Map > map, Handle< Name > name, Handle< Code > code)
static void Update(Handle< PolymorphicCodeCache > cache, MapHandleList *maps, Code::Flags flags, Handle< Code > code)
static Handle< Code > ComputeKeyedLoadMonomorphic(Handle< Map > receiver_map)
static Handle< Code > Find(Handle< Name > name, Handle< Map > stub_holder_map, Code::Kind kind, ExtraICState extra_ic_state=kNoExtraICState, CacheHolderFlag cache_holder=kCacheOnReceiver)
const ExtraICState extra_ic_state_
Handle< Code > CompileStoreMegamorphic(Code::Flags flags)
static Handle< Code > ComputeMonomorphic(Code::Kind kind, Handle< Name > name, Handle< HeapType > type, Handle< Code > handler, ExtraICState extra_ic_state)
Handle< Code > CompileStoreInitialize(Code::Flags flags)
Handle< Code > GetCode(Code::Kind kind, Code::StubType type, Handle< Name > name, InlineCacheState state=MONOMORPHIC)
static Handle< Code > ComputePolymorphic(Code::Kind kind, TypeHandleList *types, CodeHandleList *handlers, int number_of_valid_maps, Handle< Name > name, ExtraICState extra_ic_state)
Handle< Code > CompileKeyedStorePolymorphic(MapHandleList *receiver_maps, KeyedAccessStoreMode store_mode)
Handle< Code > CompileKeyedStoreMonomorphic(Handle< Map > receiver_map, KeyedAccessStoreMode store_mode)
Handle< Code > CompileLoadPreMonomorphic(Code::Flags flags)
Handle< Code > CompileStorePreMonomorphic(Code::Flags flags)
static Handle< Code > ComputeLoad(Isolate *isolate, InlineCacheState ic_state, ExtraICState extra_state)
static Handle< Code > ComputeKeyedStorePolymorphic(MapHandleList *receiver_maps, KeyedAccessStoreMode store_mode, StrictMode strict_mode)
bool IncludesNumberType(TypeHandleList *types)
static Handle< Code > ComputeCompareNil(Handle< Map > receiver_map, CompareNilICStub *stub)
Handle< Code > CompileStoreGeneric(Code::Flags flags)
static void GenerateRuntimeSetProperty(MacroAssembler *masm, StrictMode strict_mode)
Logger::LogEventsAndTags log_kind(Handle< Code > code)
static Handle< Code > ComputeStore(Isolate *isolate, InlineCacheState ic_state, ExtraICState extra_state)
static Code * FindPreMonomorphic(Isolate *isolate, Code::Kind kind, ExtraICState extra_ic_state)
static Handle< Code > ComputeKeyedLoadPolymorphic(MapHandleList *receiver_maps)
Handle< Code > CompileLoadInitialize(Code::Flags flags)
static Handle< Code > ComputeKeyedStoreMonomorphic(Handle< Map > receiver_map, StrictMode strict_mode, KeyedAccessStoreMode store_mode)
Handle< Code > CompileMonomorphic(Handle< HeapType > type, Handle< Code > handler, Handle< Name > name, IcCheckType check)
Handle< Code > CompilePolymorphic(TypeHandleList *types, CodeHandleList *handlers, Handle< Name > name, Code::StubType type, IcCheckType check)
static void GeneratePreMonomorphic(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm)
static StrictMode GetStrictMode(ExtraICState state)
static void GenerateMegamorphic(MacroAssembler *masm)
static TypeHandle Class(i::Handle< i::Map > map, Region *region)
static MUST_USE_RESULT Handle< UnseededNumberDictionary > Set(Handle< UnseededNumberDictionary > dictionary, uint32_t key, Handle< Object > value)
#define PROFILE(IsolateGetter, Call)
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 DCHECK(condition)
@ STORE_AND_GROW_NO_TRANSITION
@ STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS
@ STORE_NO_TRANSITION_HANDLE_COW
Handle< T > handle(T *t, Isolate *isolate)
static void FillCache(Isolate *isolate, Handle< Code > code)
kFeedbackVectorOffset flag
Debugger support for the V8 JavaScript engine.