| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |