Changeset 95 in dev for BasicCompiler32
- Timestamp:
- Apr 15, 2007, 1:34:02 AM (18 years ago)
- Location:
- BasicCompiler32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_ProcOp.cpp
r94 r95 214 214 215 215 pobj_DBClass->Compile_System_InitializeUserTypes(); 216 } 217 else if( userProc.GetName() == "RegisterGlobalRoots" 218 && userProc.HasParentClass() 219 && (string)userProc.GetParentClass().name == "_System_CGarbageCollection" ){ 220 221 Compile_AddGlobalRootsForGc(); 216 222 } 217 223 else{ -
BasicCompiler32/Compile_Var.cpp
r89 r95 1318 1318 } 1319 1319 } 1320 1321 bool Compile_AddGlobalRootsForGc(){ 1322 UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" ); 1323 if( !pUserProc_AddGlobalRootPtr ){ 1324 SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 ); 1325 return false; 1326 } 1327 1328 BOOST_FOREACH( const Variable *pVar, globalVars ){ 1329 if( pVar->IsObject() || pVar->IsPointer() || pVar->IsStruct() ){ 1330 // オブジェクトまたはポインタだったとき 1331 // ※構造体も含む(暫定対応) 1332 1333 // 変数領域に要するLONG_PTR単位の個数を引き渡す 1334 op_push_V( pVar->GetMemorySize()/PTR_SIZE ); 1335 1336 1337 ///////////////////////////// 1338 // ルートポインタを引き渡す 1339 1340 //mov eax,offset 1341 op_mov_RV(REG_EAX,(int)pVar->offset); 1342 obp-=sizeof(long); 1343 pobj_GlobalVarSchedule->add(); 1344 obp+=sizeof(long); 1345 1346 //push eax 1347 op_push( REG_EAX ); 1348 1349 // 1350 ///////////////////////////// 1351 1352 1353 ///////////////////////////// 1354 // Thisポインタを引き渡す 1355 1356 SetThisPtrToReg(REG_EAX); 1357 1358 //push eax 1359 op_push( REG_EAX ); 1360 1361 // 1362 ///////////////////////////// 1363 1364 1365 // call AddGlobalRootPtr 1366 op_call( pUserProc_AddGlobalRootPtr ); 1367 1368 ReallocNativeCodeBuffer(); 1369 } 1370 } 1371 1372 return true; 1373 } -
BasicCompiler32/MakePeHdr.cpp
r91 r95 8 8 // 特殊関数の構造体ポインタ 9 9 //////////////////////////// 10 11 // グローバル関数、静的メソッド 10 12 UserProc 11 13 *pSub_System_StartupProgram, … … 38 40 39 41 *pSub_esp_error; 42 43 // 動的メソッド 44 UserProc 45 *pUserProc_System_CGarbageCollection_RegisterGlobalRoots; 40 46 41 47 … … 250 256 pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using(); 251 257 pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsAutoGenerationProc(); 258 } 259 260 if( pUserProc_System_CGarbageCollection_RegisterGlobalRoots = GetClassMethod( "_System_CGarbageCollection", "RegisterGlobalRoots" ) ){ 261 pUserProc_System_CGarbageCollection_RegisterGlobalRoots->Using(); 262 pUserProc_System_CGarbageCollection_RegisterGlobalRoots->ThisIsAutoGenerationProc(); 252 263 } 253 264 -
BasicCompiler32/Opcode.h
r79 r95 192 192 void dim( char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags); 193 193 void SetVarPtrToEax(RELATIVE_VAR *pRelativeVar); 194 bool Compile_AddGlobalRootsForGc(); 194 195 195 196 //ParamImpl.cpp
Note:
See TracChangeset
for help on using the changeset viewer.