Chromium Code Reviews| 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 25 matching lines...) Expand all Loading... | |
| 36 #include "frames.h" | 36 #include "frames.h" |
| 37 #include "heap-profiler.h" | 37 #include "heap-profiler.h" |
| 38 #include "hydrogen.h" | 38 #include "hydrogen.h" |
| 39 #include "lithium-allocator.h" | 39 #include "lithium-allocator.h" |
| 40 #include "log.h" | 40 #include "log.h" |
| 41 #include "once.h" | 41 #include "once.h" |
| 42 #include "platform.h" | 42 #include "platform.h" |
| 43 #include "runtime-profiler.h" | 43 #include "runtime-profiler.h" |
| 44 #include "serialize.h" | 44 #include "serialize.h" |
| 45 #include "store-buffer.h" | 45 #include "store-buffer.h" |
| 46 #include "compilation-cache.h" | |
| 46 | 47 |
| 47 namespace v8 { | 48 namespace v8 { |
| 48 namespace internal { | 49 namespace internal { |
| 49 | 50 |
| 50 V8_DECLARE_ONCE(init_once); | 51 V8_DECLARE_ONCE(init_once); |
| 51 | 52 |
| 52 bool V8::is_running_ = false; | 53 bool V8::is_running_ = false; |
| 53 bool V8::has_been_set_up_ = false; | 54 bool V8::has_been_set_up_ = false; |
| 54 bool V8::has_been_disposed_ = false; | 55 bool V8::has_been_disposed_ = false; |
| 55 bool V8::has_fatal_error_ = false; | 56 bool V8::has_fatal_error_ = false; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 ASSERT(isolate == Isolate::Current()); | 183 ASSERT(isolate == Isolate::Current()); |
| 183 return random_base(isolate->private_random_seed()); | 184 return random_base(isolate->private_random_seed()); |
| 184 } | 185 } |
| 185 | 186 |
| 186 | 187 |
| 187 bool V8::IdleNotification(int hint) { | 188 bool V8::IdleNotification(int hint) { |
| 188 // Returning true tells the caller that there is no need to call | 189 // Returning true tells the caller that there is no need to call |
| 189 // IdleNotification again. | 190 // IdleNotification again. |
| 190 if (!FLAG_use_idle_notification) return true; | 191 if (!FLAG_use_idle_notification) return true; |
| 191 | 192 |
| 192 // Tell the heap that it may want to adjust. | 193 // Tell the heap that it may want to adjust. If the heap has nothing more |
| 193 return HEAP->IdleNotification(hint); | 194 // to clean, we are really idle, so we can clear the short term caches. |
| 195 return HEAP->IdleNotification(hint) && | |
|
ulan
2012/09/28 14:26:23
This concerns me. The embedder is not required to
| |
| 196 ISOLATE->compilation_cache()->ClearShortTerm(); | |
| 194 } | 197 } |
| 195 | 198 |
| 196 | 199 |
| 197 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { | 200 void V8::AddCallCompletedCallback(CallCompletedCallback callback) { |
| 198 if (call_completed_callbacks_ == NULL) { // Lazy init. | 201 if (call_completed_callbacks_ == NULL) { // Lazy init. |
| 199 call_completed_callbacks_ = new List<CallCompletedCallback>(); | 202 call_completed_callbacks_ = new List<CallCompletedCallback>(); |
| 200 } | 203 } |
| 201 for (int i = 0; i < call_completed_callbacks_->length(); i++) { | 204 for (int i = 0; i < call_completed_callbacks_->length(); i++) { |
| 202 if (callback == call_completed_callbacks_->at(i)) return; | 205 if (callback == call_completed_callbacks_->at(i)) return; |
| 203 } | 206 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 SetUpJSCallerSavedCodeData(); | 285 SetUpJSCallerSavedCodeData(); |
| 283 SamplerRegistry::SetUp(); | 286 SamplerRegistry::SetUp(); |
| 284 ExternalReference::SetUp(); | 287 ExternalReference::SetUp(); |
| 285 } | 288 } |
| 286 | 289 |
| 287 void V8::InitializeOncePerProcess() { | 290 void V8::InitializeOncePerProcess() { |
| 288 CallOnce(&init_once, &InitializeOncePerProcessImpl); | 291 CallOnce(&init_once, &InitializeOncePerProcessImpl); |
| 289 } | 292 } |
| 290 | 293 |
| 291 } } // namespace v8::internal | 294 } } // namespace v8::internal |
| OLD | NEW |