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 14 matching lines...) Expand all Loading... |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "assembler.h" | 30 #include "assembler.h" |
31 #include "isolate.h" | 31 #include "isolate.h" |
32 #include "elements.h" | 32 #include "elements.h" |
33 #include "bootstrapper.h" | 33 #include "bootstrapper.h" |
34 #include "debug.h" | 34 #include "debug.h" |
35 #ifdef V8_USE_DEFAULT_PLATFORM | |
36 #include "default-platform.h" | |
37 #endif | |
38 #include "deoptimizer.h" | 35 #include "deoptimizer.h" |
39 #include "frames.h" | 36 #include "frames.h" |
40 #include "heap-profiler.h" | 37 #include "heap-profiler.h" |
41 #include "hydrogen.h" | 38 #include "hydrogen.h" |
| 39 #ifdef V8_USE_DEFAULT_PLATFORM |
| 40 #include "libplatform/default-platform.h" |
| 41 #endif |
42 #include "lithium-allocator.h" | 42 #include "lithium-allocator.h" |
43 #include "objects.h" | 43 #include "objects.h" |
44 #include "once.h" | 44 #include "once.h" |
45 #include "platform.h" | 45 #include "platform.h" |
46 #include "sampler.h" | 46 #include "sampler.h" |
47 #include "runtime-profiler.h" | 47 #include "runtime-profiler.h" |
48 #include "serialize.h" | 48 #include "serialize.h" |
49 #include "store-buffer.h" | 49 #include "store-buffer.h" |
50 | 50 |
51 namespace v8 { | 51 namespace v8 { |
(...skipping 20 matching lines...) Expand all Loading... |
72 ASSERT(i::Isolate::CurrentPerIsolateThreadData() != NULL); | 72 ASSERT(i::Isolate::CurrentPerIsolateThreadData() != NULL); |
73 ASSERT(i::Isolate::CurrentPerIsolateThreadData()->thread_id().Equals( | 73 ASSERT(i::Isolate::CurrentPerIsolateThreadData()->thread_id().Equals( |
74 i::ThreadId::Current())); | 74 i::ThreadId::Current())); |
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 |
| 83 DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_); |
| 84 platform->SetThreadPoolSize(isolate->max_available_threads()); |
| 85 #endif |
| 86 |
82 return isolate->Init(des); | 87 return isolate->Init(des); |
83 } | 88 } |
84 | 89 |
85 | 90 |
86 void V8::TearDown() { | 91 void V8::TearDown() { |
87 Isolate* isolate = Isolate::Current(); | 92 Isolate* isolate = Isolate::Current(); |
88 ASSERT(isolate->IsDefaultIsolate()); | 93 ASSERT(isolate->IsDefaultIsolate()); |
89 if (!isolate->IsInitialized()) return; | 94 if (!isolate->IsInitialized()) return; |
90 | 95 |
91 // The isolate has to be torn down before clearing the LOperand | 96 // The isolate has to be torn down before clearing the LOperand |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 platform_ = NULL; | 204 platform_ = NULL; |
200 } | 205 } |
201 | 206 |
202 | 207 |
203 v8::Platform* V8::GetCurrentPlatform() { | 208 v8::Platform* V8::GetCurrentPlatform() { |
204 ASSERT(platform_); | 209 ASSERT(platform_); |
205 return platform_; | 210 return platform_; |
206 } | 211 } |
207 | 212 |
208 } } // namespace v8::internal | 213 } } // namespace v8::internal |
OLD | NEW |