OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 ASSERT(i::Isolate::CurrentPerIsolateThreadData()->isolate() == | 75 ASSERT(i::Isolate::CurrentPerIsolateThreadData()->isolate() == |
76 i::Isolate::Current()); | 76 i::Isolate::Current()); |
77 | 77 |
78 Isolate* isolate = Isolate::Current(); | 78 Isolate* isolate = Isolate::Current(); |
79 if (isolate->IsDead()) return false; | 79 if (isolate->IsDead()) return false; |
80 if (isolate->IsInitialized()) return true; | 80 if (isolate->IsInitialized()) return true; |
81 | 81 |
82 #ifdef V8_USE_DEFAULT_PLATFORM | 82 #ifdef V8_USE_DEFAULT_PLATFORM |
83 DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_); | 83 DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_); |
84 platform->SetThreadPoolSize(isolate->max_available_threads()); | 84 platform->SetThreadPoolSize(isolate->max_available_threads()); |
| 85 // We currently only start the threads early, if we know that we'll use them. |
| 86 if (FLAG_job_based_sweeping) platform->EnsureInitialized(); |
85 #endif | 87 #endif |
86 | 88 |
87 return isolate->Init(des); | 89 return isolate->Init(des); |
88 } | 90 } |
89 | 91 |
90 | 92 |
91 void V8::TearDown() { | 93 void V8::TearDown() { |
92 Isolate* isolate = Isolate::Current(); | 94 Isolate* isolate = Isolate::Current(); |
93 ASSERT(isolate->IsDefaultIsolate()); | 95 ASSERT(isolate->IsDefaultIsolate()); |
94 if (!isolate->IsInitialized()) return; | 96 if (!isolate->IsInitialized()) return; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 platform_ = NULL; | 232 platform_ = NULL; |
231 } | 233 } |
232 | 234 |
233 | 235 |
234 v8::Platform* V8::GetCurrentPlatform() { | 236 v8::Platform* V8::GetCurrentPlatform() { |
235 ASSERT(platform_); | 237 ASSERT(platform_); |
236 return platform_; | 238 return platform_; |
237 } | 239 } |
238 | 240 |
239 } } // namespace v8::internal | 241 } } // namespace v8::internal |
OLD | NEW |