| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3356 bool v8::V8::IdleNotification() { | 3356 bool v8::V8::IdleNotification() { |
| 3357 // Returning true tells the caller that it need not | 3357 // Returning true tells the caller that it need not |
| 3358 // continue to call IdleNotification. | 3358 // continue to call IdleNotification. |
| 3359 if (!i::V8::IsRunning()) return true; | 3359 if (!i::V8::IsRunning()) return true; |
| 3360 return i::V8::IdleNotification(); | 3360 return i::V8::IdleNotification(); |
| 3361 } | 3361 } |
| 3362 | 3362 |
| 3363 | 3363 |
| 3364 void v8::V8::LowMemoryNotification() { | 3364 void v8::V8::LowMemoryNotification() { |
| 3365 if (!i::V8::IsRunning()) return; | 3365 if (!i::V8::IsRunning()) return; |
| 3366 i::Heap::CollectAllGarbage(true); | 3366 i::Heap::CollectAllGarbage(i::Heap::kForceCompactionMask); |
| 3367 } | 3367 } |
| 3368 | 3368 |
| 3369 | 3369 |
| 3370 int v8::V8::ContextDisposedNotification() { | 3370 int v8::V8::ContextDisposedNotification() { |
| 3371 if (!i::V8::IsRunning()) return 0; | 3371 if (!i::V8::IsRunning()) return 0; |
| 3372 return i::Heap::NotifyContextDisposed(); | 3372 return i::Heap::NotifyContextDisposed(); |
| 3373 } | 3373 } |
| 3374 | 3374 |
| 3375 | 3375 |
| 3376 const char* v8::V8::GetVersion() { | 3376 const char* v8::V8::GetVersion() { |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4180 | 4180 |
| 4181 | 4181 |
| 4182 void V8::ResumeProfilerEx(int flags, int tag) { | 4182 void V8::ResumeProfilerEx(int flags, int tag) { |
| 4183 #ifdef ENABLE_LOGGING_AND_PROFILING | 4183 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 4184 if (flags & PROFILER_MODULE_HEAP_SNAPSHOT) { | 4184 if (flags & PROFILER_MODULE_HEAP_SNAPSHOT) { |
| 4185 // Snapshot mode: resume modules, perform GC, then pause only | 4185 // Snapshot mode: resume modules, perform GC, then pause only |
| 4186 // those modules which haven't been started prior to making a | 4186 // those modules which haven't been started prior to making a |
| 4187 // snapshot. | 4187 // snapshot. |
| 4188 | 4188 |
| 4189 // Make a GC prior to taking a snapshot. | 4189 // Make a GC prior to taking a snapshot. |
| 4190 i::Heap::CollectAllGarbage(false); | 4190 i::Heap::CollectAllGarbage(i::Heap::kNoGCFlags); |
| 4191 // Reset snapshot flag and CPU module flags. | 4191 // Reset snapshot flag and CPU module flags. |
| 4192 flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU); | 4192 flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU); |
| 4193 const int current_flags = i::Logger::GetActiveProfilerModules(); | 4193 const int current_flags = i::Logger::GetActiveProfilerModules(); |
| 4194 i::Logger::ResumeProfiler(flags, tag); | 4194 i::Logger::ResumeProfiler(flags, tag); |
| 4195 i::Heap::CollectAllGarbage(false); | 4195 i::Heap::CollectAllGarbage(i::Heap::kNoGCFlags); |
| 4196 i::Logger::PauseProfiler(~current_flags & flags, tag); | 4196 i::Logger::PauseProfiler(~current_flags & flags, tag); |
| 4197 } else { | 4197 } else { |
| 4198 i::Logger::ResumeProfiler(flags, tag); | 4198 i::Logger::ResumeProfiler(flags, tag); |
| 4199 } | 4199 } |
| 4200 #endif | 4200 #endif |
| 4201 } | 4201 } |
| 4202 | 4202 |
| 4203 | 4203 |
| 4204 void V8::PauseProfilerEx(int flags, int tag) { | 4204 void V8::PauseProfilerEx(int flags, int tag) { |
| 4205 #ifdef ENABLE_LOGGING_AND_PROFILING | 4205 #ifdef ENABLE_LOGGING_AND_PROFILING |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5180 | 5180 |
| 5181 | 5181 |
| 5182 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5182 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 5183 HandleScopeImplementer* thread_local = | 5183 HandleScopeImplementer* thread_local = |
| 5184 reinterpret_cast<HandleScopeImplementer*>(storage); | 5184 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 5185 thread_local->IterateThis(v); | 5185 thread_local->IterateThis(v); |
| 5186 return storage + ArchiveSpacePerThread(); | 5186 return storage + ArchiveSpacePerThread(); |
| 5187 } | 5187 } |
| 5188 | 5188 |
| 5189 } } // namespace v8::internal | 5189 } } // namespace v8::internal |
| OLD | NEW |