Changeset 254 in dev for trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp
- Timestamp:
- Jul 31, 2007, 4:30:31 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp
r242 r254 6 6 #include <Program.h> 7 7 #include <Compiler.h> 8 #include <LexicalScopingImpl.h>9 8 #include <Class.h> 10 9 … … 116 115 UserProc::CompileStartForGlobalArea(); 117 116 118 GetLexicalScopes().CallDestructorsOfScopeEnd();117 compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd(); 119 118 120 119 UserProc::CompileStartForUserProc( pBackUserProc ); … … 308 307 309 308 //プロシージャ抜け出しスケジュール(Exit Sub/Function) 310 extern DWORD *pExitSubSchedule; 311 extern int ExitSubScheduleNum; 312 pExitSubSchedule=(DWORD *)HeapAlloc(hHeap,0,1); 313 ExitSubScheduleNum=0; 309 compiler.codeGenerator.exitSubCodePositions.clear(); 310 compiler.codeGenerator._exitSubCodePositions_ObpOld.clear(); 314 311 315 312 //ラベル用のメモリを確保 … … 320 317 321 318 //Gotoラベルスケジュール 322 extern GOTOLABELSCHEDULE *pGotoLabelSchedule; 323 extern int GotoLabelScheduleNum; 324 pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapAlloc(hHeap,0,1); 325 GotoLabelScheduleNum=0; 319 compiler.codeGenerator.gotoLabelSchedules.clear(); 326 320 327 321 //With情報のメモリを確保 … … 344 338 AllLocalVarSize=0; 345 339 346 //ローカル変数アドレススケジュール347 extern DWORD *pLocalVarAddrSchedule;348 extern int LocalVarAddrScheduleNum;349 pLocalVarAddrSchedule=(DWORD *)HeapAlloc(hHeap,0,1);350 LocalVarAddrScheduleNum=0;351 352 340 //レキシカルスコープ情報を初期化 353 GetLexicalScopes().Init(obp);341 compiler.codeGenerator.lexicalScopes.Init(obp); 354 342 355 343 … … 386 374 387 375 //レキシカルスコープ情報 388 pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );389 pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );376 pVar->SetScopeLevel( compiler.codeGenerator.lexicalScopes.GetNowLevel() ); 377 pVar->SetScopeStartAddress( compiler.codeGenerator.lexicalScopes.GetStartAddress() ); 390 378 pVar->bLiving=TRUE; 391 379 … … 661 649 HeapDefaultFree(pLabelNames); 662 650 663 //Goto未知ラベルスケジュールを解放664 for(i3=0;i3<GotoLabelScheduleNum;i3++){665 if(pGotoLabelSchedule[i3].pName){666 SetError(6,pGotoLabelSchedule[i3].pName,pGotoLabelSchedule[i3].now_cp);667 HeapDefaultFree(pGotoLabelSchedule[i3].pName);668 }669 else{670 sprintf(temporary,"%d",pGotoLabelSchedule[i3].line);671 SetError(6,temporary,pGotoLabelSchedule[i3].now_cp);672 }673 }674 HeapDefaultFree(pGotoLabelSchedule);675 676 651 //With情報のメモリを解放 677 652 for(i3=0;i3<WithInfo.num;i3++){ … … 683 658 684 659 //ローカルオブジェクト(レキシカルスコープレベル=0)の解放処理 685 GetLexicalScopes().CallDestructorsOfScopeEnd();660 compiler.codeGenerator.lexicalScopes.CallDestructorsOfScopeEnd(); 686 661 687 662 //プロシージャ抜け出しスケジュール(Exit Sub/Function) 688 for(i3=0;i3<ExitSubScheduleNum;i3++){ 689 *((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long)); 690 } 691 HeapDefaultFree(pExitSubSchedule); 663 compiler.codeGenerator.ResolveExitSubSchedule(); 692 664 693 665 if(bDebugCompile&&bDebugSupportProc==0){ … … 739 711 740 712 //ローカル変数アドレススケジュール 741 for(i3=0;i3<LocalVarAddrScheduleNum;i3++){ 742 *((long *)(OpBuffer+pLocalVarAddrSchedule[i3])) += AllLocalVarSize + stackFrameSize; 743 } 744 HeapDefaultFree(pLocalVarAddrSchedule); 713 BOOST_FOREACH( const PertialSchedule *pPertialSchedule, compiler.codeGenerator.localVarPertialSchedules ) 714 { 715 compiler.codeGenerator.opfix_offset( pPertialSchedule, AllLocalVarSize ); 716 } 717 compiler.codeGenerator.localVarPertialSchedules.clear(); 745 718 BOOST_FOREACH( Variable *pVar, pUserProc->GetLocalVars() ){ 746 719 //後にデバッグで利用する
Note:
See TracChangeset
for help on using the changeset viewer.