Commit 579dbe40 authored by verwaest@chromium.org's avatar verwaest@chromium.org

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
parent cc532e44
......@@ -941,8 +941,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
Handle<HeapType> type = receiver_type();
Handle<JSObject> 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<Code> StoreIC::CompileHandler(LookupResult* lookup,
Handle<JSObject> receiver = Handle<JSObject>::cast(object);
Handle<JSObject> holder(lookup->holder());
NamedStoreHandlerCompiler compiler(isolate(), kind());
NamedStoreHandlerCompiler compiler(isolate());
if (lookup->IsTransition()) {
// Explicitly pass in the receiver map since LookupForWrite may have
......
......@@ -195,13 +195,11 @@ Handle<Code> StubCache::ComputeLoadNonexistent(Handle<Name> 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<Code> 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<Code> PropertyICCompiler::GetCode(Code::Kind kind, Code::StubType type,
Handle<Name> 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> code = GetCodeWithFlags(flags, name);
IC::RegisterWeakMapDependency(code);
PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
......@@ -1148,7 +1146,6 @@ Handle<Code> PropertyICCompiler::GetCode(Code::Kind kind, Code::StubType type,
Handle<Code> PropertyHandlerCompiler::GetCode(Code::Kind kind,
Code::StubType type,
Handle<Name> name) {
ASSERT_EQ(kNoExtraICState, extra_state());
Code::Flags flags = Code::ComputeHandlerFlags(kind, type, cache_holder());
Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, *name));
......
......@@ -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<Code> Find(Handle<Name> name, Handle<Map> stub_holder_map,
Code::Kind kind,
ExtraICState extra_state = kNoExtraICState,
ExtraICState extra_ic_state = kNoExtraICState,
CacheHolderFlag cache_holder = kCacheOnReceiver);
Handle<Code> CompileLoadInitialize(Code::Flags flags);
......@@ -397,6 +394,7 @@ class PropertyICCompiler : public PropertyAccessCompiler {
Handle<Code> 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() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment