OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef V8_V8_PLATFORM_H_ | 5 #ifndef V8_V8_PLATFORM_H_ |
6 #define V8_V8_PLATFORM_H_ | 6 #define V8_V8_PLATFORM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 * whether to execute the task on a dedicated thread. | 49 * whether to execute the task on a dedicated thread. |
50 */ | 50 */ |
51 enum ExpectedRuntime { | 51 enum ExpectedRuntime { |
52 kShortRunningTask, | 52 kShortRunningTask, |
53 kLongRunningTask | 53 kLongRunningTask |
54 }; | 54 }; |
55 | 55 |
56 virtual ~Platform() {} | 56 virtual ~Platform() {} |
57 | 57 |
58 /** | 58 /** |
59 * Gets the number of threads that are used to execute background tasks. Can | |
60 * be used to limit parallelism in V8. | |
jochen (gone - plz use gerrit)
2016/02/05 08:27:07
I'd remove the "Can be used to limit..." sentence
jochen (gone - plz use gerrit)
2016/02/05 08:27:53
and maybe explain what 0 means. I'd guess it means
Michael Lippautz
2016/02/05 09:15:34
Done.
Michael Lippautz
2016/02/05 09:15:34
Done.
| |
61 */ | |
62 virtual int NumberOfAvailableBackgroundThreads() { return 0; } | |
jochen (gone - plz use gerrit)
2016/02/05 08:27:07
size_t
Michael Lippautz
2016/02/05 09:15:34
Done.
| |
63 | |
64 /** | |
59 * Schedules a task to be invoked on a background thread. |expected_runtime| | 65 * Schedules a task to be invoked on a background thread. |expected_runtime| |
60 * indicates that the task will run a long time. The Platform implementation | 66 * indicates that the task will run a long time. The Platform implementation |
61 * takes ownership of |task|. There is no guarantee about order of execution | 67 * takes ownership of |task|. There is no guarantee about order of execution |
62 * of tasks wrt order of scheduling, nor is there a guarantee about the | 68 * of tasks wrt order of scheduling, nor is there a guarantee about the |
63 * thread the task will be run on. | 69 * thread the task will be run on. |
64 */ | 70 */ |
65 virtual void CallOnBackgroundThread(Task* task, | 71 virtual void CallOnBackgroundThread(Task* task, |
66 ExpectedRuntime expected_runtime) = 0; | 72 ExpectedRuntime expected_runtime) = 0; |
67 | 73 |
68 /** | 74 /** |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 * Sets the duration field of a COMPLETE trace event. It must be called with | 158 * Sets the duration field of a COMPLETE trace event. It must be called with |
153 * the handle returned from AddTraceEvent(). | 159 * the handle returned from AddTraceEvent(). |
154 **/ | 160 **/ |
155 virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, | 161 virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, |
156 const char* name, uint64_t handle) {} | 162 const char* name, uint64_t handle) {} |
157 }; | 163 }; |
158 | 164 |
159 } // namespace v8 | 165 } // namespace v8 |
160 | 166 |
161 #endif // V8_V8_PLATFORM_H_ | 167 #endif // V8_V8_PLATFORM_H_ |
OLD | NEW |