Changeset 51 in dev for BasicCompiler64/OperatorProc.cpp
- Timestamp:
- Feb 10, 2007, 8:30:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/OperatorProc.cpp
r50 r51 10 10 //////////////////////////////////////////////// 11 11 12 if(pobj_c->DestructorMemberSubIndex!=-1){ 12 CMethod *method = pobj_c->GetDestructorMethod(); 13 if( method ){ 13 14 //mov rcx,reg 14 15 op_mov_RR(REG_RCX,reg); 15 16 16 17 //call DestructorProcAddr 17 op_call( pobj_c->ppobj_Method[pobj_c->DestructorMemberSubIndex]->psi);18 op_call( method->psi ); 18 19 } 19 20 … … 294 295 295 296 if(bCalcUseHeap){ 296 /*297 //未解放のインスタンスが存在する場合298 //※専用のローカル変数を用意し、メモリリークを回避299 char temporary[VN_SIZE],temp2[VN_SIZE];300 301 302 ////////////////////////////////303 // 一時オブジェクト変数を用意304 ////////////////////////////////305 char szTempVarName[255];306 GetTypeName(CalcType,lpCalcIndex,temp2);307 sprintf(szTempVarName,"_System_strDummy%d",obp);308 wsprintf(temporary,"%s%c%c%s",szTempVarName,1,ESC_AS,temp2);309 InsertDimStatement_ToProcHead(temporary);310 311 RELATIVE_VAR VarRelativeVar;312 int VarType;313 LONG_PTR lpVarIndex;314 if(!GetVarOffsetReadOnly(315 szTempVarName,316 &VarType,317 &VarRelativeVar,318 &lpVarIndex)) return;319 320 321 CClass *pobj_c;322 pobj_c=(CClass *)lpCalcIndex;323 if(pobj_c->DestructorMemberSubIndex!=-1){324 325 //////////////////////////////////////////////////////326 ///// レジスタ資源のバックアップ327 { BACKUP_REGISTER_RESOURCE328 //////////////////////////////////////////////////////329 330 //ループの場合、古い一時オブジェクトのデストラクタを呼ぶ331 332 //rcxに変数アドレスをコピー333 SetVarPtrToReg(REG_RCX,&VarRelativeVar);334 335 //call destructor336 OpBuffer[obp++]=(char)0xE8;337 pobj_SubAddrSchedule->add(pobj_c->ppobj_Method[pobj_c->DestructorMemberSubIndex]->psi,1);338 obp+=sizeof(long);339 340 /////////////////////////////////////////////341 ////// レジスタ資源を復元342 RESTORE_REGISTER_RESOURCE343 }////////////////////////////////////////////344 }345 346 //mov r15,reg347 op_mov_RR(REG_R15,reg);348 349 350 int object_size;351 object_size=GetSizeOfClass((CClass *)lpVarIndex);352 353 //mov rcx,object_size354 op_mov_RV(sizeof(_int64),REG_RCX,object_size);355 356 //rdiに変数アドレスをコピー357 SetVarPtrToReg(REG_RDI,&VarRelativeVar);358 359 //mov rsi,reg360 op_mov_RR(REG_RSI,reg);361 362 //mov r14,rdi363 op_mov_RR(REG_R14,REG_RDI);364 pobj_BlockReg->lock(REG_R14);365 366 //rep movs byte ptr[rdi],byte ptr[rsi]367 op_rep_movs(sizeof(BYTE));368 369 //////////////////////////////////////////////////////370 ///// レジスタ資源のバックアップ371 { BACKUP_REGISTER_RESOURCE372 //////////////////////////////////////////////////////373 374 //mov rcx,r15375 op_mov_RR(REG_RCX,REG_R15);376 377 //call free378 extern SUBINFO *pSub_free;379 OpBuffer[obp++]=(char)0xE8;380 pobj_SubAddrSchedule->add(pSub_free,1);381 obp+=sizeof(long);382 383 /////////////////////////////////////////////384 ////// レジスタ資源を復元385 RESTORE_REGISTER_RESOURCE386 }////////////////////////////////////////////387 388 389 //mov reg,r14390 op_mov_RR(reg,REG_R14);391 392 pobj_BlockReg->unlock(REG_R14);393 */394 395 297 //未解放のインスタンスが存在する旨を示す警告 396 298 SetError(-105,NULL,cp); 397 398 299 } 399 300
Note:
See TracChangeset
for help on using the changeset viewer.