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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "bootstrapper.h" | 30 #include "bootstrapper.h" |
31 #include "debug.h" | 31 #include "debug.h" |
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" | |
38 #include "runtime-profiler.h" | 37 #include "runtime-profiler.h" |
39 #include "serialize.h" | 38 #include "serialize.h" |
40 #include "simulator.h" | 39 #include "simulator.h" |
41 #include "stub-cache.h" | 40 #include "stub-cache.h" |
42 | 41 |
43 namespace v8 { | 42 namespace v8 { |
44 namespace internal { | 43 namespace internal { |
45 | 44 |
46 bool V8::is_running_ = false; | 45 bool V8::is_running_ = false; |
47 bool V8::has_been_setup_ = false; | 46 bool V8::has_been_setup_ = false; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 121 |
123 // Deserializing may put strange things in the root array's copy of the | 122 // Deserializing may put strange things in the root array's copy of the |
124 // stack guard. | 123 // stack guard. |
125 Heap::SetStackLimits(); | 124 Heap::SetStackLimits(); |
126 | 125 |
127 // Setup the CPU support. Must be done after heap setup and after | 126 // Setup the CPU support. Must be done after heap setup and after |
128 // any deserialization because we have to have the initial heap | 127 // any deserialization because we have to have the initial heap |
129 // objects in place for creating the code object used for probing. | 128 // objects in place for creating the code object used for probing. |
130 CPU::Setup(); | 129 CPU::Setup(); |
131 | 130 |
132 OProfileAgent::Initialize(); | |
133 Deoptimizer::Setup(); | 131 Deoptimizer::Setup(); |
134 LAllocator::Setup(); | 132 LAllocator::Setup(); |
135 RuntimeProfiler::Setup(); | 133 RuntimeProfiler::Setup(); |
136 | 134 |
137 // If we are deserializing, log non-function code objects and compiled | 135 // If we are deserializing, log non-function code objects and compiled |
138 // functions found in the snapshot. | 136 // functions found in the snapshot. |
139 if (des != NULL && FLAG_log_code) { | 137 if (des != NULL && FLAG_log_code) { |
140 HandleScope scope; | 138 HandleScope scope; |
141 LOG(LogCodeObjects()); | 139 LOG(LogCodeObjects()); |
142 LOG(LogCompiledFunctions()); | 140 LOG(LogCompiledFunctions()); |
(...skipping 11 matching lines...) Expand all Loading... |
154 | 152 |
155 void V8::TearDown() { | 153 void V8::TearDown() { |
156 if (!has_been_setup_ || has_been_disposed_) return; | 154 if (!has_been_setup_ || has_been_disposed_) return; |
157 | 155 |
158 if (FLAG_time_hydrogen) HStatistics::Instance()->Print(); | 156 if (FLAG_time_hydrogen) HStatistics::Instance()->Print(); |
159 | 157 |
160 // We must stop the logger before we tear down other components. | 158 // We must stop the logger before we tear down other components. |
161 Logger::EnsureTickerStopped(); | 159 Logger::EnsureTickerStopped(); |
162 | 160 |
163 Deoptimizer::TearDown(); | 161 Deoptimizer::TearDown(); |
164 OProfileAgent::TearDown(); | |
165 | 162 |
166 if (FLAG_preemption) { | 163 if (FLAG_preemption) { |
167 v8::Locker locker; | 164 v8::Locker locker; |
168 v8::Locker::StopPreemption(); | 165 v8::Locker::StopPreemption(); |
169 } | 166 } |
170 | 167 |
171 Builtins::TearDown(); | 168 Builtins::TearDown(); |
172 Bootstrapper::TearDown(); | 169 Bootstrapper::TearDown(); |
173 | 170 |
174 Top::TearDown(); | 171 Top::TearDown(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 256 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
260 const double binary_million = 1048576.0; | 257 const double binary_million = 1048576.0; |
261 r->double_value = binary_million; | 258 r->double_value = binary_million; |
262 r->uint64_t_value |= random_bits; | 259 r->uint64_t_value |= random_bits; |
263 r->double_value -= binary_million; | 260 r->double_value -= binary_million; |
264 | 261 |
265 return heap_number; | 262 return heap_number; |
266 } | 263 } |
267 | 264 |
268 } } // namespace v8::internal | 265 } } // namespace v8::internal |
OLD | NEW |