| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 21 matching lines...) Expand all Loading... |
| 32 #include "deoptimizer.h" | 32 #include "deoptimizer.h" |
| 33 #include "heap-profiler.h" | 33 #include "heap-profiler.h" |
| 34 #include "hydrogen.h" | 34 #include "hydrogen.h" |
| 35 #include "lithium-allocator.h" | 35 #include "lithium-allocator.h" |
| 36 #include "log.h" | 36 #include "log.h" |
| 37 #include "oprofile-agent.h" | 37 #include "oprofile-agent.h" |
| 38 #include "runtime-profiler.h" | 38 #include "runtime-profiler.h" |
| 39 #include "serialize.h" | 39 #include "serialize.h" |
| 40 #include "simulator.h" | 40 #include "simulator.h" |
| 41 #include "stub-cache.h" | 41 #include "stub-cache.h" |
| 42 #include "write-buffer.h" | 42 #include "store-buffer.h" |
| 43 | 43 |
| 44 namespace v8 { | 44 namespace v8 { |
| 45 namespace internal { | 45 namespace internal { |
| 46 | 46 |
| 47 bool V8::is_running_ = false; | 47 bool V8::is_running_ = false; |
| 48 bool V8::has_been_setup_ = false; | 48 bool V8::has_been_setup_ = false; |
| 49 bool V8::has_been_disposed_ = false; | 49 bool V8::has_been_disposed_ = false; |
| 50 bool V8::has_fatal_error_ = false; | 50 bool V8::has_fatal_error_ = false; |
| 51 bool V8::use_crankshaft_ = true; | 51 bool V8::use_crankshaft_ = true; |
| 52 | 52 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 { // NOLINT | 89 { // NOLINT |
| 90 // Ensure that the thread has a valid stack guard. The v8::Locker object | 90 // Ensure that the thread has a valid stack guard. The v8::Locker object |
| 91 // will ensure this too, but we don't have to use lockers if we are only | 91 // will ensure this too, but we don't have to use lockers if we are only |
| 92 // using one thread. | 92 // using one thread. |
| 93 ExecutionAccess lock; | 93 ExecutionAccess lock; |
| 94 StackGuard::InitThread(lock); | 94 StackGuard::InitThread(lock); |
| 95 } | 95 } |
| 96 | 96 |
| 97 WriteBuffer::Setup(); | 97 StoreBuffer::Setup(); |
| 98 | 98 |
| 99 // Setup the object heap | 99 // Setup the object heap |
| 100 ASSERT(!Heap::HasBeenSetup()); | 100 ASSERT(!Heap::HasBeenSetup()); |
| 101 if (!Heap::Setup(create_heap_objects)) { | 101 if (!Heap::Setup(create_heap_objects)) { |
| 102 SetFatalError(); | 102 SetFatalError(); |
| 103 return false; | 103 return false; |
| 104 } | 104 } |
| 105 | 105 |
| 106 Bootstrapper::Initialize(create_heap_objects); | 106 Bootstrapper::Initialize(create_heap_objects); |
| 107 Builtins::Setup(create_heap_objects); | 107 Builtins::Setup(create_heap_objects); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 Top::TearDown(); | 177 Top::TearDown(); |
| 178 | 178 |
| 179 HeapProfiler::TearDown(); | 179 HeapProfiler::TearDown(); |
| 180 CpuProfiler::TearDown(); | 180 CpuProfiler::TearDown(); |
| 181 RuntimeProfiler::TearDown(); | 181 RuntimeProfiler::TearDown(); |
| 182 | 182 |
| 183 Logger::TearDown(); | 183 Logger::TearDown(); |
| 184 Heap::TearDown(); | 184 Heap::TearDown(); |
| 185 | 185 |
| 186 WriteBuffer::TearDown(); | 186 StoreBuffer::TearDown(); |
| 187 | 187 |
| 188 is_running_ = false; | 188 is_running_ = false; |
| 189 has_been_disposed_ = true; | 189 has_been_disposed_ = true; |
| 190 } | 190 } |
| 191 | 191 |
| 192 | 192 |
| 193 static uint32_t random_seed() { | 193 static uint32_t random_seed() { |
| 194 if (FLAG_random_seed == 0) { | 194 if (FLAG_random_seed == 0) { |
| 195 return random(); | 195 return random(); |
| 196 } | 196 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 264 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
| 265 const double binary_million = 1048576.0; | 265 const double binary_million = 1048576.0; |
| 266 r->double_value = binary_million; | 266 r->double_value = binary_million; |
| 267 r->uint64_t_value |= random_bits; | 267 r->uint64_t_value |= random_bits; |
| 268 r->double_value -= binary_million; | 268 r->double_value -= binary_million; |
| 269 | 269 |
| 270 return heap_number; | 270 return heap_number; |
| 271 } | 271 } |
| 272 | 272 |
| 273 } } // namespace v8::internal | 273 } } // namespace v8::internal |
| OLD | NEW |