OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 ASSERT(context->IsNativeContext()); | 161 ASSERT(context->IsNativeContext()); |
162 ByteArray* seed = context->random_seed(); | 162 ByteArray* seed = context->random_seed(); |
163 return random_base(reinterpret_cast<uint32_t*>(seed->GetDataStartAddress())); | 163 return random_base(reinterpret_cast<uint32_t*>(seed->GetDataStartAddress())); |
164 } | 164 } |
165 | 165 |
166 | 166 |
167 // Used internally by the JIT and memory allocator for security | 167 // Used internally by the JIT and memory allocator for security |
168 // purposes. So, we keep a different state to prevent informations | 168 // purposes. So, we keep a different state to prevent informations |
169 // leaks that could be used in an exploit. | 169 // leaks that could be used in an exploit. |
170 uint32_t V8::RandomPrivate(Isolate* isolate) { | 170 uint32_t V8::RandomPrivate(Isolate* isolate) { |
171 ASSERT(isolate == Isolate::Current()); | |
172 return random_base(isolate->private_random_seed()); | 171 return random_base(isolate->private_random_seed()); |
173 } | 172 } |
174 | 173 |
175 | 174 |
176 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { | 175 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { |
177 if (call_completed_callbacks_ == NULL) { // Lazy init. | 176 if (call_completed_callbacks_ == NULL) { // Lazy init. |
178 call_completed_callbacks_ = new List<CallCompletedCallback>(); | 177 call_completed_callbacks_ = new List<CallCompletedCallback>(); |
179 } | 178 } |
180 for (int i = 0; i < call_completed_callbacks_->length(); i++) { | 179 for (int i = 0; i < call_completed_callbacks_->length(); i++) { |
181 if (callback == call_completed_callbacks_->at(i)) return; | 180 if (callback == call_completed_callbacks_->at(i)) return; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 ExternalReference::SetUp(); | 300 ExternalReference::SetUp(); |
302 Bootstrapper::InitializeOncePerProcess(); | 301 Bootstrapper::InitializeOncePerProcess(); |
303 } | 302 } |
304 | 303 |
305 | 304 |
306 void V8::InitializeOncePerProcess() { | 305 void V8::InitializeOncePerProcess() { |
307 CallOnce(&init_once, &InitializeOncePerProcessImpl); | 306 CallOnce(&init_once, &InitializeOncePerProcessImpl); |
308 } | 307 } |
309 | 308 |
310 } } // namespace v8::internal | 309 } } // namespace v8::internal |
OLD | NEW |