Ignore:
Timestamp:
Mar 6, 2008, 11:28:05 PM (16 years ago)
Author:
dai_9181
Message:

[415]を64bit版にマージ。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler64/NumOpe.cpp

    r413 r416  
    130130    return true;
    131131}
    132 bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member )
     132bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member, bool &isVariable, RELATIVE_VAR &relativeVar )
    133133{
    134134    const CClass &objClass = leftType.GetClass();
     
    166166                compiler.codeGenerator.op_mov_RR( REG_R11, useReg );
    167167
    168                 RELATIVE_VAR relativeVar;
    169                 relativeVar.dwKind=VAR_DIRECTMEM;
     168                RELATIVE_VAR tempRelativeVar;
     169                tempRelativeVar.dwKind=VAR_DIRECTMEM;
    170170
    171171                if( !_member_offset(
     
    173173                    false,  //読み込み専用
    174174                    leftType,
    175                     VarName,&relativeVar,classType,0))
    176                 {
    177                     return false;
     175                    VarName,&tempRelativeVar,classType,0)){
     176                        return false;
    178177                }
    179178
    180179                // オブジェクトメンバのポインタをraxにコピー
    181                 if( !VarToReg( relativeVar, baseType, resultType ) ){
     180                if( !VarToReg( tempRelativeVar, baseType, resultType ) ){
    182181                    SetError(11,termFull,cp);
    183182                }
     
    222221        compiler.codeGenerator.op_mov_RR( REG_R11, useReg );
    223222
    224         RELATIVE_VAR relativeVar;
    225223        relativeVar.dwKind=VAR_DIRECTMEM;
    226224
     
    233231        }
    234232
    235         if( !VarToReg( relativeVar, baseType, resultType ) ){
    236             SetError(11,termFull,cp);
    237         }
     233        // 変数として扱う
     234        isVariable = true;
    238235
    239236        return true;
     
    268265
    269266                // まずはプロパティ値を取得
    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 );
    271270
    272271                // 戻り値のオブジェクトインスタンスのインデクサを呼び出す
     
    275274                sprintf( temp2, "%s.%s", termLeft, methodName );
    276275                Type classType = resultType;
    277                 return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary );
     276                return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary, isVariable, relativeVar );
    278277            }
    279278
     
    333332    return false;
    334333}
    335 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){
     334bool _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{
    336336    char parameter[VN_SIZE];
    337337
     
    373373        }
    374374
    375         if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true, &isClassName ) ){
     375        if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, &isClassName ) ){
    376376            goto globalArea;
    377377        }
     
    391391        }
    392392
    393         return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member );
     393        return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member, isVariable, relativeVar );
    394394    }
    395395globalArea:
     
    554554    ////////////////////////////////
    555555
    556     RELATIVE_VAR relativeVar;
    557556    if(GetVarOffset(
    558557        false,  //エラー表示なし
    559         false,  //読み込み専用
     558        isWriteAccess,
    560559        termFull,
    561560        &relativeVar,resultType)){
     
    564563        //////////
    565564
    566         if( !VarToReg( relativeVar, baseType, resultType ) ){
    567             SetError(11,termFull,cp);
    568         }
     565        // 変数として扱う
     566        isVariable = true;
    569567
    570568        isLiteral = false;
     
    637635    return false;
    638636}
     637
     638bool 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}
     654bool 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
    639667
    640668bool _numope( int *pReg,
Note: See TracChangeset for help on using the changeset viewer.