2
0
Эх сурвалжийг харах

Only call EnterInCardSet when generational GC is enabled (needs improvement for 64-bit address spaces)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7749 8c9fc860-2736-0410-a75d-ab315db34111
eth.negelef 7 жил өмнө
parent
commit
4dd95e2fd8
1 өөрчлөгдсөн 12 нэмэгдсэн , 4 устгасан
  1. 12 4
      source/Heaps.Mod

+ 12 - 4
source/Heaps.Mod

@@ -1397,7 +1397,9 @@ BEGIN
 			
 			SetPC(dataBlock);
 			p := dataBlock; 
-			EnterInCardSet(ADDRESS OF p);
+			IF (currentGeneration = Young) OR (youngCounts > 0) THEN
+				EnterInCardSet(ADDRESS OF p);
+			END;
 
 			(* clear must be done inside lock to ensure all traced pointer fields are initialized to NIL *)
 			Machine.Fill32(dataBlockAdr, blockSize - SIZEOF(RecordBlockDesc) - 2 * BlockHeaderSize, 0);	(* clear everything from dataBlockAdr until end of block *)
@@ -1457,7 +1459,9 @@ BEGIN
 		
 		SetPC(dataBlock);
 		p := dataBlock; 
-		EnterInCardSet(ADDRESS OF p);
+		IF (currentGeneration = Young) OR (youngCounts > 0) THEN
+			EnterInCardSet(ADDRESS OF p);
+		END;
 
 		(* clear must be done inside lock to ensure all traced pointer fields are initialized to NIL *)
 		Machine.Fill32(dataBlockAdr, blockSize - SIZEOF(ProtRecBlockDesc) - 2 * BlockHeaderSize, 0);	(* clear everything from dataBlockAdr to end of block *)
@@ -1533,7 +1537,9 @@ BEGIN
 
 				SetPC(dataBlock); 
 				p := dataBlock; 
-				EnterInCardSet(ADDRESS OF p);
+				IF (currentGeneration = Young) OR (youngCounts > 0) THEN
+					EnterInCardSet(ADDRESS OF p);
+				END;
 			ELSE
 				p := NIL
 			END;
@@ -1582,7 +1588,9 @@ VAR p: ANY; dim: SIZE;
 		SetSizes(p);
 		SetPC(p);
 		dest := p;
-		EnterInCardSet(ADDRESS OF dest);
+		IF (currentGeneration = Young) OR (youngCounts > 0) THEN
+			EnterInCardSet(ADDRESS OF dest);
+		END;
 END NewArray;