Changeset 417 in dev
- Timestamp:
- Mar 7, 2008, 5:32:29 AM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/Compile_Calc.cpp
r416 r417 205 205 206 206 //変数アドレスを取得 207 RELATIVE_VAR VarRelativeVar; 207 208 if( !TermOpeOnlyVariable( variable, varType, VarRelativeVar, true ) ) 208 209 { … … 213 214 //レジスタのブロッキングを解除 214 215 pobj_BlockReg->clear(); 215 216 if( !result )217 {218 return;219 }220 216 221 217 if(varType.GetBasicType()&FLAG_PTR){ -
trunk/abdev/BasicCompiler64/NumOpe.cpp
r416 r417 638 638 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool isWriteAccess ) 639 639 { 640 bool isInitRegSwitch = false; 641 if( !pobj_reg ) 642 { 643 isInitRegSwitch = true; 644 645 //作業用レジスタを取得 646 pobj_reg = new CRegister( REG_RAX ); 647 } 648 649 //エラー時の復旧用 650 CRegister objReg_Backup = *pobj_reg; 651 652 640 653 RELATIVE_VAR relativeVar; 641 654 bool isVariable = false; … … 650 663 } 651 664 665 666 if( !result ) 667 { 668 *pobj_reg = objReg_Backup; 669 } 670 671 if( isInitRegSwitch ){ 672 //整合性をチェック(バグ回避) 673 if( result ) 674 { 675 pobj_reg->bug_check(); 676 } 677 678 //作業レジスタを解放 679 delete pobj_reg; 680 pobj_reg = NULL; 681 } 682 652 683 return result; 653 684 } 654 685 bool TermOpeOnlyVariable( const char *term, Type &resultType, RELATIVE_VAR &relativeVar, bool isWriteAccess ) 655 686 { 687 if( pobj_reg ) 688 { 689 SetError(); 690 } 691 692 //作業用レジスタを取得 693 pobj_reg = new CRegister( REG_NON ); 694 656 695 bool isLiteral, isVariable = false; 657 696 bool result = _TermOpe( term, Type(), resultType, isLiteral, NULL, NULL, false, isVariable, relativeVar, isWriteAccess ); … … 661 700 SetError(); 662 701 } 702 703 //整合性をチェック(バグ回避) 704 if( result ) 705 { 706 pobj_reg->bug_check(); 707 } 708 709 //作業レジスタを解放 710 delete pobj_reg; 711 pobj_reg=0; 663 712 664 713 return result; … … 1327 1376 BOOL *pbUseHeap ) 1328 1377 { 1329 BOOL bInitRegSwitch=0; 1330 if(!pobj_reg){ 1331 bInitRegSwitch=1; 1378 bool isInitRegSwitch = false; 1379 if( !pobj_reg ) 1380 { 1381 isInitRegSwitch = true; 1332 1382 1333 1383 //作業用レジスタを取得 1334 pobj_reg =new CRegister(*pReg);1384 pobj_reg = new CRegister( *pReg ); 1335 1385 } 1336 1386 1337 1387 //エラー時の復旧用 1338 CRegister objReg_Backup; 1339 objReg_Backup=*pobj_reg; 1388 CRegister objReg_Backup = *pobj_reg; 1340 1389 1341 1390 *pReg = pobj_reg->GetNextReg(); … … 1347 1396 if( !result ) 1348 1397 { 1349 *pobj_reg =objReg_Backup;1350 } 1351 1352 if( bInitRegSwitch){1398 *pobj_reg = objReg_Backup; 1399 } 1400 1401 if( isInitRegSwitch ){ 1353 1402 //整合性をチェック(バグ回避) 1354 1403 if( result ) … … 1359 1408 //作業レジスタを解放 1360 1409 delete pobj_reg; 1361 pobj_reg =0;1410 pobj_reg = NULL; 1362 1411 } 1363 1412 -
trunk/abdev/BasicCompiler_Common/include/Class.h
r412 r417 565 565 std::string GetStaticDefiningStringAsMemberTypeInfoNames() const; 566 566 std::string GetStaticDefiningStringAsMemberOffsets() const; 567 void GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset = 0 ) const; 567 568 568 569 -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r412 r417 1292 1292 // 未使用のクラスは無視する 1293 1293 continue; 1294 } 1295 1296 char referenceOffsetsBuffer[1024] = "";1294 } 1295 1296 std::string referenceOffsetsBuffer; 1297 1297 int numOfReference = 0; 1298 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){ 1299 if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() ){ 1300 if( referenceOffsetsBuffer[0] ){ 1301 lstrcat( referenceOffsetsBuffer, "," ); 1302 } 1303 1304 sprintf( referenceOffsetsBuffer + lstrlen( referenceOffsetsBuffer ), 1305 "%d", 1306 objClass.GetMemberOffset( pMember->GetName().c_str() ) ); 1307 1308 numOfReference++; 1309 } 1310 } 1298 objClass.GetReferenceOffsetsInitializeBuffer( referenceOffsetsBuffer, numOfReference ); 1311 1299 1312 1300 sprintf( temporary … … 1317 1305 , objClass.GetName().c_str() // クラス名 1318 1306 , objClass.GetFullName().c_str() // フルネーム 1319 , referenceOffsetsBuffer 1307 , referenceOffsetsBuffer.c_str() // 参照メンバオフセット配列 1320 1308 , numOfReference // 参照メンバの個数 1321 1309 ); … … 1577 1565 return result; 1578 1566 } 1567 1568 void CClass::GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset ) const 1569 { 1570 const CClass &thisClass = *this; 1571 BOOST_FOREACH( const CMember *pMember, thisClass.GetDynamicMembers() ) 1572 { 1573 if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() ) 1574 { 1575 if( referenceOffsetsBuffer.size() ) 1576 { 1577 referenceOffsetsBuffer += ","; 1578 } 1579 1580 char temp[255]; 1581 sprintf( temp, "%d", baseOffset + thisClass.GetMemberOffset( pMember->GetName().c_str() ) ); 1582 referenceOffsetsBuffer += temp; 1583 1584 numOfReference++; 1585 } 1586 if( pMember->GetType().IsStruct() && !pMember->GetType().IsPointer() ) 1587 { 1588 // 構造体の実体をメンバに持つとき 1589 int baseOffset = thisClass.GetMemberOffset( pMember->GetName().c_str() ); 1590 1591 // 構造体メンバでGCによるチェックが必要な参照位置を追加 1592 pMember->GetType().GetClass().GetReferenceOffsetsInitializeBuffer( referenceOffsetsBuffer, numOfReference, baseOffset ); 1593 } 1594 } 1595 } -
trunk/abdev/BasicCompiler_Common/src/DataTable.cpp
r409 r417 293 293 BOOST_FOREACH( const std::string ¶mStr, parameters ) 294 294 { 295 if( paramStr.size() == 0 ) 296 { 297 throw; 298 } 295 299 if( paramStr[0] == '\"' ) 296 300 {
Note:
See TracChangeset
for help on using the changeset viewer.