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

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

Issue 1159003003: 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, 7 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 bool hasBeenSwept() const { return m_swept; } 423 bool hasBeenSwept() const { return m_swept; }
424 424
425 void markAsSwept() 425 void markAsSwept()
426 { 426 {
427 ASSERT(!m_swept); 427 ASSERT(!m_swept);
428 m_swept = true; 428 m_swept = true;
429 } 429 }
430 430
431 void markAsUnswept() 431 void markAsUnswept()
432 { 432 {
433 ASSERT(m_swept);
433 m_swept = false; 434 m_swept = false;
434 } 435 }
435 436
436 private: 437 private:
437 PageMemory* m_storage; 438 PageMemory* m_storage;
438 BaseHeap* m_heap; 439 BaseHeap* m_heap;
439 BasePage* m_next; 440 BasePage* m_next;
440 // Whether the page is part of a terminating thread or not. 441 // Whether the page is part of a terminating thread or not.
441 bool m_terminating; 442 bool m_terminating;
442 443
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 #if ENABLE(GC_PROFILING) 685 #if ENABLE(GC_PROFILING)
685 void snapshot(TracedValue*, ThreadState::SnapshotInfo*); 686 void snapshot(TracedValue*, ThreadState::SnapshotInfo*);
686 virtual void snapshotFreeList(TracedValue&) { }; 687 virtual void snapshotFreeList(TracedValue&) { };
687 688
688 void countMarkedObjects(ClassAgeCountsMap&) const; 689 void countMarkedObjects(ClassAgeCountsMap&) const;
689 void countObjectsToSweep(ClassAgeCountsMap&) const; 690 void countObjectsToSweep(ClassAgeCountsMap&) const;
690 void incrementMarkedObjectsAge(); 691 void incrementMarkedObjectsAge();
691 #endif 692 #endif
692 693
693 virtual void clearFreeLists() { } 694 virtual void clearFreeLists() { }
694 void makeConsistentForSweeping(ThreadState::GCType); 695 void makeConsistentForSweeping();
695 #if ENABLE(ASSERT) 696 #if ENABLE(ASSERT)
696 virtual bool isConsistentForSweeping() = 0; 697 virtual bool isConsistentForSweeping() = 0;
697 #endif 698 #endif
698 size_t objectPayloadSizeForTesting(); 699 size_t objectPayloadSizeForTesting();
699 void prepareHeapForTermination(); 700 void prepareHeapForTermination();
700 void prepareForSweep(); 701 void prepareForSweep();
701 #if defined(ADDRESS_SANITIZER) 702 #if defined(ADDRESS_SANITIZER)
702 void poisonUnmarkedObjects(); 703 void poisonUnmarkedObjects();
703 #endif 704 #endif
704 Address lazySweep(size_t, size_t gcInfoIndex); 705 Address lazySweep(size_t, size_t gcInfoIndex);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 static const char* gcReasonString(GCReason); 917 static const char* gcReasonString(GCReason);
917 static void collectGarbage(ThreadState::StackState, ThreadState::GCType, GCR eason); 918 static void collectGarbage(ThreadState::StackState, ThreadState::GCType, GCR eason);
918 static void collectGarbageForTerminatingThread(ThreadState*); 919 static void collectGarbageForTerminatingThread(ThreadState*);
919 static void collectAllGarbage(); 920 static void collectAllGarbage();
920 921
921 static void processMarkingStack(Visitor*); 922 static void processMarkingStack(Visitor*);
922 static void postMarkingProcessing(Visitor*); 923 static void postMarkingProcessing(Visitor*);
923 static void globalWeakProcessing(Visitor*); 924 static void globalWeakProcessing(Visitor*);
924 static void setForcePreciseGCForTesting(); 925 static void setForcePreciseGCForTesting();
925 926
926 static void preGC(ThreadState::GCType); 927 static void preGC();
927 static void postGC(ThreadState::GCType); 928 static void postGC(ThreadState::GCType);
928 929
929 // Conservatively checks whether an address is a pointer in any of the 930 // Conservatively checks whether an address is a pointer in any of the
930 // thread heaps. If so marks the object pointed to as live. 931 // thread heaps. If so marks the object pointed to as live.
931 static Address checkAndMarkPointer(Visitor*, Address); 932 static Address checkAndMarkPointer(Visitor*, Address);
932 933
933 #if ENABLE(GC_PROFILING) 934 #if ENABLE(GC_PROFILING)
934 // Dump the path to specified object on the next GC. This method is to be 935 // Dump the path to specified object on the next GC. This method is to be
935 // invoked from GDB. 936 // invoked from GDB.
936 static void dumpPathToObjectOnNextGC(void* p); 937 static void dumpPathToObjectOnNextGC(void* p);
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 size_t copySize = previousHeader->payloadSize(); 1296 size_t copySize = previousHeader->payloadSize();
1296 if (copySize > size) 1297 if (copySize > size)
1297 copySize = size; 1298 copySize = size;
1298 memcpy(address, previous, copySize); 1299 memcpy(address, previous, copySize);
1299 return address; 1300 return address;
1300 } 1301 }
1301 1302
1302 } // namespace blink 1303 } // namespace blink
1303 1304
1304 #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