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

Unified Diff: test/cctest/test-api.cc

Side-by-side diff isn't available for this file because of its large size.
Issue 2163253002: [stubs] Port store IC dispatcher to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 4 years, 2 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:
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 1575559d38261ea41d1125377b18ee13f89c1353..5ccf9d5a930c76705a74c771eefceb2084aa43a7 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -21782,12 +21782,15 @@ int* LookupCounter(const char* name) {
const char* kMegamorphicTestProgram =
"function CreateClass(name) {\n"
" var src = \n"
- " ` function ${name}() {};` +\n"
+ " ` function ${name}() { this.a = 0; };` +\n"
" ` ${name}.prototype.foo = function() {};` +\n"
" ` ${name};\\n`;\n"
" return (0, eval)(src);\n"
"}\n"
- "function fooify(obj) { obj.foo(); };\n"
+ "function trigger_ics(obj, v) {\n"
+ " obj.foo();\n"
+ " obj.a = v;\n"
+ "};\n"
"var objs = [];\n"
"for (var i = 0; i < 50; i++) {\n"
" var Class = CreateClass('Class' + i);\n"
@@ -21796,7 +21799,7 @@ const char* kMegamorphicTestProgram =
"}\n"
"for (var i = 0; i < 1000; i++) {\n"
" for (var obj of objs) {\n"
- " fooify(obj);\n"
+ " trigger_ics(obj, i);\n"
" }\n"
"}\n";
@@ -21832,6 +21835,7 @@ void TestStubCache(bool primary) {
i::CodeStub::LoadICTF, i::CodeStub::LoadICTrampolineTF,
i::CodeStub::KeyedLoadIC, i::CodeStub::KeyedLoadICTrampoline,
i::CodeStub::StoreIC, i::CodeStub::StoreICTrampoline,
+ i::CodeStub::StoreICTF, i::CodeStub::StoreICTrampolineTF,
i::CodeStub::KeyedStoreIC, i::CodeStub::KeyedStoreICTrampoline,
};
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
@@ -21852,17 +21856,18 @@ void TestStubCache(bool primary) {
int updates = updates_counter - initial_updates;
const int kClassesCount = 50;
const int kIterationsCount = 1000;
- CHECK_LE(kClassesCount, updates);
+ const int kICKinds = 2; // LoadIC and StoreIC
+ CHECK_LE(kClassesCount * kICKinds, updates);
// Check that updates and misses counts are bounded.
// If there are too many updates then most likely the stub cache does not
// work properly.
- CHECK_LE(updates, kClassesCount * 2);
- CHECK_LE(1, misses);
- CHECK_LE(misses, kClassesCount * 2);
+ CHECK_LE(updates, kClassesCount * 2 * kICKinds);
+ CHECK_LE(kICKinds, misses);
+ CHECK_LE(misses, kClassesCount * 2 * kICKinds);
// 2 is for PREMONOMORPHIC and MONOMORPHIC states,
// 4 is for POLYMORPHIC states,
// and all the others probes are for MEGAMORPHIC state.
- CHECK_EQ(kIterationsCount * kClassesCount - 2 - 4, probes);
+ CHECK_EQ((kIterationsCount * kClassesCount - 2 - 4) * kICKinds, probes);
}
isolate->Dispose();
}
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698