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

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

Issue 1143243006: Revert of 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') | 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 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;
390 #if defined(ADDRESS_SANITIZER) 389 #if defined(ADDRESS_SANITIZER)
391 virtual void poisonUnmarkedObjects() = 0; 390 virtual void poisonUnmarkedObjects() = 0;
392 #endif 391 #endif
393 // Check if the given address points to an object in this 392 // Check if the given address points to an object in this
394 // heap page. If so, find the start of that object and mark it 393 // heap page. If so, find the start of that object and mark it
395 // using the given Visitor. Otherwise do nothing. The pointer must 394 // using the given Visitor. Otherwise do nothing. The pointer must
396 // be within the same aligned blinkPageSize as the this-pointer. 395 // be within the same aligned blinkPageSize as the this-pointer.
397 // 396 //
398 // This is used during conservative stack scanning to 397 // This is used during conservative stack scanning to
399 // conservatively mark all objects that could be referenced from 398 // conservatively mark all objects that could be referenced from
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 bool containedInObjectPayload(Address address) 466 bool containedInObjectPayload(Address address)
468 { 467 {
469 return payload() <= address && address < payloadEnd(); 468 return payload() <= address && address < payloadEnd();
470 } 469 }
471 470
472 virtual size_t objectPayloadSizeForTesting() override; 471 virtual size_t objectPayloadSizeForTesting() override;
473 virtual bool isEmpty() override; 472 virtual bool isEmpty() override;
474 virtual void removeFromHeap() override; 473 virtual void removeFromHeap() override;
475 virtual void sweep() override; 474 virtual void sweep() override;
476 virtual void makeConsistentForGC() override; 475 virtual void makeConsistentForGC() override;
477 virtual void makeConsistentForMutator() override;
478 #if defined(ADDRESS_SANITIZER) 476 #if defined(ADDRESS_SANITIZER)
479 virtual void poisonUnmarkedObjects() override; 477 virtual void poisonUnmarkedObjects() override;
480 #endif 478 #endif
481 virtual void checkAndMarkPointer(Visitor*, Address) override; 479 virtual void checkAndMarkPointer(Visitor*, Address) override;
482 virtual void markOrphaned() override; 480 virtual void markOrphaned() override;
483 #if ENABLE(GC_PROFILING) 481 #if ENABLE(GC_PROFILING)
484 const GCInfo* findGCInfo(Address) override; 482 const GCInfo* findGCInfo(Address) override;
485 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; 483 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override;
486 void incrementMarkedObjectsAge() override; 484 void incrementMarkedObjectsAge() override;
487 void countMarkedObjects(ClassAgeCountsMap&) override; 485 void countMarkedObjects(ClassAgeCountsMap&) override;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 bool containedInObjectPayload(Address address) 528 bool containedInObjectPayload(Address address)
531 { 529 {
532 return payload() <= address && address < payloadEnd(); 530 return payload() <= address && address < payloadEnd();
533 } 531 }
534 532
535 virtual size_t objectPayloadSizeForTesting() override; 533 virtual size_t objectPayloadSizeForTesting() override;
536 virtual bool isEmpty() override; 534 virtual bool isEmpty() override;
537 virtual void removeFromHeap() override; 535 virtual void removeFromHeap() override;
538 virtual void sweep() override; 536 virtual void sweep() override;
539 virtual void makeConsistentForGC() override; 537 virtual void makeConsistentForGC() override;
540 virtual void makeConsistentForMutator() override;
541 #if defined(ADDRESS_SANITIZER) 538 #if defined(ADDRESS_SANITIZER)
542 virtual void poisonUnmarkedObjects() override; 539 virtual void poisonUnmarkedObjects() override;
543 #endif 540 #endif
544 virtual void checkAndMarkPointer(Visitor*, Address) override; 541 virtual void checkAndMarkPointer(Visitor*, Address) override;
545 virtual void markOrphaned() override; 542 virtual void markOrphaned() override;
546 543
547 #if ENABLE(GC_PROFILING) 544 #if ENABLE(GC_PROFILING)
548 const GCInfo* findGCInfo(Address) override; 545 const GCInfo* findGCInfo(Address) override;
549 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; 546 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override;
550 void incrementMarkedObjectsAge() override; 547 void incrementMarkedObjectsAge() override;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 void snapshot(TracedValue*, ThreadState::SnapshotInfo*); 686 void snapshot(TracedValue*, ThreadState::SnapshotInfo*);
690 virtual void snapshotFreeList(TracedValue&) { }; 687 virtual void snapshotFreeList(TracedValue&) { };
691 688
692 void countMarkedObjects(ClassAgeCountsMap&) const; 689 void countMarkedObjects(ClassAgeCountsMap&) const;
693 void countObjectsToSweep(ClassAgeCountsMap&) const; 690 void countObjectsToSweep(ClassAgeCountsMap&) const;
694 void incrementMarkedObjectsAge(); 691 void incrementMarkedObjectsAge();
695 #endif 692 #endif
696 693
697 virtual void clearFreeLists() { } 694 virtual void clearFreeLists() { }
698 void makeConsistentForGC(); 695 void makeConsistentForGC();
699 void makeConsistentForMutator();
700 #if ENABLE(ASSERT) 696 #if ENABLE(ASSERT)
701 virtual bool isConsistentForGC() = 0; 697 virtual bool isConsistentForGC() = 0;
702 #endif 698 #endif
703 size_t objectPayloadSizeForTesting(); 699 size_t objectPayloadSizeForTesting();
704 void prepareHeapForTermination(); 700 void prepareHeapForTermination();
705 void prepareForSweep(); 701 void prepareForSweep();
706 #if defined(ADDRESS_SANITIZER) 702 #if defined(ADDRESS_SANITIZER)
707 void poisonUnmarkedObjects(); 703 void poisonUnmarkedObjects();
708 #endif 704 #endif
709 Address lazySweep(size_t, size_t gcInfoIndex); 705 Address lazySweep(size_t, size_t gcInfoIndex);
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 size_t copySize = previousHeader->payloadSize(); 1296 size_t copySize = previousHeader->payloadSize();
1301 if (copySize > size) 1297 if (copySize > size)
1302 copySize = size; 1298 copySize = size;
1303 memcpy(address, previous, copySize); 1299 memcpy(address, previous, copySize);
1304 return address; 1300 return address;
1305 } 1301 }
1306 1302
1307 } // namespace blink 1303 } // namespace blink
1308 1304
1309 #endif // Heap_h 1305 #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