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

Unified Diff: test/cctest/test-code-stub-assembler.cc

Issue 2147213004: Revert of [ic] [stubs] Don't use Code::flags in megamorphic stub cache hash computations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@split-stub-cache
Patch Set: Created 4 years, 5 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/type-info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-code-stub-assembler.cc
diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc
index 37cb4d055d75180b30395aa47c574338eab7d534..7709f84678b1c09f2a880267f7bd6ba322a67435 100644
--- a/test/cctest/test-code-stub-assembler.cc
+++ b/test/cctest/test-code-stub-assembler.cc
@@ -1109,16 +1109,18 @@
const int kNumParams = 2;
CodeStubAssemblerTester m(isolate, kNumParams);
+ Code::Flags code_flags =
+ Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(handler_kind));
{
Node* name = m.Parameter(0);
Node* map = m.Parameter(1);
- Node* primary_offset = m.StubCachePrimaryOffset(name, map);
+ Node* primary_offset = m.StubCachePrimaryOffset(name, code_flags, map);
Node* result;
if (table == StubCache::kPrimary) {
result = primary_offset;
} else {
CHECK_EQ(StubCache::kSecondary, table);
- result = m.StubCacheSecondaryOffset(name, primary_offset);
+ result = m.StubCacheSecondaryOffset(name, code_flags, primary_offset);
}
m.Return(m.SmiFromWord32(result));
}
@@ -1161,12 +1163,13 @@
int expected_result;
{
- int primary_offset = StubCache::PrimaryOffsetForTesting(*name, *map);
+ int primary_offset =
+ StubCache::PrimaryOffsetForTesting(*name, code_flags, *map);
if (table == StubCache::kPrimary) {
expected_result = primary_offset;
} else {
- expected_result =
- StubCache::SecondaryOffsetForTesting(*name, primary_offset);
+ expected_result = StubCache::SecondaryOffsetForTesting(
+ *name, code_flags, primary_offset);
}
}
Handle<Object> result = ft.Call(name, map).ToHandleChecked();
@@ -1214,6 +1217,9 @@
CodeStubAssemblerTester m(isolate, kNumParams);
Code::Kind ic_kind = Code::LOAD_IC;
+ Code::Flags flags_to_query =
+ Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(ic_kind));
+
StubCache stub_cache(isolate, ic_kind);
stub_cache.Clear();
@@ -1293,8 +1299,25 @@
// Generate some number of handlers.
for (int i = 0; i < 30; i++) {
+ Code::Kind code_kind;
+ switch (rand_gen.NextInt(4)) {
+ case 0:
+ code_kind = Code::LOAD_IC;
+ break;
+ case 1:
+ code_kind = Code::KEYED_LOAD_IC;
+ break;
+ case 2:
+ code_kind = Code::STORE_IC;
+ break;
+ case 3:
+ code_kind = Code::KEYED_STORE_IC;
+ break;
+ default:
+ UNREACHABLE();
+ }
Code::Flags flags =
- Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(ic_kind));
+ Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(code_kind));
handlers.push_back(CreateCodeWithFlags(flags));
}
@@ -1319,7 +1342,7 @@
int index = rand_gen.NextInt();
Handle<Name> name = names[index % names.size()];
Handle<JSObject> receiver = receivers[index % receivers.size()];
- Code* handler = stub_cache.Get(*name, receiver->map());
+ Code* handler = stub_cache.Get(*name, receiver->map(), flags_to_query);
if (handler == nullptr) {
queried_non_existing = true;
} else {
@@ -1335,7 +1358,7 @@
int index2 = rand_gen.NextInt();
Handle<Name> name = names[index1 % names.size()];
Handle<JSObject> receiver = receivers[index2 % receivers.size()];
- Code* handler = stub_cache.Get(*name, receiver->map());
+ Code* handler = stub_cache.Get(*name, receiver->map(), flags_to_query);
if (handler == nullptr) {
queried_non_existing = true;
} else {
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698