Index: src/stub-cache.cc |
diff --git a/src/stub-cache.cc b/src/stub-cache.cc |
index 06edc0d6871d652ba6e5248a53370a0c6883a54a..5476e90bcae40de1e2cb7c40ef9cd9797910780f 100644 |
--- a/src/stub-cache.cc |
+++ b/src/stub-cache.cc |
@@ -117,10 +117,12 @@ Handle<Code> StubCache::FindHandler(Handle<Name> name, |
Code::Kind kind, |
InlineCacheHolderFlag cache_holder, |
StrictModeFlag strict_mode) { |
- Code::ExtraICState extra_ic_state = Code::kNoExtraICState; |
- if (kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC) { |
- extra_ic_state = Code::ComputeExtraICState( |
- STANDARD_STORE, strict_mode); |
+ Code::ExtraICState extra_ic_state = IC::kNoExtraICState; |
+ if (kind == Code::STORE_IC) { |
+ extra_ic_state = StoreIC::ComputeExtraICState(strict_mode); |
+ } else if (kind == Code::KEYED_STORE_IC) { |
+ extra_ic_state = KeyedStoreIC::ComputeExtraICState(strict_mode, |
+ STANDARD_STORE); |
} |
Code::Flags flags = Code::ComputeMonomorphicFlags( |
Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind); |
@@ -131,10 +133,11 @@ Handle<Code> StubCache::FindHandler(Handle<Name> name, |
} |
-Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, |
- Handle<Type> type, |
- Handle<Code> handler, |
- StrictModeFlag strict_mode) { |
+Handle<Code> StubCache::ComputeMonomorphicIC( |
+ Handle<Name> name, |
+ Handle<Type> type, |
+ Handle<Code> handler, |
+ Code::ExtraICState extra_ic_state) { |
Code::Kind kind = handler->handler_kind(); |
InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type); |
@@ -146,7 +149,7 @@ Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, |
bool can_be_cached = !type->Is(Type::String()); |
if (can_be_cached) { |
stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate()); |
- ic = FindIC(name, stub_holder, kind, strict_mode, flag); |
+ ic = FindIC(name, stub_holder, kind, extra_ic_state, flag); |
if (!ic.is_null()) return ic; |
} |
@@ -157,10 +160,12 @@ Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, |
KeyedLoadStubCompiler ic_compiler(isolate(), flag); |
ic = ic_compiler.CompileMonomorphicIC(type, handler, name); |
} else if (kind == Code::STORE_IC) { |
+ StrictModeFlag strict_mode = StoreIC::GetStrictMode(extra_ic_state); |
StoreStubCompiler ic_compiler(isolate(), strict_mode); |
ic = ic_compiler.CompileMonomorphicIC(type, handler, name); |
} else { |
ASSERT(kind == Code::KEYED_STORE_IC); |
+ StrictModeFlag strict_mode = StoreIC::GetStrictMode(extra_ic_state); |
KeyedStoreStubCompiler ic_compiler(isolate(), strict_mode, STANDARD_STORE); |
ic = ic_compiler.CompileMonomorphicIC(type, handler, name); |
} |
@@ -225,7 +230,7 @@ Handle<Code> StubCache::ComputeKeyedStoreElement( |
StrictModeFlag strict_mode, |
KeyedAccessStoreMode store_mode) { |
Code::ExtraICState extra_state = |
- Code::ComputeExtraICState(store_mode, strict_mode); |
+ KeyedStoreIC::ComputeExtraICState(strict_mode, store_mode); |
Code::Flags flags = Code::ComputeMonomorphicFlags( |
Code::KEYED_STORE_IC, extra_state); |
@@ -243,7 +248,8 @@ Handle<Code> StubCache::ComputeKeyedStoreElement( |
Handle<Code> code = compiler.CompileStoreElement(receiver_map); |
Map::UpdateCodeCache(receiver_map, name, code); |
- ASSERT(Code::GetKeyedAccessStoreMode(code->extra_ic_state()) == store_mode); |
+ ASSERT(KeyedStoreIC::GetKeyedAccessStoreMode(code->extra_ic_state()) |
+ == store_mode); |
return code; |
} |
@@ -424,7 +430,8 @@ Code* StubCache::FindCallInitialize(int argc, |
Code::Kind kind) { |
Code::ExtraICState extra_state = |
CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) | |
- CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT); |
+ CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT |
+ ? CONTEXTUAL : NOT_CONTEXTUAL); |
Code::Flags flags = |
Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc); |
UnseededNumberDictionary* dictionary = |
@@ -443,7 +450,8 @@ Handle<Code> StubCache::ComputeCallInitialize(int argc, |
Code::Kind kind) { |
Code::ExtraICState extra_state = |
CallICBase::StringStubState::encode(DEFAULT_STRING_STUB) | |
- CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT); |
+ CallICBase::Contextual::encode(mode == RelocInfo::CODE_TARGET_CONTEXT |
+ ? CONTEXTUAL : NOT_CONTEXTUAL); |
Toon Verwaest
2013/11/28 09:58:47
nit: indent by 4 extra spaces
mvstanton
2013/11/28 11:23:11
Fixed in both places.
|
Code::Flags flags = |
Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc); |
Handle<UnseededNumberDictionary> cache = |
@@ -507,7 +515,7 @@ Handle<Code> StubCache::ComputeCallNormal(int argc, |
Handle<Code> StubCache::ComputeCallArguments(int argc) { |
Code::Flags flags = |
Code::ComputeFlags(Code::KEYED_CALL_IC, MEGAMORPHIC, |
- Code::kNoExtraICState, Code::NORMAL, argc); |
+ IC::kNoExtraICState, Code::NORMAL, argc); |
Handle<UnseededNumberDictionary> cache = |
isolate_->factory()->non_monomorphic_cache(); |
int entry = cache->FindEntry(isolate_, flags); |
@@ -637,8 +645,8 @@ Handle<Code> StubCache::ComputeStoreElementPolymorphic( |
store_mode == STORE_NO_TRANSITION_HANDLE_COW); |
Handle<PolymorphicCodeCache> cache = |
isolate_->factory()->polymorphic_code_cache(); |
- Code::ExtraICState extra_state = Code::ComputeExtraICState(store_mode, |
- strict_mode); |
+ Code::ExtraICState extra_state = KeyedStoreIC::ComputeExtraICState( |
+ strict_mode, store_mode); |
Code::Flags flags = |
Code::ComputeFlags(Code::KEYED_STORE_IC, POLYMORPHIC, extra_state); |
Handle<Object> probe = cache->Lookup(receiver_maps, flags); |
@@ -1075,7 +1083,7 @@ Handle<Code> StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) { |
Code::Kind kind = Code::ExtractKindFromFlags(flags); |
if (kind == Code::CALL_IC) { |
// For the debugger extra ic state is irrelevant. |
- CallIC::GenerateMiss(masm(), argc, Code::kNoExtraICState); |
+ CallIC::GenerateMiss(masm(), argc, IC::kNoExtraICState); |
} else { |
KeyedCallIC::GenerateMiss(masm(), argc); |
} |