Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: src/stub-cache.cc

Issue 12226090: Order arguments of ComputeMonomorphicFlags to match ComputeFlags. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/type-info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 96aa50f01cf34819cba71c8182a36e1633e60248..cdf3960a9d4d9b49cd6adbc6a8e91d842cd3a06b 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -125,8 +125,8 @@ Handle<Code> StubCache::ComputeLoadNonexistent(Handle<String> name,
// Compile the stub that is either shared for all names or
// name specific if there are global objects involved.
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NONEXISTENT);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, Code::NONEXISTENT);
Handle<Object> probe(receiver->map()->FindInCodeCache(*cache_name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -148,7 +148,8 @@ Handle<Code> StubCache::ComputeLoadField(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, Code::FIELD);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -170,8 +171,8 @@ Handle<Code> StubCache::ComputeLoadCallback(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, Code::CALLBACKS);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -193,8 +194,8 @@ Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, Code::CALLBACKS);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -216,8 +217,8 @@ Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CONSTANT_FUNCTION);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, Code::CONSTANT_FUNCTION);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -238,8 +239,8 @@ Handle<Code> StubCache::ComputeLoadInterceptor(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::INTERCEPTOR);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, Code::INTERCEPTOR);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -267,8 +268,7 @@ Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NORMAL);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -290,8 +290,8 @@ Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::KEYED_LOAD_IC, Code::kNoExtraICState, Code::FIELD);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -312,8 +312,8 @@ Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC,
- Code::CONSTANT_FUNCTION);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::KEYED_LOAD_IC, Code::kNoExtraICState, Code::CONSTANT_FUNCTION);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -334,8 +334,8 @@ Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<String> name,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::INTERCEPTOR);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::KEYED_LOAD_IC, Code::kNoExtraICState, Code::INTERCEPTOR);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -357,8 +357,8 @@ Handle<Code> StubCache::ComputeKeyedLoadCallback(
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::KEYED_LOAD_IC, Code::kNoExtraICState, Code::CALLBACKS);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -381,7 +381,7 @@ Handle<Code> StubCache::ComputeStoreField(Handle<String> name,
Code::StubType type =
(transition.is_null()) ? Code::FIELD : Code::MAP_TRANSITION;
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::STORE_IC, type, strict_mode);
+ Code::STORE_IC, strict_mode, type);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -397,8 +397,7 @@ Handle<Code> StubCache::ComputeStoreField(Handle<String> name,
Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) {
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::NORMAL);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC);
Handle<String> name =
isolate()->factory()->KeyedLoadElementMonomorphic_symbol();
@@ -422,7 +421,7 @@ Handle<Code> StubCache::ComputeKeyedStoreElement(
Code::ExtraICState extra_state =
Code::ComputeExtraICState(grow_mode, strict_mode);
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::KEYED_STORE_IC, Code::NORMAL, extra_state);
+ Code::KEYED_STORE_IC, extra_state);
ASSERT(stub_kind == KeyedStoreIC::STORE_NO_TRANSITION ||
stub_kind == KeyedStoreIC::STORE_AND_GROW_NO_TRANSITION);
@@ -455,7 +454,7 @@ Handle<Code> StubCache::ComputeStoreGlobal(Handle<String> name,
Handle<JSGlobalPropertyCell> cell,
StrictModeFlag strict_mode) {
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::STORE_IC, Code::NORMAL, strict_mode);
+ Code::STORE_IC, strict_mode);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -476,7 +475,7 @@ Handle<Code> StubCache::ComputeStoreCallback(Handle<String> name,
StrictModeFlag strict_mode) {
ASSERT(v8::ToCData<Address>(callback->setter()) != 0);
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::STORE_IC, Code::CALLBACKS, strict_mode);
+ Code::STORE_IC, strict_mode, Code::CALLBACKS);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -497,7 +496,7 @@ Handle<Code> StubCache::ComputeStoreViaSetter(Handle<String> name,
Handle<JSFunction> setter,
StrictModeFlag strict_mode) {
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::STORE_IC, Code::CALLBACKS, strict_mode);
+ Code::STORE_IC, strict_mode, Code::CALLBACKS);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -516,7 +515,7 @@ Handle<Code> StubCache::ComputeStoreInterceptor(Handle<String> name,
Handle<JSObject> receiver,
StrictModeFlag strict_mode) {
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::STORE_IC, Code::INTERCEPTOR, strict_mode);
+ Code::STORE_IC, strict_mode, Code::INTERCEPTOR);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -537,7 +536,7 @@ Handle<Code> StubCache::ComputeKeyedStoreField(Handle<String> name,
Code::StubType type =
(transition.is_null()) ? Code::FIELD : Code::MAP_TRANSITION;
Code::Flags flags = Code::ComputeMonomorphicFlags(
- Code::KEYED_STORE_IC, type, strict_mode);
+ Code::KEYED_STORE_IC, strict_mode, type);
Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -586,9 +585,8 @@ Handle<Code> StubCache::ComputeCallConstant(int argc,
return Handle<Code>::null();
}
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state,
- cache_holder, argc);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ kind, extra_state, Code::CONSTANT_FUNCTION, argc, cache_holder);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -625,9 +623,8 @@ Handle<Code> StubCache::ComputeCallField(int argc,
object = holder;
}
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(kind, Code::FIELD, extra_state,
- cache_holder, argc);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ kind, extra_state, Code::FIELD, argc, cache_holder);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -663,9 +660,8 @@ Handle<Code> StubCache::ComputeCallInterceptor(int argc,
object = holder;
}
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(kind, Code::INTERCEPTOR, extra_state,
- cache_holder, argc);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ kind, extra_state, Code::INTERCEPTOR, argc, cache_holder);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -694,9 +690,8 @@ Handle<Code> StubCache::ComputeCallGlobal(int argc,
InlineCacheHolderFlag cache_holder =
IC::GetCodeCacheForObject(*receiver, *holder);
Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder));
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(kind, Code::NORMAL, extra_state,
- cache_holder, argc);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ kind, extra_state, Code::NORMAL, argc, cache_holder);
Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe);
@@ -1526,7 +1521,8 @@ Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
Handle<Code> LoadStubCompiler::GetCode(Code::StubType type,
Handle<String> name,
InlineCacheState state) {
- Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::LOAD_IC, Code::kNoExtraICState, type);
Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
@@ -1582,8 +1578,8 @@ Handle<Code> KeyedLoadStubCompiler::CompileLoadElementPolymorphic(
Handle<Code> StoreStubCompiler::GetCode(Code::StubType type,
Handle<String> name) {
- Code::Flags flags =
- Code::ComputeMonomorphicFlags(Code::STORE_IC, type, strict_mode_);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(
+ Code::STORE_IC, strict_mode_, type);
Handle<Code> code = GetCodeWithFlags(flags, name);
PROFILE(isolate(), CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name));
GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code));
@@ -1717,10 +1713,10 @@ Handle<Code> CallStubCompiler::GetCode(Code::StubType type,
Handle<String> name) {
int argc = arguments_.immediate();
Code::Flags flags = Code::ComputeMonomorphicFlags(kind_,
- type,
extra_state_,
- cache_holder_,
- argc);
+ type,
+ argc,
+ cache_holder_);
return GetCodeWithFlags(flags, name);
}
« no previous file with comments | « src/objects-inl.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698