OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4824 void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) { | 4824 void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) { |
4825 i::Isolate* isolate = i::Isolate::Current(); | 4825 i::Isolate* isolate = i::Isolate::Current(); |
4826 if (IsDeadCheck(isolate, "v8::V8::RemoveMemoryAllocationCallback()")) return; | 4826 if (IsDeadCheck(isolate, "v8::V8::RemoveMemoryAllocationCallback()")) return; |
4827 isolate->memory_allocator()->RemoveMemoryAllocationCallback( | 4827 isolate->memory_allocator()->RemoveMemoryAllocationCallback( |
4828 callback); | 4828 callback); |
4829 } | 4829 } |
4830 | 4830 |
4831 | 4831 |
4832 void V8::PauseProfiler() { | 4832 void V8::PauseProfiler() { |
4833 #ifdef ENABLE_LOGGING_AND_PROFILING | 4833 #ifdef ENABLE_LOGGING_AND_PROFILING |
4834 PauseProfilerEx(PROFILER_MODULE_CPU); | 4834 i::Isolate* isolate = i::Isolate::Current(); |
| 4835 isolate->logger()->PauseProfiler(); |
4835 #endif | 4836 #endif |
4836 } | 4837 } |
4837 | 4838 |
4838 | 4839 |
4839 void V8::ResumeProfiler() { | 4840 void V8::ResumeProfiler() { |
4840 #ifdef ENABLE_LOGGING_AND_PROFILING | 4841 #ifdef ENABLE_LOGGING_AND_PROFILING |
4841 ResumeProfilerEx(PROFILER_MODULE_CPU); | 4842 i::Isolate* isolate = i::Isolate::Current(); |
| 4843 isolate->logger()->ResumeProfiler(); |
4842 #endif | 4844 #endif |
4843 } | 4845 } |
4844 | 4846 |
4845 | 4847 |
4846 bool V8::IsProfilerPaused() { | 4848 bool V8::IsProfilerPaused() { |
4847 #ifdef ENABLE_LOGGING_AND_PROFILING | 4849 #ifdef ENABLE_LOGGING_AND_PROFILING |
4848 return LOGGER->GetActiveProfilerModules() & PROFILER_MODULE_CPU; | 4850 i::Isolate* isolate = i::Isolate::Current(); |
| 4851 return isolate->logger()->IsProfilerPaused(); |
4849 #else | 4852 #else |
4850 return true; | 4853 return true; |
4851 #endif | 4854 #endif |
4852 } | 4855 } |
4853 | 4856 |
4854 | |
4855 void V8::ResumeProfilerEx(int flags, int tag) { | |
4856 #ifdef ENABLE_LOGGING_AND_PROFILING | |
4857 i::Isolate* isolate = i::Isolate::Current(); | |
4858 isolate->logger()->ResumeProfiler(flags, tag); | |
4859 #endif | |
4860 } | |
4861 | |
4862 | |
4863 void V8::PauseProfilerEx(int flags, int tag) { | |
4864 #ifdef ENABLE_LOGGING_AND_PROFILING | |
4865 LOGGER->PauseProfiler(flags, tag); | |
4866 #endif | |
4867 } | |
4868 | |
4869 | |
4870 int V8::GetActiveProfilerModules() { | |
4871 #ifdef ENABLE_LOGGING_AND_PROFILING | |
4872 return LOGGER->GetActiveProfilerModules(); | |
4873 #else | |
4874 return PROFILER_MODULE_NONE; | |
4875 #endif | |
4876 } | |
4877 | |
4878 | 4857 |
4879 int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) { | 4858 int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) { |
4880 #ifdef ENABLE_LOGGING_AND_PROFILING | 4859 #ifdef ENABLE_LOGGING_AND_PROFILING |
4881 ASSERT(max_size >= kMinimumSizeForLogLinesBuffer); | 4860 ASSERT(max_size >= kMinimumSizeForLogLinesBuffer); |
4882 return LOGGER->GetLogLines(from_pos, dest_buf, max_size); | 4861 return LOGGER->GetLogLines(from_pos, dest_buf, max_size); |
4883 #endif | 4862 #endif |
4884 return 0; | 4863 return 0; |
4885 } | 4864 } |
4886 | 4865 |
4887 | 4866 |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6117 | 6096 |
6118 | 6097 |
6119 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6098 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
6120 HandleScopeImplementer* scope_implementer = | 6099 HandleScopeImplementer* scope_implementer = |
6121 reinterpret_cast<HandleScopeImplementer*>(storage); | 6100 reinterpret_cast<HandleScopeImplementer*>(storage); |
6122 scope_implementer->IterateThis(v); | 6101 scope_implementer->IterateThis(v); |
6123 return storage + ArchiveSpacePerThread(); | 6102 return storage + ArchiveSpacePerThread(); |
6124 } | 6103 } |
6125 | 6104 |
6126 } } // namespace v8::internal | 6105 } } // namespace v8::internal |
OLD | NEW |