Changeset 223 in dev for trunk/abdev/BasicCompiler_Common/gc.cpp
- Timestamp:
- Jul 19, 2007, 3:38:13 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/gc.cpp
r206 r223 9 9 #endif 10 10 11 int Schedule_GlobalRoot_StartPtr;12 int Schedule_GlobalRoot_Size;13 14 11 void InitGCVariables(void){ 15 12 char temporary[255]; 16 17 18 ///////////////////////////////19 // グローバル変数の開始位置20 ///////////////////////////////21 22 sprintf(temporary,"_System_gc_GlobalRoot_StartPtr%c%cVoidPtr",1,ESC_AS);23 OpcodeDim(temporary,0);24 25 13 Type type; 26 14 RELATIVE_VAR RelativeVar; 27 GetVarOffsetReadWrite("_System_gc_GlobalRoot_StartPtr",&RelativeVar,type);28 29 //mov rax,ptr30 op_mov_RV(PTR_SIZE,REG_RAX,0);31 Schedule_GlobalRoot_StartPtr=obp-sizeof(long);32 33 //mov ptr[offset],rax/eax34 op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32);35 obp-=sizeof(long);36 pobj_GlobalVarSchedule->add();37 obp+=sizeof(long);38 39 40 ///////////////////////////////41 // グローバル変数の大きさ42 ///////////////////////////////43 44 sprintf(temporary,"_System_gc_GlobalRoot_Size%c%cLong",1,ESC_AS);45 OpcodeDim(temporary,0);46 47 GetVarOffsetReadWrite("_System_gc_GlobalRoot_Size",&RelativeVar,type);48 49 //mov rax,ptr50 op_mov_RV(PTR_SIZE,REG_RAX,0);51 Schedule_GlobalRoot_Size=obp-sizeof(long);52 53 //mov ptr[offset],rax/eax54 op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32);55 obp-=sizeof(long);56 pobj_GlobalVarSchedule->add();57 obp+=sizeof(long);58 59 15 60 16 … … 78 34 79 35 } 80 81 void PerformedGcVarSchedule(void){82 //グローバル変数領域の開始位置83 extern DWORD ImageBase;84 extern int MemPos_RWSection;85 *((long *)(OpBuffer+Schedule_GlobalRoot_StartPtr))=ImageBase+MemPos_RWSection;86 pobj_Reloc->AddSchedule_CodeSection(Schedule_GlobalRoot_StartPtr);87 88 //グローバル変数領域のサイズ89 extern int AllInitGlobalVarSize;90 extern int AllGlobalVarSize;91 *((long *)(OpBuffer+Schedule_GlobalRoot_Size))=AllInitGlobalVarSize+AllGlobalVarSize;92 }
Note:
See TracChangeset
for help on using the changeset viewer.