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

Unified Diff: test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc

Issue 2610173004: Add ability to enqueue SharedFunctionInfos so they can run on bg threads (Closed)
Patch Set: updates Created 3 years, 11 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/compiler-dispatcher/compiler-dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc
diff --git a/test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc b/test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc
index 1e4023c4edce9c75106f38b8a98bbf9cfe68008b..4c6f4a285031e65c427a7b0f1b882810f94c337a 100644
--- a/test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc
+++ b/test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc
@@ -797,5 +797,27 @@ TEST_F(CompilerDispatcherTest, MemoryPressureFromBackground) {
platform.ClearIdleTask();
}
+TEST_F(CompilerDispatcherTest, EnqueueAndStep) {
+ MockPlatform platform;
+ CompilerDispatcher dispatcher(i_isolate(), &platform, FLAG_stack_size);
+
+ const char script[] =
+ "function g() { var y = 1; function f16(x) { return x * y }; return f16; "
+ "} g();";
+ Handle<JSFunction> f = Handle<JSFunction>::cast(RunJS(isolate(), script));
+ Handle<SharedFunctionInfo> shared(f->shared(), i_isolate());
+
+ ASSERT_FALSE(dispatcher.IsEnqueued(shared));
+ ASSERT_TRUE(dispatcher.EnqueueAndStep(shared));
+ ASSERT_TRUE(dispatcher.IsEnqueued(shared));
+
+ ASSERT_TRUE(dispatcher.jobs_.begin()->second->status() ==
+ CompileJobStatus::kReadyToParse);
+
+ ASSERT_TRUE(platform.IdleTaskPending());
+ platform.ClearIdleTask();
+ ASSERT_FALSE(platform.BackgroundTasksPending());
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler-dispatcher/compiler-dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698