Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Side by Side Diff: Source/bindings/v8/V8GCController.cpp

Issue 337123002: Support counter graphs in Timeline based on trace events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/MemoryCountersGraph.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 // to collect all garbage, you need to wait until the next event loop. 403 // to collect all garbage, you need to wait until the next event loop.
404 // Regarding (2), it would be OK in practice to trigger only one GC per gcEpilogue, because 404 // Regarding (2), it would be OK in practice to trigger only one GC per gcEpilogue, because
405 // GCController.collectAll() forces 7 V8's GC. 405 // GCController.collectAll() forces 7 V8's GC.
406 Heap::collectGarbage(ThreadState::HeapPointersOnStack); 406 Heap::collectGarbage(ThreadState::HeapPointersOnStack);
407 407
408 // Forces a precise GC at the end of the current event loop. 408 // Forces a precise GC at the end of the current event loop.
409 Heap::setForcePreciseGCForTesting(); 409 Heap::setForcePreciseGCForTesting();
410 } 410 }
411 411
412 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "GCEvent", "usedHeapSizeAfter", usedHeapSize(isolate)); 412 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "GCEvent", "usedHeapSizeAfter", usedHeapSize(isolate));
413 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", "", InspectorUpdateCountersEvent::data()); 413 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", "data", InspectorUpdateCountersEvent::data());
414 } 414 }
415 415
416 void V8GCController::minorGCEpilogue(v8::Isolate* isolate) 416 void V8GCController::minorGCEpilogue(v8::Isolate* isolate)
417 { 417 {
418 TRACE_EVENT_END0("v8", "minorGC"); 418 TRACE_EVENT_END0("v8", "minorGC");
419 if (isMainThread()) 419 if (isMainThread())
420 TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(V8PerIsolateData::from(isolate)- >previousSamplingState()); 420 TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(V8PerIsolateData::from(isolate)- >previousSamplingState());
421 } 421 }
422 422
423 void V8GCController::majorGCEpilogue(v8::Isolate* isolate) 423 void V8GCController::majorGCEpilogue(v8::Isolate* isolate)
(...skipping 22 matching lines...) Expand all
446 static size_t lastUsageReportedToV8 = 0; 446 static size_t lastUsageReportedToV8 = 0;
447 447
448 size_t currentUsage = Partitions::currentDOMMemoryUsage(); 448 size_t currentUsage = Partitions::currentDOMMemoryUsage();
449 int64_t diff = static_cast<int64_t>(currentUsage) - static_cast<int64_t>(las tUsageReportedToV8); 449 int64_t diff = static_cast<int64_t>(currentUsage) - static_cast<int64_t>(las tUsageReportedToV8);
450 isolate->AdjustAmountOfExternalAllocatedMemory(diff); 450 isolate->AdjustAmountOfExternalAllocatedMemory(diff);
451 451
452 lastUsageReportedToV8 = currentUsage; 452 lastUsageReportedToV8 = currentUsage;
453 } 453 }
454 454
455 } // namespace WebCore 455 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/MemoryCountersGraph.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698