| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 bool V8::has_been_disposed_ = false; | 48 bool V8::has_been_disposed_ = false; |
| 49 bool V8::has_fatal_error_ = false; | 49 bool V8::has_fatal_error_ = false; |
| 50 bool V8::use_crankshaft_ = true; | 50 bool V8::use_crankshaft_ = true; |
| 51 | 51 |
| 52 | 52 |
| 53 bool V8::Initialize(Deserializer* des) { | 53 bool V8::Initialize(Deserializer* des) { |
| 54 bool create_heap_objects = des == NULL; | 54 bool create_heap_objects = des == NULL; |
| 55 if (has_been_disposed_ || has_fatal_error_) return false; | 55 if (has_been_disposed_ || has_fatal_error_) return false; |
| 56 if (IsRunning()) return true; | 56 if (IsRunning()) return true; |
| 57 | 57 |
| 58 #if defined(V8_TARGET_ARCH_ARM) && !defined(USE_ARM_EABI) |
| 59 use_crankshaft_ = false; |
| 60 #else |
| 58 use_crankshaft_ = FLAG_crankshaft; | 61 use_crankshaft_ = FLAG_crankshaft; |
| 62 #endif |
| 63 |
| 59 // Peephole optimization might interfere with deoptimization. | 64 // Peephole optimization might interfere with deoptimization. |
| 60 FLAG_peephole_optimization = !use_crankshaft_; | 65 FLAG_peephole_optimization = !use_crankshaft_; |
| 61 is_running_ = true; | 66 is_running_ = true; |
| 62 has_been_setup_ = true; | 67 has_been_setup_ = true; |
| 63 has_fatal_error_ = false; | 68 has_fatal_error_ = false; |
| 64 has_been_disposed_ = false; | 69 has_been_disposed_ = false; |
| 65 #ifdef DEBUG | 70 #ifdef DEBUG |
| 66 // The initialization process does not handle memory exhaustion. | 71 // The initialization process does not handle memory exhaustion. |
| 67 DisallowAllocationFailure disallow_allocation_failure; | 72 DisallowAllocationFailure disallow_allocation_failure; |
| 68 #endif | 73 #endif |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 154 |
| 150 void V8::SetFatalError() { | 155 void V8::SetFatalError() { |
| 151 is_running_ = false; | 156 is_running_ = false; |
| 152 has_fatal_error_ = true; | 157 has_fatal_error_ = true; |
| 153 } | 158 } |
| 154 | 159 |
| 155 | 160 |
| 156 void V8::TearDown() { | 161 void V8::TearDown() { |
| 157 if (!has_been_setup_ || has_been_disposed_) return; | 162 if (!has_been_setup_ || has_been_disposed_) return; |
| 158 | 163 |
| 159 if (FLAG_time_hydrogen) HStatistics::Instance()->Print(); | 164 if (FLAG_hydrogen_stats) HStatistics::Instance()->Print(); |
| 160 | 165 |
| 161 // We must stop the logger before we tear down other components. | 166 // We must stop the logger before we tear down other components. |
| 162 Logger::EnsureTickerStopped(); | 167 Logger::EnsureTickerStopped(); |
| 163 | 168 |
| 164 Deoptimizer::TearDown(); | 169 Deoptimizer::TearDown(); |
| 165 | 170 |
| 166 if (FLAG_preemption) { | 171 if (FLAG_preemption) { |
| 167 v8::Locker locker; | 172 v8::Locker locker; |
| 168 v8::Locker::StopPreemption(); | 173 v8::Locker::StopPreemption(); |
| 169 } | 174 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 266 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
| 262 const double binary_million = 1048576.0; | 267 const double binary_million = 1048576.0; |
| 263 r->double_value = binary_million; | 268 r->double_value = binary_million; |
| 264 r->uint64_t_value |= random_bits; | 269 r->uint64_t_value |= random_bits; |
| 265 r->double_value -= binary_million; | 270 r->double_value -= binary_million; |
| 266 | 271 |
| 267 return heap_number; | 272 return heap_number; |
| 268 } | 273 } |
| 269 | 274 |
| 270 } } // namespace v8::internal | 275 } } // namespace v8::internal |
| OLD | NEW |