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