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 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 | 2080 |
2081 const char* HeapProfilerExtension::kSource = | 2081 const char* HeapProfilerExtension::kSource = |
2082 "native function findUntrackedObjects();"; | 2082 "native function findUntrackedObjects();"; |
2083 | 2083 |
2084 | 2084 |
2085 v8::Handle<v8::FunctionTemplate> | 2085 v8::Handle<v8::FunctionTemplate> |
2086 HeapProfilerExtension::GetNativeFunctionTemplate(v8::Isolate* isolate, | 2086 HeapProfilerExtension::GetNativeFunctionTemplate(v8::Isolate* isolate, |
2087 v8::Handle<v8::String> name) { | 2087 v8::Handle<v8::String> name) { |
2088 if (name->Equals(v8::String::NewFromUtf8(isolate, "findUntrackedObjects"))) { | 2088 if (name->Equals(v8::String::NewFromUtf8(isolate, "findUntrackedObjects"))) { |
2089 return v8::FunctionTemplate::New( | 2089 return v8::FunctionTemplate::New( |
| 2090 isolate, |
2090 HeapProfilerExtension::FindUntrackedObjects); | 2091 HeapProfilerExtension::FindUntrackedObjects); |
2091 } else { | 2092 } else { |
2092 CHECK(false); | 2093 CHECK(false); |
2093 return v8::Handle<v8::FunctionTemplate>(); | 2094 return v8::Handle<v8::FunctionTemplate>(); |
2094 } | 2095 } |
2095 } | 2096 } |
2096 | 2097 |
2097 | 2098 |
2098 void HeapProfilerExtension::FindUntrackedObjects( | 2099 void HeapProfilerExtension::FindUntrackedObjects( |
2099 const v8::FunctionCallbackInfo<v8::Value>& args) { | 2100 const v8::FunctionCallbackInfo<v8::Value>& args) { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 | 2354 |
2354 AllocationTraceNode* node = | 2355 AllocationTraceNode* node = |
2355 FindNode(tracker, Vector<const char*>(names, ARRAY_SIZE(names))); | 2356 FindNode(tracker, Vector<const char*>(names, ARRAY_SIZE(names))); |
2356 CHECK_NE(NULL, node); | 2357 CHECK_NE(NULL, node); |
2357 CHECK_LT(node->allocation_count(), 100); | 2358 CHECK_LT(node->allocation_count(), 100); |
2358 | 2359 |
2359 CcTest::heap()->DisableInlineAllocation(); | 2360 CcTest::heap()->DisableInlineAllocation(); |
2360 heap_profiler->StopTrackingHeapObjects(); | 2361 heap_profiler->StopTrackingHeapObjects(); |
2361 } | 2362 } |
2362 } | 2363 } |
OLD | NEW |