Removed pieces of extra_ic_state scattered around the stub compiler class...

Removed pieces of extra_ic_state scattered around the stub compiler class hierarchy, and pushed down to a extra_ic_state in the base class.

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/98853002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a3d1df29
...@@ -1547,7 +1547,7 @@ void CallStubCompiler::GenerateMissBranch() { ...@@ -1547,7 +1547,7 @@ void CallStubCompiler::GenerateMissBranch() {
Handle<Code> code = Handle<Code> code =
isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(), isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
kind_, kind_,
extra_state_); extra_state());
__ Jump(code, RelocInfo::CODE_TARGET); __ Jump(code, RelocInfo::CODE_TARGET);
} }
...@@ -1938,7 +1938,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( ...@@ -1938,7 +1938,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2004,7 +2004,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( ...@@ -2004,7 +2004,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
Label index_out_of_range; Label index_out_of_range;
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2466,7 +2466,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, ...@@ -2466,7 +2466,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
// Get the receiver from the stack. // Get the receiver from the stack.
__ ldr(r1, MemOperand(sp, argc * kPointerSize)); __ ldr(r1, MemOperand(sp, argc * kPointerSize));
CallInterceptorCompiler compiler(this, arguments(), r2, extra_state_); CallInterceptorCompiler compiler(this, arguments(), r2, extra_state());
compiler.Compile(masm(), object, holder, name, &lookup, r1, r3, r4, r0, compiler.Compile(masm(), object, holder, name, &lookup, r1, r3, r4, r0,
&miss); &miss);
......
...@@ -1639,7 +1639,7 @@ void CallStubCompiler::GenerateMissBranch() { ...@@ -1639,7 +1639,7 @@ void CallStubCompiler::GenerateMissBranch() {
Handle<Code> code = Handle<Code> code =
isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(), isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
kind_, kind_,
extra_state_); extra_state());
__ jmp(code, RelocInfo::CODE_TARGET); __ jmp(code, RelocInfo::CODE_TARGET);
} }
...@@ -2033,7 +2033,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( ...@@ -2033,7 +2033,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2099,7 +2099,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( ...@@ -2099,7 +2099,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2589,7 +2589,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, ...@@ -2589,7 +2589,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
// Get the receiver from the stack. // Get the receiver from the stack.
__ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
CallInterceptorCompiler compiler(this, arguments(), ecx, extra_state_); CallInterceptorCompiler compiler(this, arguments(), ecx, extra_state());
compiler.Compile(masm(), object, holder, name, &lookup, edx, ebx, edi, eax, compiler.Compile(masm(), object, holder, name, &lookup, edx, ebx, edi, eax,
&miss); &miss);
......
...@@ -1205,7 +1205,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1205,7 +1205,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
Handle<Type> type = CurrentTypeOf(object, isolate()); Handle<Type> type = CurrentTypeOf(object, isolate());
Handle<JSObject> holder(lookup->holder()); Handle<JSObject> holder(lookup->holder());
LoadStubCompiler compiler(isolate(), cache_holder, kind()); LoadStubCompiler compiler(isolate(), kNoExtraICState, cache_holder, kind());
switch (lookup->type()) { switch (lookup->type()) {
case FIELD: { case FIELD: {
......
...@@ -1533,7 +1533,7 @@ void CallStubCompiler::GenerateMissBranch() { ...@@ -1533,7 +1533,7 @@ void CallStubCompiler::GenerateMissBranch() {
Handle<Code> code = Handle<Code> code =
isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(), isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
kind_, kind_,
extra_state_); extra_state());
__ Jump(code, RelocInfo::CODE_TARGET); __ Jump(code, RelocInfo::CODE_TARGET);
} }
...@@ -1923,7 +1923,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( ...@@ -1923,7 +1923,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -1987,7 +1987,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( ...@@ -1987,7 +1987,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
Label index_out_of_range; Label index_out_of_range;
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2463,7 +2463,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, ...@@ -2463,7 +2463,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
// Get the receiver from the stack. // Get the receiver from the stack.
__ lw(a1, MemOperand(sp, argc * kPointerSize)); __ lw(a1, MemOperand(sp, argc * kPointerSize));
CallInterceptorCompiler compiler(this, arguments(), a2, extra_state_); CallInterceptorCompiler compiler(this, arguments(), a2, extra_state());
compiler.Compile(masm(), object, holder, name, &lookup, a1, a3, t0, a0, compiler.Compile(masm(), object, holder, name, &lookup, a1, a3, t0, a0,
&miss); &miss);
......
...@@ -152,13 +152,13 @@ Handle<Code> StubCache::ComputeMonomorphicIC( ...@@ -152,13 +152,13 @@ Handle<Code> StubCache::ComputeMonomorphicIC(
KeyedLoadStubCompiler ic_compiler(isolate(), flag); KeyedLoadStubCompiler ic_compiler(isolate(), flag);
ic = ic_compiler.CompileMonomorphicIC(type, handler, name); ic = ic_compiler.CompileMonomorphicIC(type, handler, name);
} else if (kind == Code::STORE_IC) { } else if (kind == Code::STORE_IC) {
StrictModeFlag strict_mode = StoreIC::GetStrictMode(extra_ic_state); StoreStubCompiler ic_compiler(isolate(), extra_ic_state);
StoreStubCompiler ic_compiler(isolate(), strict_mode);
ic = ic_compiler.CompileMonomorphicIC(type, handler, name); ic = ic_compiler.CompileMonomorphicIC(type, handler, name);
} else { } else {
ASSERT(kind == Code::KEYED_STORE_IC); ASSERT(kind == Code::KEYED_STORE_IC);
StrictModeFlag strict_mode = StoreIC::GetStrictMode(extra_ic_state); ASSERT(STANDARD_STORE ==
KeyedStoreStubCompiler ic_compiler(isolate(), strict_mode, STANDARD_STORE); KeyedStoreIC::GetKeyedAccessStoreMode(extra_ic_state));
KeyedStoreStubCompiler ic_compiler(isolate(), extra_ic_state);
ic = ic_compiler.CompileMonomorphicIC(type, handler, name); ic = ic_compiler.CompileMonomorphicIC(type, handler, name);
} }
...@@ -236,7 +236,7 @@ Handle<Code> StubCache::ComputeKeyedStoreElement( ...@@ -236,7 +236,7 @@ Handle<Code> StubCache::ComputeKeyedStoreElement(
Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate_); Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe); if (probe->IsCode()) return Handle<Code>::cast(probe);
KeyedStoreStubCompiler compiler(isolate(), strict_mode, store_mode); KeyedStoreStubCompiler compiler(isolate(), extra_state);
Handle<Code> code = compiler.CompileStoreElement(receiver_map); Handle<Code> code = compiler.CompileStoreElement(receiver_map);
Map::UpdateCodeCache(receiver_map, name, code); Map::UpdateCodeCache(receiver_map, name, code);
...@@ -647,7 +647,7 @@ Handle<Code> StubCache::ComputeStoreElementPolymorphic( ...@@ -647,7 +647,7 @@ Handle<Code> StubCache::ComputeStoreElementPolymorphic(
Handle<Object> probe = cache->Lookup(receiver_maps, flags); Handle<Object> probe = cache->Lookup(receiver_maps, flags);
if (probe->IsCode()) return Handle<Code>::cast(probe); if (probe->IsCode()) return Handle<Code>::cast(probe);
KeyedStoreStubCompiler compiler(isolate_, strict_mode, store_mode); KeyedStoreStubCompiler compiler(isolate_, extra_state);
Handle<Code> code = compiler.CompileStoreElementPolymorphic(receiver_maps); Handle<Code> code = compiler.CompileStoreElementPolymorphic(receiver_maps);
PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); PolymorphicCodeCache::Update(cache, receiver_maps, flags, code);
return code; return code;
...@@ -1129,7 +1129,7 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, ...@@ -1129,7 +1129,7 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
CallKind CallStubCompiler::call_kind() { CallKind CallStubCompiler::call_kind() {
return CallICBase::Contextual::decode(extra_state_) return CallICBase::Contextual::decode(extra_state())
? CALL_AS_FUNCTION ? CALL_AS_FUNCTION
: CALL_AS_METHOD; : CALL_AS_METHOD;
} }
...@@ -1577,11 +1577,11 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElement( ...@@ -1577,11 +1577,11 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(
stub = KeyedStoreFastElementStub( stub = KeyedStoreFastElementStub(
is_jsarray, is_jsarray,
elements_kind, elements_kind,
store_mode_).GetCode(isolate()); store_mode()).GetCode(isolate());
} else { } else {
stub = KeyedStoreElementStub(is_jsarray, stub = KeyedStoreElementStub(is_jsarray,
elements_kind, elements_kind,
store_mode_).GetCode(isolate()); store_mode()).GetCode(isolate());
} }
__ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK); __ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK);
...@@ -1707,19 +1707,19 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElementPolymorphic( ...@@ -1707,19 +1707,19 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElementPolymorphic(
elements_kind, elements_kind,
transitioned_map->elements_kind(), transitioned_map->elements_kind(),
is_js_array, is_js_array,
store_mode_).GetCode(isolate()); store_mode()).GetCode(isolate());
} else { } else {
if (receiver_map->has_fast_elements() || if (receiver_map->has_fast_elements() ||
receiver_map->has_external_array_elements()) { receiver_map->has_external_array_elements()) {
cached_stub = KeyedStoreFastElementStub( cached_stub = KeyedStoreFastElementStub(
is_js_array, is_js_array,
elements_kind, elements_kind,
store_mode_).GetCode(isolate()); store_mode()).GetCode(isolate());
} else { } else {
cached_stub = KeyedStoreElementStub( cached_stub = KeyedStoreElementStub(
is_js_array, is_js_array,
elements_kind, elements_kind,
store_mode_).GetCode(isolate()); store_mode()).GetCode(isolate());
} }
} }
ASSERT(!cached_stub.is_null()); ASSERT(!cached_stub.is_null());
...@@ -1746,10 +1746,9 @@ CallStubCompiler::CallStubCompiler(Isolate* isolate, ...@@ -1746,10 +1746,9 @@ CallStubCompiler::CallStubCompiler(Isolate* isolate,
Code::Kind kind, Code::Kind kind,
ExtraICState extra_state, ExtraICState extra_state,
InlineCacheHolderFlag cache_holder) InlineCacheHolderFlag cache_holder)
: StubCompiler(isolate), : StubCompiler(isolate, extra_state),
arguments_(argc), arguments_(argc),
kind_(kind), kind_(kind),
extra_state_(extra_state),
cache_holder_(cache_holder) { cache_holder_(cache_holder) {
} }
...@@ -1817,7 +1816,7 @@ Handle<Code> CallStubCompiler::GetCode(Code::StubType type, ...@@ -1817,7 +1816,7 @@ Handle<Code> CallStubCompiler::GetCode(Code::StubType type,
Handle<Name> name) { Handle<Name> name) {
int argc = arguments_.immediate(); int argc = arguments_.immediate();
Code::Flags flags = Code::ComputeMonomorphicFlags( Code::Flags flags = Code::ComputeMonomorphicFlags(
kind_, extra_state_, cache_holder_, type, argc); kind_, extra_state(), cache_holder_, type, argc);
return GetCodeWithFlags(flags, name); return GetCodeWithFlags(flags, name);
} }
......
...@@ -364,8 +364,10 @@ enum IcCheckType { ELEMENT, PROPERTY }; ...@@ -364,8 +364,10 @@ enum IcCheckType { ELEMENT, PROPERTY };
// The stub compilers compile stubs for the stub cache. // The stub compilers compile stubs for the stub cache.
class StubCompiler BASE_EMBEDDED { class StubCompiler BASE_EMBEDDED {
public: public:
explicit StubCompiler(Isolate* isolate) explicit StubCompiler(Isolate* isolate,
: isolate_(isolate), masm_(isolate, NULL, 256), failure_(NULL) { } ExtraICState extra_ic_state = kNoExtraICState)
: isolate_(isolate), extra_ic_state_(extra_ic_state),
masm_(isolate, NULL, 256), failure_(NULL) { }
// Functions to compile either CallIC or KeyedCallIC. The specific kind // Functions to compile either CallIC or KeyedCallIC. The specific kind
// is extracted from the code flags. // is extracted from the code flags.
...@@ -489,6 +491,8 @@ class StubCompiler BASE_EMBEDDED { ...@@ -489,6 +491,8 @@ class StubCompiler BASE_EMBEDDED {
Handle<Code> GetCodeWithFlags(Code::Flags flags, const char* name); Handle<Code> GetCodeWithFlags(Code::Flags flags, const char* name);
Handle<Code> GetCodeWithFlags(Code::Flags flags, Handle<Name> name); Handle<Code> GetCodeWithFlags(Code::Flags flags, Handle<Name> name);
ExtraICState extra_state() { return extra_ic_state_; }
MacroAssembler* masm() { return &masm_; } MacroAssembler* masm() { return &masm_; }
void set_failure(Failure* failure) { failure_ = failure; } void set_failure(Failure* failure) { failure_ = failure; }
...@@ -504,6 +508,7 @@ class StubCompiler BASE_EMBEDDED { ...@@ -504,6 +508,7 @@ class StubCompiler BASE_EMBEDDED {
private: private:
Isolate* isolate_; Isolate* isolate_;
const ExtraICState extra_ic_state_;
MacroAssembler masm_; MacroAssembler masm_;
Failure* failure_; Failure* failure_;
}; };
...@@ -516,8 +521,11 @@ class BaseLoadStoreStubCompiler: public StubCompiler { ...@@ -516,8 +521,11 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
public: public:
BaseLoadStoreStubCompiler(Isolate* isolate, BaseLoadStoreStubCompiler(Isolate* isolate,
Code::Kind kind, Code::Kind kind,
ExtraICState extra_ic_state = kNoExtraICState,
InlineCacheHolderFlag cache_holder = OWN_MAP) InlineCacheHolderFlag cache_holder = OWN_MAP)
: StubCompiler(isolate), kind_(kind), cache_holder_(cache_holder) { : StubCompiler(isolate, extra_ic_state),
kind_(kind),
cache_holder_(cache_holder) {
InitializeRegisters(); InitializeRegisters();
} }
virtual ~BaseLoadStoreStubCompiler() { } virtual ~BaseLoadStoreStubCompiler() { }
...@@ -589,7 +597,6 @@ class BaseLoadStoreStubCompiler: public StubCompiler { ...@@ -589,7 +597,6 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
} }
void JitEvent(Handle<Name> name, Handle<Code> code); void JitEvent(Handle<Name> name, Handle<Code> code);
virtual ExtraICState extra_state() { return kNoExtraICState; }
virtual Register receiver() = 0; virtual Register receiver() = 0;
virtual Register name() = 0; virtual Register name() = 0;
virtual Register scratch1() = 0; virtual Register scratch1() = 0;
...@@ -609,9 +616,11 @@ class BaseLoadStoreStubCompiler: public StubCompiler { ...@@ -609,9 +616,11 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
class LoadStubCompiler: public BaseLoadStoreStubCompiler { class LoadStubCompiler: public BaseLoadStoreStubCompiler {
public: public:
LoadStubCompiler(Isolate* isolate, LoadStubCompiler(Isolate* isolate,
ExtraICState extra_ic_state = kNoExtraICState,
InlineCacheHolderFlag cache_holder = OWN_MAP, InlineCacheHolderFlag cache_holder = OWN_MAP,
Code::Kind kind = Code::LOAD_IC) Code::Kind kind = Code::LOAD_IC)
: BaseLoadStoreStubCompiler(isolate, kind, cache_holder) { } : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state,
cache_holder) { }
virtual ~LoadStubCompiler() { } virtual ~LoadStubCompiler() { }
Handle<Code> CompileLoadField(Handle<Type> type, Handle<Code> CompileLoadField(Handle<Type> type,
...@@ -708,8 +717,10 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -708,8 +717,10 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
class KeyedLoadStubCompiler: public LoadStubCompiler { class KeyedLoadStubCompiler: public LoadStubCompiler {
public: public:
KeyedLoadStubCompiler(Isolate* isolate, KeyedLoadStubCompiler(Isolate* isolate,
ExtraICState extra_ic_state = kNoExtraICState,
InlineCacheHolderFlag cache_holder = OWN_MAP) InlineCacheHolderFlag cache_holder = OWN_MAP)
: LoadStubCompiler(isolate, cache_holder, Code::KEYED_LOAD_IC) { } : LoadStubCompiler(isolate, extra_ic_state, cache_holder,
Code::KEYED_LOAD_IC) { }
Handle<Code> CompileLoadElement(Handle<Map> receiver_map); Handle<Code> CompileLoadElement(Handle<Map> receiver_map);
...@@ -732,10 +743,9 @@ class KeyedLoadStubCompiler: public LoadStubCompiler { ...@@ -732,10 +743,9 @@ class KeyedLoadStubCompiler: public LoadStubCompiler {
class StoreStubCompiler: public BaseLoadStoreStubCompiler { class StoreStubCompiler: public BaseLoadStoreStubCompiler {
public: public:
StoreStubCompiler(Isolate* isolate, StoreStubCompiler(Isolate* isolate,
StrictModeFlag strict_mode, ExtraICState extra_ic_state,
Code::Kind kind = Code::STORE_IC) Code::Kind kind = Code::STORE_IC)
: BaseLoadStoreStubCompiler(isolate, kind), : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state) {}
strict_mode_(strict_mode) { }
virtual ~StoreStubCompiler() { } virtual ~StoreStubCompiler() { }
...@@ -826,16 +836,11 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -826,16 +836,11 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler {
virtual Register scratch1() { return registers_[3]; } virtual Register scratch1() { return registers_[3]; }
virtual Register scratch2() { return registers_[4]; } virtual Register scratch2() { return registers_[4]; }
virtual Register scratch3() { return registers_[5]; } virtual Register scratch3() { return registers_[5]; }
StrictModeFlag strict_mode() { return strict_mode_; }
virtual ExtraICState extra_state() {
return StoreIC::ComputeExtraICState(strict_mode_);
}
protected: protected:
static Register* registers(); static Register* registers();
private: private:
StrictModeFlag strict_mode_;
friend class BaseLoadStoreStubCompiler; friend class BaseLoadStoreStubCompiler;
}; };
...@@ -843,10 +848,8 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -843,10 +848,8 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler {
class KeyedStoreStubCompiler: public StoreStubCompiler { class KeyedStoreStubCompiler: public StoreStubCompiler {
public: public:
KeyedStoreStubCompiler(Isolate* isolate, KeyedStoreStubCompiler(Isolate* isolate,
StrictModeFlag strict_mode, ExtraICState extra_ic_state)
KeyedAccessStoreMode store_mode) : StoreStubCompiler(isolate, extra_ic_state, Code::KEYED_STORE_IC) {}
: StoreStubCompiler(isolate, strict_mode, Code::KEYED_STORE_IC),
store_mode_(store_mode) { }
Handle<Code> CompileStoreElement(Handle<Map> receiver_map); Handle<Code> CompileStoreElement(Handle<Map> receiver_map);
...@@ -859,11 +862,12 @@ class KeyedStoreStubCompiler: public StoreStubCompiler { ...@@ -859,11 +862,12 @@ class KeyedStoreStubCompiler: public StoreStubCompiler {
static void GenerateStoreDictionaryElement(MacroAssembler* masm); static void GenerateStoreDictionaryElement(MacroAssembler* masm);
protected: protected:
virtual ExtraICState extra_state() {
return KeyedStoreIC::ComputeExtraICState(strict_mode(), store_mode_);
}
static Register* registers(); static Register* registers();
KeyedAccessStoreMode store_mode() {
return KeyedStoreIC::GetKeyedAccessStoreMode(extra_state());
}
private: private:
Register transition_map() { Register transition_map() {
return registers()[3]; return registers()[3];
...@@ -872,7 +876,6 @@ class KeyedStoreStubCompiler: public StoreStubCompiler { ...@@ -872,7 +876,6 @@ class KeyedStoreStubCompiler: public StoreStubCompiler {
virtual void GenerateNameCheck(Handle<Name> name, virtual void GenerateNameCheck(Handle<Name> name,
Register name_reg, Register name_reg,
Label* miss); Label* miss);
KeyedAccessStoreMode store_mode_;
friend class BaseLoadStoreStubCompiler; friend class BaseLoadStoreStubCompiler;
}; };
...@@ -1000,7 +1003,6 @@ class CallStubCompiler: public StubCompiler { ...@@ -1000,7 +1003,6 @@ class CallStubCompiler: public StubCompiler {
const ParameterCount arguments_; const ParameterCount arguments_;
const Code::Kind kind_; const Code::Kind kind_;
const ExtraICState extra_state_;
const InlineCacheHolderFlag cache_holder_; const InlineCacheHolderFlag cache_holder_;
}; };
......
...@@ -1572,7 +1572,7 @@ void CallStubCompiler::GenerateMissBranch() { ...@@ -1572,7 +1572,7 @@ void CallStubCompiler::GenerateMissBranch() {
Handle<Code> code = Handle<Code> code =
isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(), isolate()->stub_cache()->ComputeCallMiss(arguments().immediate(),
kind_, kind_,
extra_state_); extra_state());
__ Jump(code, RelocInfo::CODE_TARGET); __ Jump(code, RelocInfo::CODE_TARGET);
} }
...@@ -1957,7 +1957,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( ...@@ -1957,7 +1957,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
Label index_out_of_range; Label index_out_of_range;
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2024,7 +2024,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( ...@@ -2024,7 +2024,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall(
Label index_out_of_range; Label index_out_of_range;
Label* index_out_of_range_label = &index_out_of_range; Label* index_out_of_range_label = &index_out_of_range;
if (kind_ == Code::CALL_IC && if (kind_ == Code::CALL_IC &&
(CallICBase::StringStubState::decode(extra_state_) == (CallICBase::StringStubState::decode(extra_state()) ==
DEFAULT_STRING_STUB)) { DEFAULT_STRING_STUB)) {
index_out_of_range_label = &miss; index_out_of_range_label = &miss;
} }
...@@ -2497,7 +2497,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, ...@@ -2497,7 +2497,7 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
StackArgumentsAccessor args(rsp, arguments()); StackArgumentsAccessor args(rsp, arguments());
__ movq(rdx, args.GetReceiverOperand()); __ movq(rdx, args.GetReceiverOperand());
CallInterceptorCompiler compiler(this, arguments(), rcx, extra_state_); CallInterceptorCompiler compiler(this, arguments(), rcx, extra_state());
compiler.Compile(masm(), object, holder, name, &lookup, rdx, rbx, rdi, rax, compiler.Compile(masm(), object, holder, name, &lookup, rdx, rbx, rdi, rax,
&miss); &miss);
......
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