| 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 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 | 2037 |
| 2038 const char* HeapProfilerExtension::kSource = | 2038 const char* HeapProfilerExtension::kSource = |
| 2039 "native function findUntrackedObjects();"; | 2039 "native function findUntrackedObjects();"; |
| 2040 | 2040 |
| 2041 | 2041 |
| 2042 v8::Handle<v8::FunctionTemplate> | 2042 v8::Handle<v8::FunctionTemplate> |
| 2043 HeapProfilerExtension::GetNativeFunctionTemplate(v8::Isolate* isolate, | 2043 HeapProfilerExtension::GetNativeFunctionTemplate(v8::Isolate* isolate, |
| 2044 v8::Handle<v8::String> name) { | 2044 v8::Handle<v8::String> name) { |
| 2045 if (name->Equals(v8::String::NewFromUtf8(isolate, "findUntrackedObjects"))) { | 2045 if (name->Equals(v8::String::NewFromUtf8(isolate, "findUntrackedObjects"))) { |
| 2046 return v8::FunctionTemplate::New( | 2046 return v8::FunctionTemplate::New( |
| 2047 isolate, |
| 2047 HeapProfilerExtension::FindUntrackedObjects); | 2048 HeapProfilerExtension::FindUntrackedObjects); |
| 2048 } else { | 2049 } else { |
| 2049 CHECK(false); | 2050 CHECK(false); |
| 2050 return v8::Handle<v8::FunctionTemplate>(); | 2051 return v8::Handle<v8::FunctionTemplate>(); |
| 2051 } | 2052 } |
| 2052 } | 2053 } |
| 2053 | 2054 |
| 2054 | 2055 |
| 2055 void HeapProfilerExtension::FindUntrackedObjects( | 2056 void HeapProfilerExtension::FindUntrackedObjects( |
| 2056 const v8::FunctionCallbackInfo<v8::Value>& args) { | 2057 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 | 2311 |
| 2311 AllocationTraceNode* node = | 2312 AllocationTraceNode* node = |
| 2312 FindNode(tracker, Vector<const char*>(names, ARRAY_SIZE(names))); | 2313 FindNode(tracker, Vector<const char*>(names, ARRAY_SIZE(names))); |
| 2313 CHECK_NE(NULL, node); | 2314 CHECK_NE(NULL, node); |
| 2314 CHECK_LT(node->allocation_count(), 100); | 2315 CHECK_LT(node->allocation_count(), 100); |
| 2315 | 2316 |
| 2316 CcTest::heap()->DisableInlineAllocation(); | 2317 CcTest::heap()->DisableInlineAllocation(); |
| 2317 heap_profiler->StopTrackingHeapObjects(); | 2318 heap_profiler->StopTrackingHeapObjects(); |
| 2318 } | 2319 } |
| 2319 } | 2320 } |
| OLD | NEW |