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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 // Used internally by the JIT and memory allocator for security | 168 // Used internally by the JIT and memory allocator for security |
169 // purposes. So, we keep a different state to prevent informations | 169 // purposes. So, we keep a different state to prevent informations |
170 // leaks that could be used in an exploit. | 170 // leaks that could be used in an exploit. |
171 uint32_t V8::RandomPrivate(Isolate* isolate) { | 171 uint32_t V8::RandomPrivate(Isolate* isolate) { |
172 ASSERT(isolate == Isolate::Current()); | 172 ASSERT(isolate == Isolate::Current()); |
173 return random_base(isolate->private_random_seed()); | 173 return random_base(isolate->private_random_seed()); |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 bool V8::IdleNotification(int hint) { | |
178 // Returning true tells the caller that there is no need to call | |
179 // IdleNotification again. | |
180 if (!FLAG_use_idle_notification) return true; | |
181 | |
182 // Tell the heap that it may want to adjust. | |
183 return HEAP->IdleNotification(hint); | |
184 } | |
185 | |
186 | |
187 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { | 177 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { |
188 if (call_completed_callbacks_ == NULL) { // Lazy init. | 178 if (call_completed_callbacks_ == NULL) { // Lazy init. |
189 call_completed_callbacks_ = new List<CallCompletedCallback>(); | 179 call_completed_callbacks_ = new List<CallCompletedCallback>(); |
190 } | 180 } |
191 for (int i = 0; i < call_completed_callbacks_->length(); i++) { | 181 for (int i = 0; i < call_completed_callbacks_->length(); i++) { |
192 if (callback == call_completed_callbacks_->at(i)) return; | 182 if (callback == call_completed_callbacks_->at(i)) return; |
193 } | 183 } |
194 call_completed_callbacks_->Add(callback); | 184 call_completed_callbacks_->Add(callback); |
195 } | 185 } |
196 | 186 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 ExternalReference::SetUp(); | 302 ExternalReference::SetUp(); |
313 Bootstrapper::InitializeOncePerProcess(); | 303 Bootstrapper::InitializeOncePerProcess(); |
314 } | 304 } |
315 | 305 |
316 | 306 |
317 void V8::InitializeOncePerProcess() { | 307 void V8::InitializeOncePerProcess() { |
318 CallOnce(&init_once, &InitializeOncePerProcessImpl); | 308 CallOnce(&init_once, &InitializeOncePerProcessImpl); |
319 } | 309 } |
320 | 310 |
321 } } // namespace v8::internal | 311 } } // namespace v8::internal |
OLD | NEW |