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

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

Issue 1159773004: Oilpan: Implement a GC to take a heap snapshot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 BasePage* next() const { return m_next; } 379 BasePage* next() const { return m_next; }
380 380
381 // virtual methods are slow. So performance-sensitive methods 381 // virtual methods are slow. So performance-sensitive methods
382 // should be defined as non-virtual methods on NormalPage and LargeObjectPag e. 382 // should be defined as non-virtual methods on NormalPage and LargeObjectPag e.
383 // The following methods are not performance-sensitive. 383 // The following methods are not performance-sensitive.
384 virtual size_t objectPayloadSizeForTesting() = 0; 384 virtual size_t objectPayloadSizeForTesting() = 0;
385 virtual bool isEmpty() = 0; 385 virtual bool isEmpty() = 0;
386 virtual void removeFromHeap() = 0; 386 virtual void removeFromHeap() = 0;
387 virtual void sweep() = 0; 387 virtual void sweep() = 0;
388 virtual void makeConsistentForGC() = 0; 388 virtual void makeConsistentForGC() = 0;
389 virtual void makeConsistentForMutator() = 0;
389 #if defined(ADDRESS_SANITIZER) 390 #if defined(ADDRESS_SANITIZER)
390 virtual void poisonUnmarkedObjects() = 0; 391 virtual void poisonUnmarkedObjects() = 0;
391 #endif 392 #endif
392 // Check if the given address points to an object in this 393 // Check if the given address points to an object in this
393 // heap page. If so, find the start of that object and mark it 394 // heap page. If so, find the start of that object and mark it
394 // using the given Visitor. Otherwise do nothing. The pointer must 395 // using the given Visitor. Otherwise do nothing. The pointer must
395 // be within the same aligned blinkPageSize as the this-pointer. 396 // be within the same aligned blinkPageSize as the this-pointer.
396 // 397 //
397 // This is used during conservative stack scanning to 398 // This is used during conservative stack scanning to
398 // conservatively mark all objects that could be referenced from 399 // conservatively mark all objects that could be referenced from
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 bool containedInObjectPayload(Address address) 467 bool containedInObjectPayload(Address address)
467 { 468 {
468 return payload() <= address && address < payloadEnd(); 469 return payload() <= address && address < payloadEnd();
469 } 470 }
470 471
471 virtual size_t objectPayloadSizeForTesting() override; 472 virtual size_t objectPayloadSizeForTesting() override;
472 virtual bool isEmpty() override; 473 virtual bool isEmpty() override;
473 virtual void removeFromHeap() override; 474 virtual void removeFromHeap() override;
474 virtual void sweep() override; 475 virtual void sweep() override;
475 virtual void makeConsistentForGC() override; 476 virtual void makeConsistentForGC() override;
477 virtual void makeConsistentForMutator() override;
476 #if defined(ADDRESS_SANITIZER) 478 #if defined(ADDRESS_SANITIZER)
477 virtual void poisonUnmarkedObjects() override; 479 virtual void poisonUnmarkedObjects() override;
478 #endif 480 #endif
479 virtual void checkAndMarkPointer(Visitor*, Address) override; 481 virtual void checkAndMarkPointer(Visitor*, Address) override;
480 virtual void markOrphaned() override; 482 virtual void markOrphaned() override;
481 #if ENABLE(GC_PROFILING) 483 #if ENABLE(GC_PROFILING)
482 const GCInfo* findGCInfo(Address) override; 484 const GCInfo* findGCInfo(Address) override;
483 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; 485 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override;
484 void incrementMarkedObjectsAge() override; 486 void incrementMarkedObjectsAge() override;
485 void countMarkedObjects(ClassAgeCountsMap&) override; 487 void countMarkedObjects(ClassAgeCountsMap&) override;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 bool containedInObjectPayload(Address address) 530 bool containedInObjectPayload(Address address)
529 { 531 {
530 return payload() <= address && address < payloadEnd(); 532 return payload() <= address && address < payloadEnd();
531 } 533 }
532 534
533 virtual size_t objectPayloadSizeForTesting() override; 535 virtual size_t objectPayloadSizeForTesting() override;
534 virtual bool isEmpty() override; 536 virtual bool isEmpty() override;
535 virtual void removeFromHeap() override; 537 virtual void removeFromHeap() override;
536 virtual void sweep() override; 538 virtual void sweep() override;
537 virtual void makeConsistentForGC() override; 539 virtual void makeConsistentForGC() override;
540 virtual void makeConsistentForMutator() override;
538 #if defined(ADDRESS_SANITIZER) 541 #if defined(ADDRESS_SANITIZER)
539 virtual void poisonUnmarkedObjects() override; 542 virtual void poisonUnmarkedObjects() override;
540 #endif 543 #endif
541 virtual void checkAndMarkPointer(Visitor*, Address) override; 544 virtual void checkAndMarkPointer(Visitor*, Address) override;
542 virtual void markOrphaned() override; 545 virtual void markOrphaned() override;
543 546
544 #if ENABLE(GC_PROFILING) 547 #if ENABLE(GC_PROFILING)
545 const GCInfo* findGCInfo(Address) override; 548 const GCInfo* findGCInfo(Address) override;
546 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; 549 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override;
547 void incrementMarkedObjectsAge() override; 550 void incrementMarkedObjectsAge() override;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 void snapshot(TracedValue*, ThreadState::SnapshotInfo*); 689 void snapshot(TracedValue*, ThreadState::SnapshotInfo*);
687 virtual void snapshotFreeList(TracedValue&) { }; 690 virtual void snapshotFreeList(TracedValue&) { };
688 691
689 void countMarkedObjects(ClassAgeCountsMap&) const; 692 void countMarkedObjects(ClassAgeCountsMap&) const;
690 void countObjectsToSweep(ClassAgeCountsMap&) const; 693 void countObjectsToSweep(ClassAgeCountsMap&) const;
691 void incrementMarkedObjectsAge(); 694 void incrementMarkedObjectsAge();
692 #endif 695 #endif
693 696
694 virtual void clearFreeLists() { } 697 virtual void clearFreeLists() { }
695 void makeConsistentForGC(); 698 void makeConsistentForGC();
699 void makeConsistentForMutator();
696 #if ENABLE(ASSERT) 700 #if ENABLE(ASSERT)
697 virtual bool isConsistentForGC() = 0; 701 virtual bool isConsistentForGC() = 0;
698 #endif 702 #endif
699 size_t objectPayloadSizeForTesting(); 703 size_t objectPayloadSizeForTesting();
700 void prepareHeapForTermination(); 704 void prepareHeapForTermination();
701 void prepareForSweep(); 705 void prepareForSweep();
702 #if defined(ADDRESS_SANITIZER) 706 #if defined(ADDRESS_SANITIZER)
703 void poisonUnmarkedObjects(); 707 void poisonUnmarkedObjects();
704 #endif 708 #endif
705 Address lazySweep(size_t, size_t gcInfoIndex); 709 Address lazySweep(size_t, size_t gcInfoIndex);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 size_t copySize = previousHeader->payloadSize(); 1297 size_t copySize = previousHeader->payloadSize();
1294 if (copySize > size) 1298 if (copySize > size)
1295 copySize = size; 1299 copySize = size;
1296 memcpy(address, previous, copySize); 1300 memcpy(address, previous, copySize);
1297 return address; 1301 return address;
1298 } 1302 }
1299 1303
1300 } // namespace blink 1304 } // namespace blink
1301 1305
1302 #endif // Heap_h 1306 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698