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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 Debug::Setup(create_heap_objects); | 91 Debug::Setup(create_heap_objects); |
92 #endif | 92 #endif |
93 StubCache::Initialize(create_heap_objects); | 93 StubCache::Initialize(create_heap_objects); |
94 | 94 |
95 // If we are deserializing, read the state into the now-empty heap. | 95 // If we are deserializing, read the state into the now-empty heap. |
96 if (des != NULL) { | 96 if (des != NULL) { |
97 des->Deserialize(); | 97 des->Deserialize(); |
98 StubCache::Clear(); | 98 StubCache::Clear(); |
99 } | 99 } |
100 | 100 |
| 101 // Deserializing may put strange things in the root array's copy of the |
| 102 // stack guard. |
| 103 Heap::SetStackLimit(StackGuard::jslimit()); |
| 104 |
101 // Setup the CPU support. Must be done after heap setup and after | 105 // Setup the CPU support. Must be done after heap setup and after |
102 // any deserialization because we have to have the initial heap | 106 // any deserialization because we have to have the initial heap |
103 // objects in place for creating the code object used for probing. | 107 // objects in place for creating the code object used for probing. |
104 CPU::Setup(); | 108 CPU::Setup(); |
105 | 109 |
106 OProfileAgent::Initialize(); | 110 OProfileAgent::Initialize(); |
107 | 111 |
108 return true; | 112 return true; |
109 } | 113 } |
110 | 114 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 171 } |
168 | 172 |
169 | 173 |
170 Smi* V8::RandomPositiveSmi() { | 174 Smi* V8::RandomPositiveSmi() { |
171 uint32_t random = Random(); | 175 uint32_t random = Random(); |
172 ASSERT(IsPowerOf2(Smi::kMaxValue + 1)); | 176 ASSERT(IsPowerOf2(Smi::kMaxValue + 1)); |
173 return Smi::FromInt(random & Smi::kMaxValue); | 177 return Smi::FromInt(random & Smi::kMaxValue); |
174 } | 178 } |
175 | 179 |
176 } } // namespace v8::internal | 180 } } // namespace v8::internal |
OLD | NEW |