|
33 | 33 |
|
34 | 34 | class MM_CompactSchemeFixupRoots : public MM_RootScanner { |
35 | 35 | private: |
36 | | - MM_CompactScheme* _compactScheme; |
| 36 | +#if defined(J9VM_GC_MODRON_SCAVENGER) |
| 37 | + MM_CompactSchemeFixupObject _fixupObject; |
| 38 | + bool _nurseryOnly; /**< if true, Nursery is only compacted and Tenure fixed-up via RS, otherwise whole heap is compacted/fixed-up */ |
| 39 | +#endif /* defined(J9VM_GC_MODRON_SCAVENGER) */ |
| 40 | + |
| 41 | + MM_CompactScheme *_compactScheme; |
37 | 42 |
|
38 | 43 | public: |
39 | | - MM_CompactSchemeFixupRoots(MM_EnvironmentBase *env, MM_CompactScheme* compactScheme) : |
| 44 | + MM_CompactSchemeFixupRoots(MM_EnvironmentBase *env, MM_CompactScheme *compactScheme, bool nurseryOnly = false) : |
40 | 45 | MM_RootScanner(env), |
| 46 | +#if defined(J9VM_GC_MODRON_SCAVENGER) |
| 47 | + _fixupObject(env, compactScheme), |
| 48 | + _nurseryOnly(nurseryOnly), |
| 49 | +#endif /* defined(J9VM_GC_MODRON_SCAVENGER) */ |
41 | 50 | _compactScheme(compactScheme) |
42 | 51 | { |
43 | 52 | setIncludeStackFrameClassReferences(false); |
@@ -99,6 +108,25 @@ class MM_CompactSchemeFixupRoots : public MM_RootScanner { |
99 | 108 | reportScanningEnded(RootScannerEntity_ContinuationObjects); |
100 | 109 | } |
101 | 110 |
|
| 111 | +#if defined(J9VM_GC_MODRON_SCAVENGER) |
| 112 | + virtual void doRememberedSetSlot(J9Object **slotPtr, GC_RememberedSetSlotIterator *rememberedSetSlotIterator) |
| 113 | + { |
| 114 | + if (_nurseryOnly) { |
| 115 | + /* Objects in Tenure did not move -> no need to fix up RS slots. |
| 116 | + * Object in Nursery moved -> slots of remembered objects in Nursery need to fix up. |
| 117 | + */ |
| 118 | + _fixupObject.fixupObject(MM_EnvironmentStandard::getEnvironment(_env), *slotPtr); |
| 119 | + } else { |
| 120 | + /* Objects in tenure moved -> need to fix up RS slots. |
| 121 | + * Remembered (Tenured) object slots have been already fixed up by now (as any other object slots). |
| 122 | + */ |
| 123 | + MM_RootScanner::doRememberedSetSlot(slotPtr, rememberedSetSlotIterator); |
| 124 | + } |
| 125 | + } |
| 126 | +#endif /* defined(J9VM_GC_MODRON_SCAVENGER) */ |
| 127 | + |
| 128 | + |
| 129 | + |
102 | 130 | private: |
103 | 131 | #if defined(J9VM_GC_FINALIZATION) |
104 | 132 | void fixupFinalizableObjects(MM_EnvironmentBase *env); |
|
0 commit comments