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

Side by Side Diff: Source/platform/heap/Heap.h

Issue 1149703002: Adding heap-page statistics to blink-gc memory dump provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@oilpan_v1
Patch Set: Rebase and change %zu to %lu. Created 5 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
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 #else 88 #else
89 #define FILL_ZERO_IF_PRODUCTION(address, size) memset((address), 0, (size)) 89 #define FILL_ZERO_IF_PRODUCTION(address, size) memset((address), 0, (size))
90 #define FILL_ZERO_IF_NOT_PRODUCTION(address, size) do { } while (false) 90 #define FILL_ZERO_IF_NOT_PRODUCTION(address, size) do { } while (false)
91 #endif 91 #endif
92 92
93 class CallbackStack; 93 class CallbackStack;
94 class FreePagePool; 94 class FreePagePool;
95 class NormalPageHeap; 95 class NormalPageHeap;
96 class OrphanedPagePool; 96 class OrphanedPagePool;
97 class PageMemory; 97 class PageMemory;
98 class WebProcessMemoryDump;
98 99
99 #if ENABLE(GC_PROFILING) 100 #if ENABLE(GC_PROFILING)
100 class TracedValue; 101 class TracedValue;
101 #endif 102 #endif
102 103
103 // HeapObjectHeader is 4 byte (32 bit) that has the following layout: 104 // HeapObjectHeader is 4 byte (32 bit) that has the following layout:
104 // 105 //
105 // | gcInfoIndex (14 bit) | DOM mark bit (1 bit) | size (14 bit) | dead bit (1 b it) | freed bit (1 bit) | mark bit (1 bit) | 106 // | gcInfoIndex (14 bit) | DOM mark bit (1 bit) | size (14 bit) | dead bit (1 b it) | freed bit (1 bit) | mark bit (1 bit) |
106 // 107 //
107 // - For non-large objects, 14 bit is enough for |size| because the blink 108 // - For non-large objects, 14 bit is enough for |size| because the blink
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // Check if the given address points to an object in this 395 // Check if the given address points to an object in this
395 // heap page. If so, find the start of that object and mark it 396 // heap page. If so, find the start of that object and mark it
396 // using the given Visitor. Otherwise do nothing. The pointer must 397 // using the given Visitor. Otherwise do nothing. The pointer must
397 // be within the same aligned blinkPageSize as the this-pointer. 398 // be within the same aligned blinkPageSize as the this-pointer.
398 // 399 //
399 // This is used during conservative stack scanning to 400 // This is used during conservative stack scanning to
400 // conservatively mark all objects that could be referenced from 401 // conservatively mark all objects that could be referenced from
401 // the stack. 402 // the stack.
402 virtual void checkAndMarkPointer(Visitor*, Address) = 0; 403 virtual void checkAndMarkPointer(Visitor*, Address) = 0;
403 virtual void markOrphaned(); 404 virtual void markOrphaned();
405
406 virtual void takeSnapshot(String dumpBaseName, size_t pageIndex) = 0;
404 #if ENABLE(GC_PROFILING) 407 #if ENABLE(GC_PROFILING)
405 virtual const GCInfo* findGCInfo(Address) = 0; 408 virtual const GCInfo* findGCInfo(Address) = 0;
406 virtual void snapshot(TracedValue*, ThreadState::SnapshotInfo*) = 0; 409 virtual void snapshot(TracedValue*, ThreadState::SnapshotInfo*) = 0;
407 virtual void incrementMarkedObjectsAge() = 0; 410 virtual void incrementMarkedObjectsAge() = 0;
408 virtual void countMarkedObjects(ClassAgeCountsMap&) = 0; 411 virtual void countMarkedObjects(ClassAgeCountsMap&) = 0;
409 virtual void countObjectsToSweep(ClassAgeCountsMap&) = 0; 412 virtual void countObjectsToSweep(ClassAgeCountsMap&) = 0;
410 #endif 413 #endif
411 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING) 414 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING)
412 virtual bool contains(Address) = 0; 415 virtual bool contains(Address) = 0;
413 #endif 416 #endif
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 virtual bool isEmpty() override; 477 virtual bool isEmpty() override;
475 virtual void removeFromHeap() override; 478 virtual void removeFromHeap() override;
476 virtual void sweep() override; 479 virtual void sweep() override;
477 virtual void makeConsistentForGC() override; 480 virtual void makeConsistentForGC() override;
478 virtual void makeConsistentForMutator() override; 481 virtual void makeConsistentForMutator() override;
479 #if defined(ADDRESS_SANITIZER) 482 #if defined(ADDRESS_SANITIZER)
480 virtual void poisonObjects(ObjectsToPoison, Poisoning) override; 483 virtual void poisonObjects(ObjectsToPoison, Poisoning) override;
481 #endif 484 #endif
482 virtual void checkAndMarkPointer(Visitor*, Address) override; 485 virtual void checkAndMarkPointer(Visitor*, Address) override;
483 virtual void markOrphaned() override; 486 virtual void markOrphaned() override;
487
488 void takeSnapshot(String dumpBaseName, size_t pageIndex) override;
484 #if ENABLE(GC_PROFILING) 489 #if ENABLE(GC_PROFILING)
485 const GCInfo* findGCInfo(Address) override; 490 const GCInfo* findGCInfo(Address) override;
486 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; 491 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override;
487 void incrementMarkedObjectsAge() override; 492 void incrementMarkedObjectsAge() override;
488 void countMarkedObjects(ClassAgeCountsMap&) override; 493 void countMarkedObjects(ClassAgeCountsMap&) override;
489 void countObjectsToSweep(ClassAgeCountsMap&) override; 494 void countObjectsToSweep(ClassAgeCountsMap&) override;
490 #endif 495 #endif
491 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING) 496 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING)
492 // Returns true for the whole blinkPageSize page that the page is on, even 497 // Returns true for the whole blinkPageSize page that the page is on, even
493 // for the header, and the unmapped guard page at the start. That ensures 498 // for the header, and the unmapped guard page at the start. That ensures
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 virtual void removeFromHeap() override; 543 virtual void removeFromHeap() override;
539 virtual void sweep() override; 544 virtual void sweep() override;
540 virtual void makeConsistentForGC() override; 545 virtual void makeConsistentForGC() override;
541 virtual void makeConsistentForMutator() override; 546 virtual void makeConsistentForMutator() override;
542 #if defined(ADDRESS_SANITIZER) 547 #if defined(ADDRESS_SANITIZER)
543 virtual void poisonObjects(ObjectsToPoison, Poisoning) override; 548 virtual void poisonObjects(ObjectsToPoison, Poisoning) override;
544 #endif 549 #endif
545 virtual void checkAndMarkPointer(Visitor*, Address) override; 550 virtual void checkAndMarkPointer(Visitor*, Address) override;
546 virtual void markOrphaned() override; 551 virtual void markOrphaned() override;
547 552
553 void takeSnapshot(String dumpBaseName, size_t pageIndex) override;
548 #if ENABLE(GC_PROFILING) 554 #if ENABLE(GC_PROFILING)
549 const GCInfo* findGCInfo(Address) override; 555 const GCInfo* findGCInfo(Address) override;
550 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; 556 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override;
551 void incrementMarkedObjectsAge() override; 557 void incrementMarkedObjectsAge() override;
552 void countMarkedObjects(ClassAgeCountsMap&) override; 558 void countMarkedObjects(ClassAgeCountsMap&) override;
553 void countObjectsToSweep(ClassAgeCountsMap&) override; 559 void countObjectsToSweep(ClassAgeCountsMap&) override;
554 #endif 560 #endif
555 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING) 561 #if ENABLE(ASSERT) || ENABLE(GC_PROFILING)
556 // Returns true for any address that is on one of the pages that this 562 // Returns true for any address that is on one of the pages that this
557 // large object uses. That ensures that we can use a negative result to 563 // large object uses. That ensures that we can use a negative result to
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 size_t copySize = previousHeader->payloadSize(); 1389 size_t copySize = previousHeader->payloadSize();
1384 if (copySize > size) 1390 if (copySize > size)
1385 copySize = size; 1391 copySize = size;
1386 memcpy(address, previous, copySize); 1392 memcpy(address, previous, copySize);
1387 return address; 1393 return address;
1388 } 1394 }
1389 1395
1390 } // namespace blink 1396 } // namespace blink
1391 1397
1392 #endif // Heap_h 1398 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698