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

Side by Side Diff: test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc

Issue 2606263002: Use background tasks for the compiler dispatcher (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler-dispatcher/compiler-dispatcher.h" 5 #include "src/compiler-dispatcher/compiler-dispatcher.h"
6 6
7 #include "include/v8-platform.h" 7 #include "include/v8-platform.h"
8 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" 8 #include "src/compiler-dispatcher/compiler-dispatcher-job.h"
9 #include "src/flags.h" 9 #include "src/flags.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 29 matching lines...) Expand all
40 40
41 bool CompilerDispatcherTest::old_flag_; 41 bool CompilerDispatcherTest::old_flag_;
42 42
43 namespace { 43 namespace {
44 44
45 class MockPlatform : public v8::Platform { 45 class MockPlatform : public v8::Platform {
46 public: 46 public:
47 MockPlatform() : task_(nullptr), time_(0.0), time_step_(0.0) {} 47 MockPlatform() : task_(nullptr), time_(0.0), time_step_(0.0) {}
48 ~MockPlatform() override = default; 48 ~MockPlatform() override = default;
49 49
50 size_t NumberOfAvailableBackgroundThreads() override { return 1; }
51
50 void CallOnBackgroundThread(Task* task, 52 void CallOnBackgroundThread(Task* task,
51 ExpectedRuntime expected_runtime) override { 53 ExpectedRuntime expected_runtime) override {
52 UNREACHABLE(); 54 UNREACHABLE();
53 } 55 }
54 56
55 void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override { 57 void CallOnForegroundThread(v8::Isolate* isolate, Task* task) override {
56 UNREACHABLE(); 58 UNREACHABLE();
57 } 59 }
58 60
59 void CallDelayedOnForegroundThread(v8::Isolate* isolate, Task* task, 61 void CallDelayedOnForegroundThread(v8::Isolate* isolate, Task* task,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // to finish compiling the function. 222 // to finish compiling the function.
221 platform.RunIdleTask(1000.0, 0.0); 223 platform.RunIdleTask(1000.0, 0.0);
222 224
223 ASSERT_FALSE(dispatcher.IsEnqueued(shared)); 225 ASSERT_FALSE(dispatcher.IsEnqueued(shared));
224 ASSERT_FALSE(shared->is_compiled()); 226 ASSERT_FALSE(shared->is_compiled());
225 ASSERT_FALSE(try_catch.HasCaught()); 227 ASSERT_FALSE(try_catch.HasCaught());
226 } 228 }
227 229
228 } // namespace internal 230 } // namespace internal
229 } // namespace v8 231 } // namespace v8
OLDNEW
« src/compiler-dispatcher/compiler-dispatcher.cc ('K') | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698