Преглед изворни кода

patched offsets (additional refcount field in HeapBlock)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8007 8c9fc860-2736-0410-a75d-ab315db34111
felixf пре 7 година
родитељ
комит
37c5f098c1
2 измењених фајлова са 7 додато и 3 уклоњено
  1. 6 2
      source/FoxIntermediateBackend.Mod
  2. 1 1
      source/Loader.Mod

+ 6 - 2
source/FoxIntermediateBackend.Mod

@@ -11569,7 +11569,11 @@ TYPE
 				MethodTableOffset := -TypeTags+BaseTypesTableOffset;
 				TypeRecordBaseOffset := TypeTags + 2; (* MPO, typeInfo *)
 				(* change this when Heaps.HeapBlock is modified *)
-				RecordBaseOffset := 8; 		
+				IF implementationVisitor.system.addressType.sizeInBits = 64 THEN
+					RecordBaseOffset := 8; (* addresses *)		
+				ELSE
+					RecordBaseOffset := 9; (* addresses *)
+				END;
 			END;
 			SELF.simple := simple;
 			SELF.implementationVisitor := implementationVisitor;
@@ -12981,7 +12985,7 @@ TYPE
 					offset := ToMemoryUnits(module.system, 18* module.system.addressSize) (* Module pointer offset -- cf. ModuleSection(), how to encode generically correct? *);
 				ELSE
 					(* change this when Heaps.HeapBlock is modified *)
-					offset := ToMemoryUnits(module.system, 22* module.system.addressSize) (* Module pointer offset -- cf. ModuleSection(), how to encode generically correct? *);
+					offset := ToMemoryUnits(module.system, 23* module.system.addressSize) (* Module pointer offset -- cf. ModuleSection(), how to encode generically correct? *);
 				END;
 			END;
 			import :=  module.module.moduleScope.firstImport;

+ 1 - 1
source/Loader.Mod

@@ -555,7 +555,7 @@ VAR
 
 				moduleAdr := linker.moduleBlock.address;
 				IF ~Machine.IsCooperative THEN
-					SYSTEM.GET(moduleAdr+3*SIZEOF(ADDRESS), moduleAdr);
+					SYSTEM.GET(moduleAdr+2*SIZEOF(ADDRESS)+2*SIZEOF(WORD), moduleAdr);
 					SYSTEM.GET(moduleAdr-2*SIZEOF(ADDRESS), heapBlockAdr);
 					ASSERT(heapBlockAdr = linker.moduleBlock.address+2*SIZEOF(ADDRESS));
 				END;