Changeset 95 in dev
- Timestamp:
- Apr 15, 2007, 1:34:02 AM (18 years ago)
- Files:
-
- 11 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 -
BasicCompiler64/Compile_ProcOp.cpp
r94 r95 205 205 206 206 pobj_DBClass->Compile_System_InitializeUserTypes(); 207 } 208 else if( userProc.GetName() == "RegisterGlobalRoots" 209 && userProc.HasParentClass() 210 && (string)userProc.GetParentClass().name == "_System_CGarbageCollection" ){ 211 212 Compile_AddGlobalRootsForGc(); 207 213 } 208 214 else{ -
BasicCompiler64/Compile_Var.cpp
r89 r95 1314 1314 } 1315 1315 } 1316 1317 bool Compile_AddGlobalRootsForGc(){ 1318 UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" ); 1319 if( !pUserProc_AddGlobalRootPtr ){ 1320 SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 ); 1321 return false; 1322 } 1323 1324 BOOST_FOREACH( const Variable *pVar, globalVars ){ 1325 if( pVar->IsObject() || pVar->IsPointer() || pVar->IsStruct() ){ 1326 // オブジェクトまたはポインタだったとき 1327 // ※構造体も含む(暫定対応) 1328 1329 // 変数領域に要するLONG_PTR単位の個数を引き渡す 1330 //mov r8,count 1331 op_mov_RV(sizeof(_int64), REG_R8,pVar->GetMemorySize()/PTR_SIZE); 1332 1333 // ルートポインタを引き渡す 1334 //mov rdx,offset 1335 op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->offset); 1336 obp-=sizeof(long); 1337 pobj_GlobalVarSchedule->add(); 1338 obp+=sizeof(long); 1339 1340 // Thisポインタを引き渡す 1341 SetThisPtrToReg(REG_RCX); 1342 1343 // call AddGlobalRootPtr 1344 op_call( pUserProc_AddGlobalRootPtr ); 1345 1346 ReallocNativeCodeBuffer(); 1347 } 1348 } 1349 1350 return true; 1351 } -
BasicCompiler64/MakePeHdr.cpp
r91 r95 6 6 // 特殊関数の構造体ポインタ 7 7 //////////////////////////// 8 9 // グローバル関数、静的メソッド 8 10 UserProc 9 11 *pSub_System_StartupProgram, … … 24 26 *pSub_System_GC_free_for_SweepingDelete, 25 27 *pSubStaticMethod_System_TypeBase_InitializeUserTypes; 28 29 // 動的メソッド 30 UserProc 31 *pUserProc_System_CGarbageCollection_RegisterGlobalRoots; 26 32 27 33 … … 231 237 pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using(); 232 238 pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsAutoGenerationProc(); 239 } 240 241 if( pUserProc_System_CGarbageCollection_RegisterGlobalRoots = GetClassMethod( "_System_CGarbageCollection", "RegisterGlobalRoots" ) ){ 242 pUserProc_System_CGarbageCollection_RegisterGlobalRoots->Using(); 243 pUserProc_System_CGarbageCollection_RegisterGlobalRoots->ThisIsAutoGenerationProc(); 233 244 } 234 245 -
BasicCompiler64/Opcode.h
r79 r95 325 325 void dim( char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags); 326 326 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar); 327 bool Compile_AddGlobalRootsForGc(); 327 328 328 329 //ParamImpl.cpp -
BasicCompiler_Common/common.h
r94 r95 296 296 CONSTINFO *GetConstHash(char *name); 297 297 DllProc *GetDeclareHash(char *name); 298 void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs ); 298 299 UserProc *GetSubHash(const char *name,BOOL bError=0); 299 300 UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError=0); 300 void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs);301 UserProc *GetClassMethod( const char *className, const char *methodName ); 301 302 302 303 //Object.cpp -
BasicCompiler_Common/hash.cpp
r75 r95 184 184 return pUserProc; 185 185 } 186 187 UserProc *GetClassMethod( const char *className, const char *methodName ){ 188 CClass *pClass = pobj_DBClass->check( className ); 189 if( pClass ){ 190 vector<UserProc *> userProcs; 191 pClass->EnumMethod( methodName, userProcs ); 192 if( userProcs.size() == 1 ){ 193 return userProcs[0]; 194 } 195 } 196 197 char temporary[VN_SIZE]; 198 sprintf( temporary, "%s.%s", className, methodName ); 199 SetError(3, temporary, -1 ); 200 201 return NULL; 202 } -
BasicCompiler_Common/include/Smoothie.h
r92 r95 14 14 log = ""; 15 15 16 ofstream ofs( ( (string)BasicSystemDir + " compile.log" ).c_str(), ios_base::trunc );16 ofstream ofs( ( (string)BasicSystemDir + "Log\\compile.log" ).c_str(), ios_base::trunc ); 17 17 ofs.close(); 18 18 #endif … … 23 23 24 24 { 25 ofstream ofs( ( (string)BasicSystemDir + " compile.log" ).c_str(), ios_base::app );25 ofstream ofs( ( (string)BasicSystemDir + "Log\\compile.log" ).c_str(), ios_base::app ); 26 26 ofs << text << endl; 27 27 ofs.close(); … … 30 30 } 31 31 static void PutFile( const string &fileName, const string &buffer ){ 32 ofstream ofs( ( (string)BasicSystemDir + fileName ).c_str() );32 ofstream ofs( ( (string)BasicSystemDir + "Log\\" + fileName ).c_str() ); 33 33 ofs << buffer << endl; 34 34 ofs.close();
Note:
See TracChangeset
for help on using the changeset viewer.