| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 for (int i = 0; i < call_completed_callbacks_->length(); i++) { | 160 for (int i = 0; i < call_completed_callbacks_->length(); i++) { |
| 156 call_completed_callbacks_->at(i)(); | 161 call_completed_callbacks_->at(i)(); |
| 157 } | 162 } |
| 158 } | 163 } |
| 159 handle_scope_implementer->DecrementCallDepth(); | 164 handle_scope_implementer->DecrementCallDepth(); |
| 160 } | 165 } |
| 161 | 166 |
| 162 | 167 |
| 163 void V8::InitializeOncePerProcessImpl() { | 168 void V8::InitializeOncePerProcessImpl() { |
| 164 FlagList::EnforceFlagImplications(); | 169 FlagList::EnforceFlagImplications(); |
| 170 |
| 171 if (FLAG_predictable) { |
| 172 if (FLAG_random_seed == 0) { |
| 173 // Avoid random seeds in predictable mode. |
| 174 FLAG_random_seed = 12347; |
| 175 } |
| 176 FLAG_hash_seed = 0; |
| 177 } |
| 178 |
| 165 if (FLAG_stress_compaction) { | 179 if (FLAG_stress_compaction) { |
| 166 FLAG_force_marking_deque_overflows = true; | 180 FLAG_force_marking_deque_overflows = true; |
| 167 FLAG_gc_global = true; | 181 FLAG_gc_global = true; |
| 168 FLAG_max_new_space_size = (1 << (kPageSizeBits - 10)) * 2; | 182 FLAG_max_new_space_size = (1 << (kPageSizeBits - 10)) * 2; |
| 169 } | 183 } |
| 170 | 184 |
| 171 #ifdef V8_USE_DEFAULT_PLATFORM | 185 #ifdef V8_USE_DEFAULT_PLATFORM |
| 172 platform_ = new DefaultPlatform; | 186 platform_ = new DefaultPlatform; |
| 173 #endif | 187 #endif |
| 174 Sampler::SetUp(); | 188 Sampler::SetUp(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 199 platform_ = NULL; | 213 platform_ = NULL; |
| 200 } | 214 } |
| 201 | 215 |
| 202 | 216 |
| 203 v8::Platform* V8::GetCurrentPlatform() { | 217 v8::Platform* V8::GetCurrentPlatform() { |
| 204 ASSERT(platform_); | 218 ASSERT(platform_); |
| 205 return platform_; | 219 return platform_; |
| 206 } | 220 } |
| 207 | 221 |
| 208 } } // namespace v8::internal | 222 } } // namespace v8::internal |
| OLD | NEW |