proper generation (placement) of HB_P_SEND opcode

This commit is contained in:
Antonio Linares
2002-01-25 13:35:11 +00:00
parent 29a9842246
commit d6b99e8834

View File

@@ -95,24 +95,16 @@ void hb_compExprPushOperEq( HB_EXPR_PTR pSelf, BYTE bOpEq )
{
HB_EXPR_PTR pObj = pSelf->value.asOperator.pLeft;
/* Push _message for the later assignment. */
HB_EXPR_PCODE1( hb_compGenMessageData, pObj->value.asMessage.szMessage );
/* Push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
/* Push _message for later use */
HB_EXPR_PCODE1( hb_compGenMessageData, pObj->value.asMessage.szMessage );
/* Now push current value of variable */
#ifdef HB_C52_STRICT
HB_EXPR_PCODE1( hb_compGenMessage, pObj->value.asMessage.szMessage );
/* push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
#else
/* NOTE: this duplicate optimization requires that HB_P_MESSAGE
* reverts items on the stack !
* duplicate object on the stack
*/
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_DUPLICATE );
#endif
/* now send the message */
HB_EXPR_PCODE1( hb_compGenMessage, pObj->value.asMessage.szMessage );
/* Do it. */
HB_EXPR_GENPCODE2( hb_compGenPCode2, HB_P_SENDSHORT, 0, ( BOOL ) 1 );
/* NOTE: COMPATIBILITY ISSUE:
@@ -179,21 +171,16 @@ void hb_compExprUseOperEq( HB_EXPR_PTR pSelf, BYTE bOpEq )
{
HB_EXPR_PTR pObj = pSelf->value.asOperator.pLeft;
/* Push _message for the later assignment. */
HB_EXPR_PCODE1( hb_compGenMessageData, pObj->value.asMessage.szMessage );
/* Push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
/* Push _message for later use */
HB_EXPR_PCODE1( hb_compGenMessageData, pObj->value.asMessage.szMessage );
/* Now push current value of variable */
#ifdef HB_C52_STRICT
/* push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
#else
/* duplicate object on the stack */
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_DUPLICATE );
#endif
/* now send the message */
HB_EXPR_PCODE1( hb_compGenMessage, pObj->value.asMessage.szMessage );
/* Push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
/* Do it.*/
HB_EXPR_GENPCODE2( hb_compGenPCode2, HB_P_SENDSHORT, 0, ( BOOL ) 1 );
/* push increment value */
@@ -201,9 +188,10 @@ void hb_compExprUseOperEq( HB_EXPR_PTR pSelf, BYTE bOpEq )
/* increase operation */
HB_EXPR_GENPCODE1( hb_compGenPCode1, bOpEq );
/* call pop message with one argument */
/* Now do the assignment - call pop message with one argument */
HB_EXPR_GENPCODE2( hb_compGenPCode2, HB_P_SENDSHORT, 1, ( BOOL ) 1 );
/* pop the value from the stack */
/* pop the unneeded value from the stack */
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_POP );
}
else
@@ -233,27 +221,22 @@ void hb_compExprPushPreOp( HB_EXPR_PTR pSelf, BYTE bOper )
{
HB_EXPR_PTR pObj = pSelf->value.asOperator.pLeft;
/* Push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
/* Push _message for later use */
HB_EXPR_PCODE1( hb_compGenMessageData, pObj->value.asMessage.szMessage );
/* Push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
/* Now push current value of variable */
#ifdef HB_C52_STRICT
/* push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
#else
/* duplicate object on the stack */
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_DUPLICATE );
#endif
/* now send the message */
HB_EXPR_PCODE1( hb_compGenMessage, pObj->value.asMessage.szMessage );
/* Push object */
HB_EXPR_USE( pObj->value.asMessage.pObject, HB_EA_PUSH_PCODE );
/* Do it. */
HB_EXPR_GENPCODE2( hb_compGenPCode2, HB_P_SENDSHORT, 0, ( BOOL ) 1 );
/* increase/decrease operation */
HB_EXPR_GENPCODE1( hb_compGenPCode1, bOper );
/* call pop message with one argument - it leaves the value on the stack */
/* Now, do the assignment - call pop message with one argument - it leaves the value on the stack */
HB_EXPR_GENPCODE2( hb_compGenPCode2, HB_P_SENDSHORT, 1, ( BOOL ) 1 );
}
else
@@ -457,9 +440,9 @@ BOOL hb_compExprCheckMacroVar( char * szText )
if( bTextSubst )
{
#if defined( HB_MACRO_SUPPORT )
HB_SYMBOL_UNUSED( bMacroText );
HB_SYMBOL_UNUSED( bMacroText );
return TRUE; /*there is no need to check all '&' occurences */
#else
#else
/* There is a valid character after '&' that can be used in
* variable name - check if the whole variable name is valid
* (local, static and field variable names are invalid because
@@ -522,4 +505,4 @@ HB_EXPR_PTR hb_compExprReducePlusStrings( HB_EXPR_PTR pLeft, HB_EXPR_PTR pRight,
HB_SYMBOL_UNUSED( HB_MACRO_PARAM ); /* to suppress BCC warning */
return pLeft;
}
#endif
#endif