From 579dbe40be840d63da11ff888f945e2e49af7f08 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Mon, 28 Jul 2014 10:55:32 +0000 Subject: [PATCH] Move extra_ic_state to the PropertyICCompiler BUG= R=ishell@chromium.org Review URL: https://codereview.chromium.org/426593002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ic.cc | 5 ++--- src/stub-cache.cc | 9 +++------ src/stub-cache.h | 29 +++++++++++------------------ 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/ic.cc b/src/ic.cc index 88c141323..66f057440 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -941,8 +941,7 @@ Handle LoadIC::CompileHandler(LookupResult* lookup, Handle object, Handle type = receiver_type(); Handle holder(lookup->holder()); bool receiver_is_holder = object.is_identical_to(holder); - NamedLoadHandlerCompiler compiler(isolate(), handler_kind(), kNoExtraICState, - cache_holder); + NamedLoadHandlerCompiler compiler(isolate(), cache_holder); switch (lookup->type()) { case FIELD: { @@ -1392,7 +1391,7 @@ Handle StoreIC::CompileHandler(LookupResult* lookup, Handle receiver = Handle::cast(object); Handle holder(lookup->holder()); - NamedStoreHandlerCompiler compiler(isolate(), kind()); + NamedStoreHandlerCompiler compiler(isolate()); if (lookup->IsTransition()) { // Explicitly pass in the receiver map since LookupForWrite may have diff --git a/src/stub-cache.cc b/src/stub-cache.cc index 0a28ae317..841f838ba 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -195,13 +195,11 @@ Handle StubCache::ComputeLoadNonexistent(Handle name, } // Compile the stub that is either shared for all names or // name specific if there are global objects involved. - Code::Kind handler_kind = Code::LOAD_IC; Handle handler = PropertyHandlerCompiler::Find( - cache_name, stub_holder_map, handler_kind, flag, Code::FAST); + cache_name, stub_holder_map, Code::LOAD_IC, flag, Code::FAST); if (!handler.is_null()) return handler; - NamedLoadHandlerCompiler compiler(isolate_, handler_kind, kNoExtraICState, - flag); + NamedLoadHandlerCompiler compiler(isolate_, flag); handler = compiler.CompileLoadNonexistent(type, last, cache_name); Map::UpdateCodeCache(stub_holder_map, cache_name, handler); return handler; @@ -1137,7 +1135,7 @@ Handle PropertyICCompiler::GetCode(Code::Kind kind, Code::StubType type, Handle name, InlineCacheState state) { Code::Flags flags = - Code::ComputeFlags(kind, state, extra_state(), type, cache_holder()); + Code::ComputeFlags(kind, state, extra_ic_state_, type, cache_holder()); Handle code = GetCodeWithFlags(flags, name); IC::RegisterWeakMapDependency(code); PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name)); @@ -1148,7 +1146,6 @@ Handle PropertyICCompiler::GetCode(Code::Kind kind, Code::StubType type, Handle PropertyHandlerCompiler::GetCode(Code::Kind kind, Code::StubType type, Handle name) { - ASSERT_EQ(kNoExtraICState, extra_state()); Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder()); Handle code = GetCodeWithFlags(flags, name); PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, *name)); diff --git a/src/stub-cache.h b/src/stub-cache.h index 054c6ccc2..7851a2bc5 100644 --- a/src/stub-cache.h +++ b/src/stub-cache.h @@ -289,18 +289,15 @@ class PropertyAccessCompiler BASE_EMBEDDED { protected: PropertyAccessCompiler(Isolate* isolate, Code::Kind kind, - ExtraICState extra_ic_state, CacheHolderFlag cache_holder) : registers_(GetCallingConvention(kind)), kind_(kind), cache_holder_(cache_holder), isolate_(isolate), - extra_ic_state_(extra_ic_state), masm_(isolate, NULL, 256) {} Code::Kind kind() const { return kind_; } CacheHolderFlag cache_holder() const { return cache_holder_; } - ExtraICState extra_state() const { return extra_ic_state_; } MacroAssembler* masm() { return &masm_; } Isolate* isolate() const { return isolate_; } Heap* heap() const { return isolate()->heap(); } @@ -332,7 +329,6 @@ class PropertyAccessCompiler BASE_EMBEDDED { CacheHolderFlag cache_holder_; Isolate* isolate_; - const ExtraICState extra_ic_state_; MacroAssembler masm_; }; @@ -342,11 +338,12 @@ class PropertyICCompiler : public PropertyAccessCompiler { PropertyICCompiler(Isolate* isolate, Code::Kind kind, ExtraICState extra_ic_state = kNoExtraICState, CacheHolderFlag cache_holder = kCacheOnReceiver) - : PropertyAccessCompiler(isolate, kind, extra_ic_state, cache_holder) {} + : PropertyAccessCompiler(isolate, kind, cache_holder), + extra_ic_state_(extra_ic_state) {} static Handle Find(Handle name, Handle stub_holder_map, Code::Kind kind, - ExtraICState extra_state = kNoExtraICState, + ExtraICState extra_ic_state = kNoExtraICState, CacheHolderFlag cache_holder = kCacheOnReceiver); Handle CompileLoadInitialize(Code::Flags flags); @@ -397,6 +394,7 @@ class PropertyICCompiler : public PropertyAccessCompiler { Handle CompileIndexedStorePolymorphic(MapHandleList* receiver_maps, CodeHandleList* handler_stubs, MapHandleList* transitioned_maps); + const ExtraICState extra_ic_state_; }; @@ -407,9 +405,8 @@ class PropertyHandlerCompiler : public PropertyAccessCompiler { protected: PropertyHandlerCompiler(Isolate* isolate, Code::Kind kind, - ExtraICState extra_ic_state, CacheHolderFlag cache_holder) - : PropertyAccessCompiler(isolate, kind, extra_ic_state, cache_holder) {} + : PropertyAccessCompiler(isolate, kind, cache_holder) {} virtual ~PropertyHandlerCompiler() {} @@ -481,10 +478,9 @@ class PropertyHandlerCompiler : public PropertyAccessCompiler { class NamedLoadHandlerCompiler : public PropertyHandlerCompiler { public: - NamedLoadHandlerCompiler(Isolate* isolate, Code::Kind kind = Code::LOAD_IC, - ExtraICState extra_ic_state = kNoExtraICState, + NamedLoadHandlerCompiler(Isolate* isolate, CacheHolderFlag cache_holder = kCacheOnReceiver) - : PropertyHandlerCompiler(isolate, kind, extra_ic_state, cache_holder) {} + : PropertyHandlerCompiler(isolate, Code::LOAD_IC, cache_holder) {} virtual ~NamedLoadHandlerCompiler() {} @@ -594,10 +590,8 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler { class NamedStoreHandlerCompiler : public PropertyHandlerCompiler { public: - NamedStoreHandlerCompiler(Isolate* isolate, Code::Kind kind = Code::STORE_IC) - // Handlers do not use strict mode. - : PropertyHandlerCompiler(isolate, kind, kNoExtraICState, - kCacheOnReceiver) {} + explicit NamedStoreHandlerCompiler(Isolate* isolate) + : PropertyHandlerCompiler(isolate, Code::STORE_IC, kCacheOnReceiver) {} virtual ~NamedStoreHandlerCompiler() {} @@ -696,9 +690,8 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler { class IndexedHandlerCompiler : public PropertyHandlerCompiler { public: - IndexedHandlerCompiler(Isolate* isolate, - ExtraICState extra_ic_state = kNoExtraICState) - : PropertyHandlerCompiler(isolate, Code::KEYED_LOAD_IC, extra_ic_state, + explicit IndexedHandlerCompiler(Isolate* isolate) + : PropertyHandlerCompiler(isolate, Code::KEYED_LOAD_IC, kCacheOnReceiver) {} virtual ~IndexedHandlerCompiler() {} -- 2.34.1