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

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

Issue 2147433002: [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: Improved stub cache tests and the fixes. 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 | « test/cctest/test-api.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 7709f84678b1c09f2a880267f7bd6ba322a67435..37cb4d055d75180b30395aa47c574338eab7d534 100644
--- a/test/cctest/test-code-stub-assembler.cc
+++ b/test/cctest/test-code-stub-assembler.cc
@@ -1109,18 +1109,16 @@ void TestStubCacheOffsetCalculation(StubCache::Table table,
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, code_flags, map);
+ Node* primary_offset = m.StubCachePrimaryOffset(name, map);
Node* result;
if (table == StubCache::kPrimary) {
result = primary_offset;
} else {
CHECK_EQ(StubCache::kSecondary, table);
- result = m.StubCacheSecondaryOffset(name, code_flags, primary_offset);
+ result = m.StubCacheSecondaryOffset(name, primary_offset);
}
m.Return(m.SmiFromWord32(result));
}
@@ -1163,13 +1161,12 @@ void TestStubCacheOffsetCalculation(StubCache::Table table,
int expected_result;
{
- int primary_offset =
- StubCache::PrimaryOffsetForTesting(*name, code_flags, *map);
+ int primary_offset = StubCache::PrimaryOffsetForTesting(*name, *map);
if (table == StubCache::kPrimary) {
expected_result = primary_offset;
} else {
- expected_result = StubCache::SecondaryOffsetForTesting(
- *name, code_flags, primary_offset);
+ expected_result =
+ StubCache::SecondaryOffsetForTesting(*name, primary_offset);
}
}
Handle<Object> result = ft.Call(name, map).ToHandleChecked();
@@ -1217,9 +1214,6 @@ TEST(TryProbeStubCache) {
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();
@@ -1299,25 +1293,8 @@ TEST(TryProbeStubCache) {
// 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(code_kind));
+ Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(ic_kind));
handlers.push_back(CreateCodeWithFlags(flags));
}
@@ -1342,7 +1319,7 @@ TEST(TryProbeStubCache) {
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(), flags_to_query);
+ Code* handler = stub_cache.Get(*name, receiver->map());
if (handler == nullptr) {
queried_non_existing = true;
} else {
@@ -1358,7 +1335,7 @@ TEST(TryProbeStubCache) {
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(), flags_to_query);
+ Code* handler = stub_cache.Get(*name, receiver->map());
if (handler == nullptr) {
queried_non_existing = true;
} else {
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698