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 27 matching lines...) Expand all Loading... |
38 #endif | 38 #endif |
39 | 39 |
40 namespace v8 { | 40 namespace v8 { |
41 namespace internal { | 41 namespace internal { |
42 | 42 |
43 bool V8::is_running_ = false; | 43 bool V8::is_running_ = false; |
44 bool V8::has_been_setup_ = false; | 44 bool V8::has_been_setup_ = false; |
45 bool V8::has_been_disposed_ = false; | 45 bool V8::has_been_disposed_ = false; |
46 bool V8::has_fatal_error_ = false; | 46 bool V8::has_fatal_error_ = false; |
47 | 47 |
48 bool V8::Initialize(Deserializer *des) { | 48 bool V8::Initialize(GenericDeserializer *des) { |
49 bool create_heap_objects = des == NULL; | 49 bool create_heap_objects = des == NULL; |
50 if (has_been_disposed_ || has_fatal_error_) return false; | 50 if (has_been_disposed_ || has_fatal_error_) return false; |
51 if (IsRunning()) return true; | 51 if (IsRunning()) return true; |
52 | 52 |
53 is_running_ = true; | 53 is_running_ = true; |
54 has_been_setup_ = true; | 54 has_been_setup_ = true; |
55 has_fatal_error_ = false; | 55 has_fatal_error_ = false; |
56 has_been_disposed_ = false; | 56 has_been_disposed_ = false; |
57 #ifdef DEBUG | 57 #ifdef DEBUG |
58 // The initialization process does not handle memory exhaustion. | 58 // The initialization process does not handle memory exhaustion. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 Smi* V8::RandomPositiveSmi() { | 183 Smi* V8::RandomPositiveSmi() { |
184 uint32_t random = Random(); | 184 uint32_t random = Random(); |
185 ASSERT(static_cast<uint32_t>(Smi::kMaxValue) >= kRandomPositiveSmiMax); | 185 ASSERT(static_cast<uint32_t>(Smi::kMaxValue) >= kRandomPositiveSmiMax); |
186 // kRandomPositiveSmiMax must match the value being divided | 186 // kRandomPositiveSmiMax must match the value being divided |
187 // by in math.js. | 187 // by in math.js. |
188 return Smi::FromInt(random & kRandomPositiveSmiMax); | 188 return Smi::FromInt(random & kRandomPositiveSmiMax); |
189 } | 189 } |
190 | 190 |
191 } } // namespace v8::internal | 191 } } // namespace v8::internal |
OLD | NEW |