| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3639 } | 3639 } |
| 3640 | 3640 |
| 3641 | 3641 |
| 3642 void V8::ResumeProfilerEx(int flags, int tag) { | 3642 void V8::ResumeProfilerEx(int flags, int tag) { |
| 3643 #ifdef ENABLE_LOGGING_AND_PROFILING | 3643 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 3644 if (flags & PROFILER_MODULE_HEAP_SNAPSHOT) { | 3644 if (flags & PROFILER_MODULE_HEAP_SNAPSHOT) { |
| 3645 // Snapshot mode: resume modules, perform GC, then pause only | 3645 // Snapshot mode: resume modules, perform GC, then pause only |
| 3646 // those modules which haven't been started prior to making a | 3646 // those modules which haven't been started prior to making a |
| 3647 // snapshot. | 3647 // snapshot. |
| 3648 | 3648 |
| 3649 // Make a GC prior to taking a snapshot. |
| 3650 i::Heap::CollectAllGarbage(false); |
| 3649 // Reset snapshot flag and CPU module flags. | 3651 // Reset snapshot flag and CPU module flags. |
| 3650 flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU); | 3652 flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU); |
| 3651 const int current_flags = i::Logger::GetActiveProfilerModules(); | 3653 const int current_flags = i::Logger::GetActiveProfilerModules(); |
| 3652 i::Logger::ResumeProfiler(flags, tag); | 3654 i::Logger::ResumeProfiler(flags, tag); |
| 3653 i::Heap::CollectAllGarbage(false); | 3655 i::Heap::CollectAllGarbage(false); |
| 3654 i::Logger::PauseProfiler(~current_flags & flags, tag); | 3656 i::Logger::PauseProfiler(~current_flags & flags, tag); |
| 3655 } else { | 3657 } else { |
| 3656 i::Logger::ResumeProfiler(flags, tag); | 3658 i::Logger::ResumeProfiler(flags, tag); |
| 3657 } | 3659 } |
| 3658 #endif | 3660 #endif |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4240 | 4242 |
| 4241 | 4243 |
| 4242 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 4244 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 4243 HandleScopeImplementer* thread_local = | 4245 HandleScopeImplementer* thread_local = |
| 4244 reinterpret_cast<HandleScopeImplementer*>(storage); | 4246 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 4245 thread_local->IterateThis(v); | 4247 thread_local->IterateThis(v); |
| 4246 return storage + ArchiveSpacePerThread(); | 4248 return storage + ArchiveSpacePerThread(); |
| 4247 } | 4249 } |
| 4248 | 4250 |
| 4249 } } // namespace v8::internal | 4251 } } // namespace v8::internal |
| OLD | NEW |