Changeset 416 in dev for trunk/abdev/BasicCompiler64/NumOpe.cpp
- Timestamp:
- Mar 6, 2008, 11:28:05 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/NumOpe.cpp
r413 r416 130 130 return true; 131 131 } 132 bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member )132 bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member, bool &isVariable, RELATIVE_VAR &relativeVar ) 133 133 { 134 134 const CClass &objClass = leftType.GetClass(); … … 166 166 compiler.codeGenerator.op_mov_RR( REG_R11, useReg ); 167 167 168 RELATIVE_VAR relativeVar;169 relativeVar.dwKind=VAR_DIRECTMEM;168 RELATIVE_VAR tempRelativeVar; 169 tempRelativeVar.dwKind=VAR_DIRECTMEM; 170 170 171 171 if( !_member_offset( … … 173 173 false, //読み込み専用 174 174 leftType, 175 VarName,&relativeVar,classType,0)) 176 { 177 return false; 175 VarName,&tempRelativeVar,classType,0)){ 176 return false; 178 177 } 179 178 180 179 // オブジェクトメンバのポインタをraxにコピー 181 if( !VarToReg( relativeVar, baseType, resultType ) ){180 if( !VarToReg( tempRelativeVar, baseType, resultType ) ){ 182 181 SetError(11,termFull,cp); 183 182 } … … 222 221 compiler.codeGenerator.op_mov_RR( REG_R11, useReg ); 223 222 224 RELATIVE_VAR relativeVar;225 223 relativeVar.dwKind=VAR_DIRECTMEM; 226 224 … … 233 231 } 234 232 235 if( !VarToReg( relativeVar, baseType, resultType ) ){ 236 SetError(11,termFull,cp); 237 } 233 // 変数として扱う 234 isVariable = true; 238 235 239 236 return true; … … 268 265 269 266 // まずはプロパティ値を取得 270 TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, methodName ); 267 bool dummyIsVariable; 268 RELATIVE_VAR dummyRelativeVar; 269 TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, methodName, dummyIsVariable, dummyRelativeVar ); 271 270 272 271 // 戻り値のオブジェクトインスタンスのインデクサを呼び出す … … 275 274 sprintf( temp2, "%s.%s", termLeft, methodName ); 276 275 Type classType = resultType; 277 return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary );276 return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary, isVariable, relativeVar ); 278 277 } 279 278 … … 333 332 return false; 334 333 } 335 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){ 334 bool _TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool &isVariable, RELATIVE_VAR &relativeVar, bool isWriteAccess ) 335 { 336 336 char parameter[VN_SIZE]; 337 337 … … 373 373 } 374 374 375 if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true,&isClassName ) ){375 if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, &isClassName ) ){ 376 376 goto globalArea; 377 377 } … … 391 391 } 392 392 393 return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member );393 return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member, isVariable, relativeVar ); 394 394 } 395 395 globalArea: … … 554 554 //////////////////////////////// 555 555 556 RELATIVE_VAR relativeVar;557 556 if(GetVarOffset( 558 557 false, //エラー表示なし 559 false, //読み込み専用558 isWriteAccess, 560 559 termFull, 561 560 &relativeVar,resultType)){ … … 564 563 ////////// 565 564 566 if( !VarToReg( relativeVar, baseType, resultType ) ){ 567 SetError(11,termFull,cp); 568 } 565 // 変数として扱う 566 isVariable = true; 569 567 570 568 isLiteral = false; … … 637 635 return false; 638 636 } 637 638 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool isWriteAccess ) 639 { 640 RELATIVE_VAR relativeVar; 641 bool isVariable = false; 642 bool result = _TermOpe( term, baseType, resultType, isLiteral, pbUseHeap, pIsClassName, isProcedureCallOnly, isVariable, relativeVar, isWriteAccess ); 643 644 if( isVariable ) 645 { 646 // 変数の場合はeaxに変数ポインタを格納する 647 if( !VarToReg( relativeVar, baseType, resultType ) ){ 648 SetError(11,term,cp); 649 } 650 } 651 652 return result; 653 } 654 bool TermOpeOnlyVariable( const char *term, Type &resultType, RELATIVE_VAR &relativeVar, bool isWriteAccess ) 655 { 656 bool isLiteral, isVariable = false; 657 bool result = _TermOpe( term, Type(), resultType, isLiteral, NULL, NULL, false, isVariable, relativeVar, isWriteAccess ); 658 659 if( !isVariable ) 660 { 661 SetError(); 662 } 663 664 return result; 665 } 666 639 667 640 668 bool _numope( int *pReg,
Note:
See TracChangeset
for help on using the changeset viewer.