From f15373fdabe08738336305f32aeda39467ebc628 Mon Sep 17 00:00:00 2001 From: ishell Date: Thu, 10 Nov 2016 04:39:09 -0800 Subject: [PATCH] [ic] Detailize some elements store specific runtime call stats counters. BUG=v8:5561 Review-Url: https://codereview.chromium.org/2489293002 Cr-Commit-Position: refs/heads/master@{#40890} --- src/counters.h | 129 +++++++++++++++++++++--------------------- src/ic/ic-compiler.cc | 20 +++---- src/ic/ic.cc | 1 - 3 files changed, 72 insertions(+), 78 deletions(-) diff --git a/src/counters.h b/src/counters.h index 8d73d095c7..06181c4a72 100644 --- a/src/counters.h +++ b/src/counters.h @@ -735,70 +735,71 @@ class RuntimeCallTimer { /* Dummy counter for the unexpected stub miss. */ \ V(UnexpectedStubMiss) -#define FOR_EACH_HANDLER_COUNTER(V) \ - V(IC_HandlerCacheHit) \ - V(KeyedLoadIC_LoadIndexedStringStub) \ - V(KeyedLoadIC_LoadIndexedInterceptorStub) \ - V(KeyedLoadIC_KeyedLoadSloppyArgumentsStub) \ - V(KeyedLoadIC_LoadElementDH) \ - V(KeyedLoadIC_LoadFastElementStub) \ - V(KeyedLoadIC_LoadDictionaryElementStub) \ - V(KeyedLoadIC_SlowStub) \ - V(KeyedStoreIC_KeyedStoreSloppyArgumentsStub) \ - V(KeyedStoreIC_StoreFastElementStub) \ - V(KeyedStoreIC_StoreElementStub) \ - V(KeyedStoreIC_Polymorphic) \ - V(LoadIC_FunctionPrototypeStub) \ - V(LoadIC_HandlerCacheHit_AccessCheck) \ - V(LoadIC_HandlerCacheHit_Exotic) \ - V(LoadIC_HandlerCacheHit_Interceptor) \ - V(LoadIC_HandlerCacheHit_JSProxy) \ - V(LoadIC_HandlerCacheHit_NonExistent) \ - V(LoadIC_HandlerCacheHit_Accessor) \ - V(LoadIC_HandlerCacheHit_Data) \ - V(LoadIC_HandlerCacheHit_Transition) \ - V(LoadIC_LoadApiGetterDH) \ - V(LoadIC_LoadApiGetterFromPrototypeDH) \ - V(LoadIC_LoadApiGetterStub) \ - V(LoadIC_LoadCallback) \ - V(LoadIC_LoadConstantDH) \ - V(LoadIC_LoadConstantFromPrototypeDH) \ - V(LoadIC_LoadConstant) \ - V(LoadIC_LoadConstantStub) \ - V(LoadIC_LoadFieldDH) \ - V(LoadIC_LoadFieldFromPrototypeDH) \ - V(LoadIC_LoadField) \ - V(LoadIC_LoadFieldStub) \ - V(LoadIC_LoadGlobal) \ - V(LoadIC_LoadInterceptor) \ - V(LoadIC_LoadNonexistentDH) \ - V(LoadIC_LoadNonexistent) \ - V(LoadIC_LoadNormal) \ - V(LoadIC_LoadScriptContextFieldStub) \ - V(LoadIC_LoadViaGetter) \ - V(LoadIC_Premonomorphic) \ - V(LoadIC_SlowStub) \ - V(LoadIC_StringLengthStub) \ - V(StoreIC_HandlerCacheHit_AccessCheck) \ - V(StoreIC_HandlerCacheHit_Exotic) \ - V(StoreIC_HandlerCacheHit_Interceptor) \ - V(StoreIC_HandlerCacheHit_JSProxy) \ - V(StoreIC_HandlerCacheHit_NonExistent) \ - V(StoreIC_HandlerCacheHit_Accessor) \ - V(StoreIC_HandlerCacheHit_Data) \ - V(StoreIC_HandlerCacheHit_Transition) \ - V(StoreIC_Premonomorphic) \ - V(StoreIC_SlowStub) \ - V(StoreIC_StoreCallback) \ - V(StoreIC_StoreField) \ - V(StoreIC_StoreFieldDH) \ - V(StoreIC_StoreFieldStub) \ - V(StoreIC_StoreGlobal) \ - V(StoreIC_StoreGlobalTransition) \ - V(StoreIC_StoreInterceptorStub) \ - V(StoreIC_StoreNormal) \ - V(StoreIC_StoreScriptContextFieldStub) \ - V(StoreIC_StoreTransition) \ +#define FOR_EACH_HANDLER_COUNTER(V) \ + V(IC_HandlerCacheHit) \ + V(KeyedLoadIC_LoadIndexedStringStub) \ + V(KeyedLoadIC_LoadIndexedInterceptorStub) \ + V(KeyedLoadIC_KeyedLoadSloppyArgumentsStub) \ + V(KeyedLoadIC_LoadElementDH) \ + V(KeyedLoadIC_LoadFastElementStub) \ + V(KeyedLoadIC_LoadDictionaryElementStub) \ + V(KeyedLoadIC_SlowStub) \ + V(KeyedStoreIC_ElementsTransitionAndStoreStub) \ + V(KeyedStoreIC_KeyedStoreSloppyArgumentsStub) \ + V(KeyedStoreIC_SlowStub) \ + V(KeyedStoreIC_StoreFastElementStub) \ + V(KeyedStoreIC_StoreElementStub) \ + V(LoadIC_FunctionPrototypeStub) \ + V(LoadIC_HandlerCacheHit_AccessCheck) \ + V(LoadIC_HandlerCacheHit_Exotic) \ + V(LoadIC_HandlerCacheHit_Interceptor) \ + V(LoadIC_HandlerCacheHit_JSProxy) \ + V(LoadIC_HandlerCacheHit_NonExistent) \ + V(LoadIC_HandlerCacheHit_Accessor) \ + V(LoadIC_HandlerCacheHit_Data) \ + V(LoadIC_HandlerCacheHit_Transition) \ + V(LoadIC_LoadApiGetterDH) \ + V(LoadIC_LoadApiGetterFromPrototypeDH) \ + V(LoadIC_LoadApiGetterStub) \ + V(LoadIC_LoadCallback) \ + V(LoadIC_LoadConstantDH) \ + V(LoadIC_LoadConstantFromPrototypeDH) \ + V(LoadIC_LoadConstant) \ + V(LoadIC_LoadConstantStub) \ + V(LoadIC_LoadFieldDH) \ + V(LoadIC_LoadFieldFromPrototypeDH) \ + V(LoadIC_LoadField) \ + V(LoadIC_LoadFieldStub) \ + V(LoadIC_LoadGlobal) \ + V(LoadIC_LoadInterceptor) \ + V(LoadIC_LoadNonexistentDH) \ + V(LoadIC_LoadNonexistent) \ + V(LoadIC_LoadNormal) \ + V(LoadIC_LoadScriptContextFieldStub) \ + V(LoadIC_LoadViaGetter) \ + V(LoadIC_Premonomorphic) \ + V(LoadIC_SlowStub) \ + V(LoadIC_StringLengthStub) \ + V(StoreIC_HandlerCacheHit_AccessCheck) \ + V(StoreIC_HandlerCacheHit_Exotic) \ + V(StoreIC_HandlerCacheHit_Interceptor) \ + V(StoreIC_HandlerCacheHit_JSProxy) \ + V(StoreIC_HandlerCacheHit_NonExistent) \ + V(StoreIC_HandlerCacheHit_Accessor) \ + V(StoreIC_HandlerCacheHit_Data) \ + V(StoreIC_HandlerCacheHit_Transition) \ + V(StoreIC_Premonomorphic) \ + V(StoreIC_SlowStub) \ + V(StoreIC_StoreCallback) \ + V(StoreIC_StoreField) \ + V(StoreIC_StoreFieldDH) \ + V(StoreIC_StoreFieldStub) \ + V(StoreIC_StoreGlobal) \ + V(StoreIC_StoreGlobalTransition) \ + V(StoreIC_StoreInterceptorStub) \ + V(StoreIC_StoreNormal) \ + V(StoreIC_StoreScriptContextFieldStub) \ + V(StoreIC_StoreTransition) \ V(StoreIC_StoreViaSetter) class RuntimeCallStats { diff --git a/src/ic/ic-compiler.cc b/src/ic/ic-compiler.cc index 2f0633e0d8..750c88daa9 100644 --- a/src/ic/ic-compiler.cc +++ b/src/ic/ic-compiler.cc @@ -56,9 +56,11 @@ void PropertyICCompiler::CompileKeyedStorePolymorphicHandlers( // Tracking to do a better job of ensuring the data types are what they need // to be. Not all the elements are in place yet, pessimistic elements // transitions are still important for performance. - bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; - ElementsKind elements_kind = receiver_map->elements_kind(); if (!transitioned_map.is_null()) { + bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; + ElementsKind elements_kind = receiver_map->elements_kind(); + TRACE_HANDLER_STATS(isolate(), + KeyedStoreIC_ElementsTransitionAndStoreStub); cached_stub = ElementsTransitionAndStoreStub(isolate(), elements_kind, transitioned_map->elements_kind(), @@ -66,19 +68,11 @@ void PropertyICCompiler::CompileKeyedStorePolymorphicHandlers( } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { // TODO(mvstanton): Consider embedding store_mode in the state of the slow // keyed store ic for uniformity. + TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_SlowStub); cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); } else { - if (IsSloppyArgumentsElements(elements_kind)) { - cached_stub = - KeyedStoreSloppyArgumentsStub(isolate(), store_mode).GetCode(); - } else if (receiver_map->has_fast_elements() || - receiver_map->has_fixed_typed_array_elements()) { - cached_stub = StoreFastElementStub(isolate(), is_js_array, - elements_kind, store_mode).GetCode(); - } else { - cached_stub = - StoreElementStub(isolate(), elements_kind, store_mode).GetCode(); - } + cached_stub = + CompileKeyedStoreMonomorphicHandler(receiver_map, store_mode); } DCHECK(!cached_stub.is_null()); handlers->Add(cached_stub); diff --git a/src/ic/ic.cc b/src/ic/ic.cc index 4fe97142f8..9553613b06 100644 --- a/src/ic/ic.cc +++ b/src/ic/ic.cc @@ -2282,7 +2282,6 @@ void KeyedStoreIC::UpdateStoreElement(Handle receiver_map, } } - TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_Polymorphic); MapHandleList transitioned_maps(target_receiver_maps.length()); CodeHandleList handlers(target_receiver_maps.length()); PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers(