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

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

Issue 1884133002: [Interpreter] Add support for FunctionEntryHook. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make test stricter Created 4 years, 8 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/cctest.status ('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 6bea3eaefee603ed7bc02a56be251082ba6ad27a..7f4b1ba743109e63b7e29b5876a3aa48314dafcc 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -14403,7 +14403,6 @@ int SetFunctionEntryHookTest::CountInvocations(
return invocations;
}
-
void SetFunctionEntryHookTest::RunLoopInNewEnv(v8::Isolate* isolate) {
v8::HandleScope outer(isolate);
v8::Local<Context> env = Context::New(isolate);
@@ -14461,10 +14460,19 @@ void SetFunctionEntryHookTest::RunTest() {
RunLoopInNewEnv(isolate);
- // Check the exepected invocation counts.
- CHECK_EQ(2, CountInvocations(NULL, "bar"));
- CHECK_EQ(200, CountInvocations("bar", "foo"));
- CHECK_EQ(200, CountInvocations(NULL, "foo"));
+ // Check the expected invocation counts.
+ if (!i::FLAG_ignition) {
+ CHECK_EQ(2, CountInvocations(NULL, "bar"));
+ CHECK_EQ(200, CountInvocations("bar", "foo"));
+ CHECK_EQ(200, CountInvocations(NULL, "foo"));
+ } else {
+ // For ignition we don't see the actual functions being called, instead
+ // we see the IterpreterEntryTrampoline at least 102 times
+ // (100 unoptimized calls to foo, and 2 calls to bar).
+ CHECK_LE(102, CountInvocations(NULL, "InterpreterEntryTrampoline"));
+ // We should also see the calls to the optimized function foo.
+ CHECK_EQ(100, CountInvocations(NULL, "foo"));
+ }
// Verify that we have an entry hook on some specific stubs.
CHECK_NE(0, CountInvocations(NULL, "CEntryStub"));
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698