OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |