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 #include "src/libplatform/default-platform.h" | 5 #include "src/libplatform/default-platform.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "include/libplatform/libplatform.h" | 10 #include "include/libplatform/libplatform.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 void PrintStackTrace() { | 23 void PrintStackTrace() { |
24 v8::base::debug::StackTrace trace; | 24 v8::base::debug::StackTrace trace; |
25 trace.Print(); | 25 trace.Print(); |
26 // Avoid dumping duplicate stack trace on abort signal. | 26 // Avoid dumping duplicate stack trace on abort signal. |
27 v8::base::debug::DisableSignalStackDump(); | 27 v8::base::debug::DisableSignalStackDump(); |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 v8::Platform* CreateDefaultPlatform(int thread_pool_size, | 32 v8::Platform* CreateDefaultPlatform( |
33 IdleTaskSupport idle_task_support) { | 33 int thread_pool_size, IdleTaskSupport idle_task_support, |
34 v8::base::debug::EnableInProcessStackDumping(); | 34 InProcessStackDumping in_process_stack_dumping) { |
| 35 if (in_process_stack_dumping == InProcessStackDumping::kEnabled) { |
| 36 v8::base::debug::EnableInProcessStackDumping(); |
| 37 } |
35 DefaultPlatform* platform = new DefaultPlatform(idle_task_support); | 38 DefaultPlatform* platform = new DefaultPlatform(idle_task_support); |
36 platform->SetThreadPoolSize(thread_pool_size); | 39 platform->SetThreadPoolSize(thread_pool_size); |
37 platform->EnsureInitialized(); | 40 platform->EnsureInitialized(); |
38 return platform; | 41 return platform; |
39 } | 42 } |
40 | 43 |
41 | 44 |
42 bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate) { | 45 bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate) { |
43 return reinterpret_cast<DefaultPlatform*>(platform)->PumpMessageLoop(isolate); | 46 return reinterpret_cast<DefaultPlatform*>(platform)->PumpMessageLoop(isolate); |
44 } | 47 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 if (!tracing_controller_) return; | 293 if (!tracing_controller_) return; |
291 tracing_controller_->RemoveTraceStateObserver(observer); | 294 tracing_controller_->RemoveTraceStateObserver(observer); |
292 } | 295 } |
293 | 296 |
294 Platform::StackTracePrinter DefaultPlatform::GetStackTracePrinter() { | 297 Platform::StackTracePrinter DefaultPlatform::GetStackTracePrinter() { |
295 return PrintStackTrace; | 298 return PrintStackTrace; |
296 } | 299 } |
297 | 300 |
298 } // namespace platform | 301 } // namespace platform |
299 } // namespace v8 | 302 } // namespace v8 |
OLD | NEW |