OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "ScriptProfiler.h" | 32 #include "ScriptProfiler.h" |
33 | 33 |
34 #include "BindingVisitors.h" | 34 #include "BindingVisitors.h" |
35 #include "RetainedDOMInfo.h" | 35 #include "RetainedDOMInfo.h" |
36 #include "ScriptObject.h" | 36 #include "ScriptObject.h" |
37 #include "V8ArrayBufferView.h" | 37 #include "V8ArrayBufferView.h" |
38 #include "V8Binding.h" | 38 #include "V8Binding.h" |
39 #include "V8DOMWindow.h" | 39 #include "V8DOMWindow.h" |
40 #include "V8DOMWrapper.h" | 40 #include "V8DOMWrapper.h" |
41 #include "V8Node.h" | 41 #include "V8Node.h" |
42 #include "WebCoreMemoryInstrumentation.h" | |
43 #include "WrapperTypeInfo.h" | 42 #include "WrapperTypeInfo.h" |
44 | 43 |
45 #include <v8-profiler.h> | 44 #include <v8-profiler.h> |
46 | 45 |
47 #include <wtf/ThreadSpecific.h> | 46 #include <wtf/ThreadSpecific.h> |
48 | 47 |
49 namespace WebCore { | 48 namespace WebCore { |
50 | 49 |
51 typedef HashMap<String, double> ProfileNameIdleTimeMap; | 50 typedef HashMap<String, double> ProfileNameIdleTimeMap; |
52 | 51 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 m_visitor->visitJSExternalArray(V8ArrayBufferView::toNative(wrapper)
); | 289 m_visitor->visitJSExternalArray(V8ArrayBufferView::toNative(wrapper)
); |
291 } | 290 } |
292 | 291 |
293 private: | 292 private: |
294 ExternalArrayVisitor* m_visitor; | 293 ExternalArrayVisitor* m_visitor; |
295 } wrapperVisitor(visitor); | 294 } wrapperVisitor(visitor); |
296 | 295 |
297 v8::V8::VisitHandlesWithClassIds(&wrapperVisitor); | 296 v8::V8::VisitHandlesWithClassIds(&wrapperVisitor); |
298 } | 297 } |
299 | 298 |
300 void ScriptProfiler::collectBindingMemoryInfo(MemoryInstrumentation* instrumenta
tion) | |
301 { | |
302 V8PerIsolateData* data = V8PerIsolateData::current(); | |
303 instrumentation->addRootObject(data); | |
304 } | |
305 | |
306 size_t ScriptProfiler::profilerSnapshotsSize() | 299 size_t ScriptProfiler::profilerSnapshotsSize() |
307 { | 300 { |
308 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 301 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
309 v8::HeapProfiler* profiler = isolate->GetHeapProfiler(); | 302 v8::HeapProfiler* profiler = isolate->GetHeapProfiler(); |
310 if (!profiler) | 303 if (!profiler) |
311 return 0; | 304 return 0; |
312 return profiler->GetProfilerMemorySize(); | 305 return profiler->GetProfilerMemorySize(); |
313 } | 306 } |
314 | 307 |
315 ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap() | 308 ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap() |
316 { | 309 { |
317 AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, ma
p = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>); | 310 AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, ma
p = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>); |
318 return *map; | 311 return *map; |
319 } | 312 } |
320 | 313 |
321 } // namespace WebCore | 314 } // namespace WebCore |
322 | 315 |
OLD | NEW |