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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (des) des->GetLog(); | 64 if (des) des->GetLog(); |
65 | 65 |
66 // Setup the platform OS support. | 66 // Setup the platform OS support. |
67 OS::Setup(); | 67 OS::Setup(); |
68 | 68 |
69 // Initialize other runtime facilities | 69 // Initialize other runtime facilities |
70 #if !V8_HOST_ARCH_ARM && V8_TARGET_ARCH_ARM | 70 #if !V8_HOST_ARCH_ARM && V8_TARGET_ARCH_ARM |
71 ::assembler::arm::Simulator::Initialize(); | 71 ::assembler::arm::Simulator::Initialize(); |
72 #endif | 72 #endif |
73 | 73 |
| 74 { // NOLINT |
| 75 // Ensure that the thread has a valid stack guard. The v8::Locker object |
| 76 // will ensure this too, but we don't have to use lockers if we are only |
| 77 // using one thread. |
| 78 ExecutionAccess lock; |
| 79 StackGuard::InitThread(lock); |
| 80 } |
| 81 |
74 // Setup the object heap | 82 // Setup the object heap |
75 ASSERT(!Heap::HasBeenSetup()); | 83 ASSERT(!Heap::HasBeenSetup()); |
76 if (!Heap::Setup(create_heap_objects)) { | 84 if (!Heap::Setup(create_heap_objects)) { |
77 SetFatalError(); | 85 SetFatalError(); |
78 return false; | 86 return false; |
79 } | 87 } |
80 | 88 |
81 Bootstrapper::Initialize(create_heap_objects); | 89 Bootstrapper::Initialize(create_heap_objects); |
82 Builtins::Setup(create_heap_objects); | 90 Builtins::Setup(create_heap_objects); |
83 Top::Initialize(); | 91 Top::Initialize(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 179 } |
172 | 180 |
173 | 181 |
174 Smi* V8::RandomPositiveSmi() { | 182 Smi* V8::RandomPositiveSmi() { |
175 uint32_t random = Random(); | 183 uint32_t random = Random(); |
176 ASSERT(IsPowerOf2(Smi::kMaxValue + 1)); | 184 ASSERT(IsPowerOf2(Smi::kMaxValue + 1)); |
177 return Smi::FromInt(random & Smi::kMaxValue); | 185 return Smi::FromInt(random & Smi::kMaxValue); |
178 } | 186 } |
179 | 187 |
180 } } // namespace v8::internal | 188 } } // namespace v8::internal |
OLD | NEW |