Changeset 73 in dev for BasicCompiler64/Compile_ProcOp.cpp
- Timestamp:
- Mar 16, 2007, 11:07:14 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_ProcOp.cpp
r64 r73 204 204 } 205 205 } 206 void CompileBufferInProcedure(S UBINFO*psi){206 void CompileBufferInProcedure(SubInfo *psi){ 207 207 extern char *basbuf; 208 208 extern HANDLE hHeap; 209 extern S UBINFO**ppSubHash;209 extern SubInfo **ppSubHash; 210 210 extern BOOL bDebugCompile; 211 211 int i3,i4,VarSize,BufferSize; … … 328 328 LocalVar=(VARIABLE *)HeapReAlloc(hHeap,0,LocalVar,(MaxLocalVarNum+1)*sizeof(VARIABLE)); 329 329 330 lstrcpy(LocalVar[MaxLocalVarNum].name,psi-> pRealParmInfo[i3].name);330 lstrcpy(LocalVar[MaxLocalVarNum].name,psi->realParams[i3].GetVarName.c_str()); 331 331 332 332 // TODO: パラメータのConst定義の指定が未完成 333 333 LocalVar[MaxLocalVarNum].bConst=false; 334 334 335 LocalVar[MaxLocalVarNum].bArray=psi-> pRealParmInfo[i3].bArray;336 memcpy(LocalVar[MaxLocalVarNum].SubScripts,psi-> pRealParmInfo[i3].SubScripts,MAX_ARRAYDIM*sizeof(int));337 338 LocalVar[MaxLocalVarNum].type=psi-> pRealParmInfo[i3].type;335 LocalVar[MaxLocalVarNum].bArray=psi->realParams[i3].IsArray()?TRUE:FALSE; 336 memcpy(LocalVar[MaxLocalVarNum].SubScripts,psi->realParams[i3].GetSubScriptsPtr(),MAX_ARRAYDIM*sizeof(int)); 337 338 LocalVar[MaxLocalVarNum].type=psi->realParams[i3].GetBasicType(); 339 339 if(LocalVar[MaxLocalVarNum].type==DEF_OBJECT 340 340 ||LocalVar[MaxLocalVarNum].type==DEF_STRUCT){ … … 343 343 } 344 344 345 LocalVar[MaxLocalVarNum].u.index=psi-> pRealParmInfo[i3].u.index;346 347 if(psi-> pRealParmInfo[i3].bByVal&&psi->pRealParmInfo[i3].type==DEF_STRUCT){345 LocalVar[MaxLocalVarNum].u.index=psi->realParams[i3].GetIndex(); 346 347 if(psi->realParams[i3].IsRef() == false&&psi->realParams[i3].IsStruct()){ 348 348 //構造体のByValパラメータ 349 349 LocalVar[MaxLocalVarNum].fRef=REF_PARAMETER | OBJECT_PARAMETER; … … 351 351 } 352 352 else{ 353 if(psi-> pRealParmInfo[i3].bByVal&&psi->pRealParmInfo[i3].bArray==0){353 if(psi->realParams[i3].IsRef() == false&&psi->realParams[i3].IsArray()){ 354 354 LocalVar[MaxLocalVarNum].fRef=0; 355 355 VarSize=GetTypeSize(LocalVar[MaxLocalVarNum].type,LocalVar[MaxLocalVarNum].u.index); … … 383 383 384 384 //コンパイル中の関数 385 extern S UBINFO*pCompilingSubInfo;385 extern SubInfo *pCompilingSubInfo; 386 386 pCompilingSubInfo=psi; 387 387 … … 396 396 for(i3=psi->RealParmNum-1;i3>=0;i3--){ 397 397 if(i3==3){ 398 if( IsRealNumberType(psi->pRealParmInfo[i3].type)&&psi->pRealParmInfo[i3].bByVal){398 if(psi->realParams[i3].IsReal()&&psi->realParams[i3].IsRef() == false){ 399 399 //movsd qword ptr[rsp+0x20],xmm3 400 400 op_movsd_MR(REG_XMM3,REG_RSP,0x20,MOD_BASE_DISP32); … … 406 406 } 407 407 if(i3==2){ 408 if( IsRealNumberType(psi->pRealParmInfo[i3].type)&&psi->pRealParmInfo[i3].bByVal){408 if(psi->realParams[i3].IsReal()&&psi->realParams[i3].IsRef() == false){ 409 409 //movsd qword ptr[rsp+0x18],xmm2 410 410 op_movsd_MR(REG_XMM2,REG_RSP,0x18,MOD_BASE_DISP32); … … 416 416 } 417 417 if(i3==1){ 418 if( IsRealNumberType(psi->pRealParmInfo[i3].type)&&psi->pRealParmInfo[i3].bByVal){418 if(psi->realParams[i3].IsReal()&&psi->realParams[i3].IsRef() == false){ 419 419 //movsd qword ptr[rsp+0x10],xmm1 420 420 op_movsd_MR(REG_XMM1,REG_RSP,0x10,MOD_BASE_DISP32); … … 426 426 } 427 427 if(i3==0){ 428 if( IsRealNumberType(psi->pRealParmInfo[i3].type)&&psi->pRealParmInfo[i3].bByVal){428 if(psi->realParams[i3].IsReal()&&psi->realParams[i3].IsRef() == false){ 429 429 //movsd qword ptr[rsp+0x8],xmm0 430 430 op_movsd_MR(REG_XMM0,REG_RSP,0x8,MOD_BASE_DISP32); … … 497 497 498 498 //call _DebugSys_StartProc 499 extern S UBINFO*pSub_DebugSys_StartProc;499 extern SubInfo *pSub_DebugSys_StartProc; 500 500 op_call(pSub_DebugSys_StartProc); 501 501 } … … 720 720 if(bDebugCompile&&bDebugSupportProc==0){ 721 721 //call _DebugSys_EndProc 722 extern S UBINFO*pSub_DebugSys_EndProc;722 extern SubInfo *pSub_DebugSys_EndProc; 723 723 op_call(pSub_DebugSys_EndProc); 724 724 } … … 819 819 } 820 820 void CompileLocal(){ 821 extern S UBINFO**ppSubHash;821 extern SubInfo **ppSubHash; 822 822 int i2; 823 S UBINFO*psi;823 SubInfo *psi; 824 824 825 825 extern BOOL bDll; … … 835 835 //_System_InitStaticLocalVariablesは一番最後にコンパイル 836 836 //※一般関数内の静的変数オブジェクトをすべて収集しなければならない 837 extern S UBINFO*pSub_System_InitStaticLocalVariables;837 extern SubInfo *pSub_System_InitStaticLocalVariables; 838 838 pSub_System_InitStaticLocalVariables->bCompile=1; 839 839 840 840 //_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル 841 extern S UBINFO*pSub_System_Call_Destructor_of_GlobalObject;841 extern SubInfo *pSub_System_Call_Destructor_of_GlobalObject; 842 842 pSub_System_Call_Destructor_of_GlobalObject->bCompile=1; 843 843
Note:
See TracChangeset
for help on using the changeset viewer.