Changeset 140 in dev for BasicCompiler64
- Timestamp:
- Jun 15, 2007, 4:00:25 AM (17 years ago)
- Location:
- BasicCompiler64
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/BasicCompiler.vcproj
r137 r140 350 350 Name="VCCLCompilerTool" 351 351 Optimization="2" 352 InlineFunctionExpansion="2" 353 FavorSizeOrSpeed="1" 352 354 AdditionalIncludeDirectories="..\cpplibs\boost;..\BasicCompiler_Common\include" 353 355 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64" … … 480 482 > 481 483 <File 484 RelativePath="..\BasicCompiler_Common\include\logger.h" 485 > 486 </File> 487 <File 482 488 RelativePath="..\BasicCompiler_Common\include\Namespace.h" 483 489 > … … 489 495 <File 490 496 RelativePath="..\BasicCompiler_Common\Procedure.h" 497 > 498 </File> 499 <File 500 RelativePath="..\BasicCompiler_Common\include\Symbol.h" 491 501 > 492 502 </File> … … 1592 1602 </File> 1593 1603 <File 1604 RelativePath="..\BasicCompiler_Common\src\Symbol.cpp" 1605 > 1606 </File> 1607 <File 1594 1608 RelativePath="..\BasicCompiler_Common\Type.cpp" 1595 1609 > -
BasicCompiler64/Compile_Object.cpp
r135 r140 57 57 if( subs.size() == 1 ){ 58 58 char temporary[VN_SIZE]; 59 sprintf( temporary, " _System_TypeBase.Search(\"\",\"%s\"))", pobj_c->GetName().c_str() );59 sprintf( temporary, "ActiveBasic.Core._System_TypeBase.Search(\"\",\"%s\"))", pobj_c->GetName().c_str() ); 60 60 61 61 Opcode_CallProc(temporary, -
BasicCompiler64/Compile_ProcOp.cpp
r135 r140 566 566 } 567 567 568 //新しいオブジェクト領域は0で初期化されているため、Nothingを明示的に代入する必要はない569 /*570 //実体クラスを持つメンバのコンストラクタ(引数有りを除く)を呼び出す571 for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){572 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3];573 if(pMember->IsObject()){574 // オブジェクトメンバを発見したとき575 576 sprintf(temporary, "This.%s=Nothing",577 pMember->name );578 OpcodeCalc( temporary );579 }580 }581 */582 583 568 //仮想関数テーブルを初期化 584 569 if(pobj_CompilingClass->vtbl_num&& … … 659 644 } 660 645 } 661 662 //実体クラスを持つメンバのデストラクタ呼び出しはGCに任せる663 /*664 //※コンストラクタと逆順序で呼び出す665 for(i3=pobj_CompilingClass->iMemberNum-1;i3>=0;i3--){666 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3];667 int MemberTypeSize=668 GetTypeSize(pMember->TypeInfo.type,669 pMember->TypeInfo.u.lpIndex);670 671 int MemberObjectNum=672 JumpSubScripts(pMember->SubScripts);673 674 int offset = pobj_CompilingClass->GetMemberOffset( pMember->name, NULL );675 676 if(pMember->IsObject()){677 CMethod *method = pMember->GetClass().GetDestructorMethod();678 if( method ){679 for(i4=MemberObjectNum-1;i4>=0;i4--){680 //Thisポインタをrcxにコピー681 SetThisPtrToReg(REG_RCX);682 683 //add rcx,offset684 op_add_RV(REG_RCX,offset+i4*MemberTypeSize);685 686 //call destructor687 op_call(method->pUserProc);688 }689 }690 }691 }*/692 646 } 693 647 } -
BasicCompiler64/Compile_Var.cpp
r138 r140 187 187 } 188 188 bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess){ 189 int i;190 191 189 192 190 ////////////////////////////////////// … … 207 205 //////////////////////////// 208 206 209 int offset = objClass.GetMemberOffset( VarName, &i ); 210 if(i==objClass.iMemberNum){ 207 int memberIndex; 208 int offset = objClass.GetMemberOffset( VarName, &memberIndex ); 209 if( memberIndex == objClass.GetDynamicMembers().size() ){ 211 210 if(isErrorEnabled) SetError(103,VarName,cp); 212 211 return false; 213 212 } 214 213 215 CMember *pMember =objClass.ppobj_Member[i];214 CMember *pMember = objClass.GetDynamicMembers()[memberIndex]; 216 215 217 216 … … 379 378 } 380 379 bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss){ 381 int i;382 380 char variable[VN_SIZE]; 383 381 … … 471 469 //クラス内メンバを参照するとき(通常) 472 470 473 for(i=0;i<pobj_CompilingClass->iMemberNum;i++){ 474 if( pobj_CompilingClass->ppobj_Member[i]->GetName() == VarName ){ 471 bool isFound = false; 472 BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){ 473 if( pMember->GetName() == VarName ){ 474 isFound = true; 475 475 break; 476 476 } 477 477 } 478 if( i==pobj_CompilingClass->iMemberNum) goto NonClassMember;478 if( !isFound ) goto NonClassMember; 479 479 } 480 480 … … 773 773 const CClass &objClass = type.GetClass(); 774 774 775 for(i=0,i2=0;i2<objClass.iMemberNum;i2++){ 775 int i = 0; 776 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){ 777 if(InitBuf[i]=='\0'){ 778 SetError(41,0,cp); 779 return false; 780 } 781 776 782 i=GetOneParameter(InitBuf,i,temporary); 777 783 778 i3=objClass.GetMemberOffset( objClass.ppobj_Member[i2]->GetName().c_str(), NULL );784 i3=objClass.GetMemberOffset( pMember->GetName().c_str(), NULL ); 779 785 780 786 if(!SetInitGlobalData(offset+i3, 781 objClass.ppobj_Member[i2]->GetType(),782 objClass.ppobj_Member[i2]->SubScripts,787 pMember->GetType(), 788 pMember->SubScripts, 783 789 temporary)) return false; 784 785 if(InitBuf[i]=='\0') break;786 }787 if(i2+1!=objClass.iMemberNum){788 SetError(41,0,cp);789 return false;790 790 } 791 791 return true; … … 911 911 const CClass &objClass = type.GetClass(); 912 912 913 for(i=0,i2=0;i2<objClass.iMemberNum;i2++){ 913 int i = 0; 914 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){ 915 if(InitBuf[i]=='\0'){ 916 SetError(41,0,cp); 917 return false; 918 } 919 914 920 i=GetOneParameter(InitBuf,i,temporary); 915 921 916 i3=objClass.GetMemberOffset( objClass.ppobj_Member[i2]->GetName().c_str(), NULL );922 i3=objClass.GetMemberOffset( pMember->GetName().c_str(), NULL ); 917 923 918 924 if(!InitLocalVar(offset+i3, 919 objClass.ppobj_Member[i2]->GetType(),920 objClass.ppobj_Member[i2]->SubScripts,925 pMember->GetType(), 926 pMember->SubScripts, 921 927 temporary)) return false; 922 928 923 929 if(InitBuf[i]=='\0') break; 924 }925 if(i2+1!=objClass.iMemberNum){926 SetError(41,0,cp);927 return 0;928 930 } 929 931 return true; -
BasicCompiler64/MakePeHdr.cpp
r129 r140 240 240 pSub_System_GC_free_for_SweepingDelete->Using(); 241 241 242 if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( " _System_TypeBase.InitializeUserTypes",1 ) ){242 if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "ActiveBasic.Core._System_TypeBase.InitializeUserTypes",1 ) ){ 243 243 pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using(); 244 244 pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsAutoGenerationProc(); -
BasicCompiler64/NumOpe.cpp
r135 r140 524 524 //New演算子(オブジェクト生成) 525 525 526 if( !Operator_New( expression+2, baseType, resultType ) ){ 527 return false; 528 } 526 if( pobj_BlockReg->check(REG_RAX) ){ 527 SetError(); 528 } 529 530 ////////////////////////////////////////////////////// 531 ///// レジスタ資源のバックアップ 532 { BACKUP_REGISTER_RESOURCE 533 ////////////////////////////////////////////////////// 534 535 if( !Operator_New( expression+2, baseType, resultType ) ){ 536 return false; 537 } 538 539 ///////////////////////////////////////////// 540 ////// レジスタ資源を復元 541 RESTORE_REGISTER_RESOURCE 542 }//////////////////////////////////////////// 529 543 530 544 //mov reg,rax -
BasicCompiler64/Opcode.h
r138 r140 353 353 354 354 private: 355 bool _overload_check( int level, const Parameters ¶ms, const Type &returnType );356 UserProc *OverloadSolutionWithReturnType( const char *name, std::vector<UserProc *> &subs ); 355 bool EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType ); 356 357 357 public: 358 UserProc *OverloadSolution( const char *name, std::vector<UserProc *> &subs ); 358 UserProc *_OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false ); 359 UserProc *OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false ); 359 360 360 361 void ApplyDefaultParameters( const Parameters ¶ms );
Note:
See TracChangeset
for help on using the changeset viewer.