2010-07-07 18:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* src/compiler/hbmain.c
* src/compiler/hbfix.c
* src/compiler/hbdbginf.c
* src/compiler/hbpcode.c
* src/compiler/genhrb.c
* src/compiler/hbdead.c
* src/compiler/genc.c
* src/compiler/hbopt.c
* src/compiler/gencc.c
* src/compiler/hblbl.c
* src/compiler/harbour.yyc
* src/compiler/hbstripl.c
* src/compiler/harbour.y
* include/hbcomp.h
* include/hbcompdf.h
* include/hbexprb.c
* lPCodePos -> nPCodePos
(objects verified)
This commit is contained in:
@@ -16,6 +16,26 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-07-07 18:08 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/compiler/hbmain.c
|
||||
* src/compiler/hbfix.c
|
||||
* src/compiler/hbdbginf.c
|
||||
* src/compiler/hbpcode.c
|
||||
* src/compiler/genhrb.c
|
||||
* src/compiler/hbdead.c
|
||||
* src/compiler/genc.c
|
||||
* src/compiler/hbopt.c
|
||||
* src/compiler/gencc.c
|
||||
* src/compiler/hblbl.c
|
||||
* src/compiler/harbour.yyc
|
||||
* src/compiler/hbstripl.c
|
||||
* src/compiler/harbour.y
|
||||
* include/hbcomp.h
|
||||
* include/hbcompdf.h
|
||||
* include/hbexprb.c
|
||||
* lPCodePos -> nPCodePos
|
||||
(objects verified)
|
||||
|
||||
2010-07-07 18:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/compiler/ppcomp.c
|
||||
* src/compiler/hbmain.c
|
||||
|
||||
@@ -71,7 +71,7 @@ HB_EXTERN_BEGIN
|
||||
|
||||
/* definitions for hb_compPCodeEval() support */
|
||||
typedef void * HB_VOID_PTR;
|
||||
#define HB_PCODE_FUNC( func, type ) HB_SIZE func( PFUNCTION pFunc, HB_SIZE lPCodePos, type cargo )
|
||||
#define HB_PCODE_FUNC( func, type ) HB_SIZE func( PFUNCTION pFunc, HB_SIZE nPCodePos, type cargo )
|
||||
typedef HB_PCODE_FUNC( HB_PCODE_FUNC_, HB_VOID_PTR );
|
||||
typedef HB_PCODE_FUNC_ * HB_PCODE_FUNC_PTR;
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ typedef struct __FUNC
|
||||
PVAR pPrivates; /* pointer to private variables list */
|
||||
HB_BYTE * pCode; /* pointer to a memory block where pcode is stored */
|
||||
HB_SIZE lPCodeSize; /* total memory size for pcode */
|
||||
HB_SIZE lPCodePos; /* actual pcode offset */
|
||||
HB_SIZE nPCodePos; /* actual pcode offset */
|
||||
int iStaticsBase; /* base for this function statics */
|
||||
int iFuncSuffix; /* function suffix for multiple static functions with the same name */
|
||||
HB_SIZE * pNOOPs; /* pointer to the NOOP array */
|
||||
@@ -652,7 +652,7 @@ typedef struct HB_PCODE_INFO_ /* compiled pcode container for macro compiler */
|
||||
{
|
||||
HB_BYTE * pCode; /* pointer to a memory block where pcode is stored */
|
||||
HB_SIZE lPCodeSize; /* total memory size for pcode */
|
||||
HB_SIZE lPCodePos; /* actual pcode offset */
|
||||
HB_SIZE nPCodePos; /* actual pcode offset */
|
||||
HB_BOOL fVParams; /* function/codeblock with variable parameters */
|
||||
HB_CBVAR_PTR pLocals;
|
||||
struct HB_PCODE_INFO_ * pPrev;
|
||||
|
||||
@@ -975,13 +975,13 @@ static HB_EXPR_FUNC( hb_compExprUseIIF )
|
||||
pExpr =pExpr->pNext;
|
||||
|
||||
#if defined( HB_MACRO_SUPPORT )
|
||||
if( HB_PCODE_DATA->lPCodePos == ulPosFalse + 3 )
|
||||
if( HB_PCODE_DATA->nPCodePos == ulPosFalse + 3 )
|
||||
{
|
||||
HB_PCODE_DATA->pCode[ ulPosFalse - 1 ] = HB_P_JUMPTRUEFAR;
|
||||
ulPosEnd = ulPosFalse;
|
||||
}
|
||||
#else
|
||||
if( HB_COMP_PARAM->functions.pLast->lPCodePos == ulPosFalse + 3 )
|
||||
if( HB_COMP_PARAM->functions.pLast->nPCodePos == ulPosFalse + 3 )
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->pCode[ ulPosFalse - 1 ] = HB_P_JUMPTRUEFAR;
|
||||
ulPosEnd = ulPosFalse;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,7 @@ static HB_SIZE hb_compHrbSize( HB_COMP_DECL, HB_ULONG * pulSymbols, HB_ULONG * p
|
||||
if( ( pFunc->funFlags & FUN_FILE_DECL ) == 0 )
|
||||
{
|
||||
( * pulFunctions )++;
|
||||
nSize += strlen( pFunc->szName ) + 5 + pFunc->lPCodePos; /* \0 + func_size[4] + function_body */
|
||||
nSize += strlen( pFunc->szName ) + 5 + pFunc->nPCodePos; /* \0 + func_size[4] + function_body */
|
||||
}
|
||||
pFunc = pFunc->pNext;
|
||||
}
|
||||
@@ -129,10 +129,10 @@ void hb_compGenBufPortObj( HB_COMP_DECL, HB_BYTE ** pBufPtr, HB_SIZE * pnSize )
|
||||
nLen = strlen( pFunc->szName ) + 1;
|
||||
memcpy( ptr, pFunc->szName, nLen );
|
||||
ptr += nLen;
|
||||
HB_PUT_LE_UINT32( ptr, pFunc->lPCodePos ); /* function size */
|
||||
HB_PUT_LE_UINT32( ptr, pFunc->nPCodePos ); /* function size */
|
||||
ptr += 4;
|
||||
memcpy( ptr, pFunc->pCode, pFunc->lPCodePos ); /* function body */
|
||||
ptr += pFunc->lPCodePos;
|
||||
memcpy( ptr, pFunc->pCode, pFunc->nPCodePos ); /* function body */
|
||||
ptr += pFunc->nPCodePos;
|
||||
}
|
||||
pFunc = pFunc->pNext;
|
||||
}
|
||||
|
||||
@@ -1033,7 +1033,7 @@ CodeBlock : BlockHead
|
||||
| BlockHead Crlf
|
||||
{ /* 3 */
|
||||
HB_CBVAR_PTR pVar;
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compCodeBlockStart( HB_COMP_PARAM, HB_TRUE );
|
||||
HB_COMP_PARAM->functions.pLast->funFlags |= FUN_EXTBLOCK;
|
||||
HB_COMP_PARAM->functions.pLast->fVParams =
|
||||
@@ -1060,8 +1060,8 @@ CodeBlock : BlockHead
|
||||
hb_compCodeBlockEnd( HB_COMP_PARAM );
|
||||
$$ = hb_compExprSetCodeblockBody( $1,
|
||||
HB_COMP_PARAM->functions.pLast->pCode + $<sNumber>3,
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos - $<sNumber>3 );
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos = $<sNumber>3;
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos - $<sNumber>3 );
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos = $<sNumber>3;
|
||||
HB_COMP_PARAM->lastLinePos = 0;
|
||||
}
|
||||
;
|
||||
@@ -1502,7 +1502,7 @@ DoWhile : WhileBegin ExpList Crlf
|
||||
EmptyStats
|
||||
{
|
||||
hb_compLoopHere( HB_COMP_PARAM );
|
||||
hb_compGenJump( $1 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJump( $1 - HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
}
|
||||
EndWhile
|
||||
{
|
||||
@@ -1516,7 +1516,7 @@ DoWhile : WhileBegin ExpList Crlf
|
||||
|
||||
WhileBegin : WHILE
|
||||
{
|
||||
$$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
++HB_COMP_PARAM->functions.pLast->wWhileCounter;
|
||||
hb_compLoopStart( HB_COMP_PARAM, HB_TRUE );
|
||||
@@ -1551,7 +1551,7 @@ ForNext : FOR LValue ForAssign Expression /* 1 2 3 4 */
|
||||
}
|
||||
Crlf /* 10 */
|
||||
{ /* 11 */
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
}
|
||||
ForStatements /* 12 */
|
||||
{
|
||||
@@ -1589,7 +1589,7 @@ ForNext : FOR LValue ForAssign Expression /* 1 2 3 4 */
|
||||
hb_compGenPCode1( HB_P_FORTEST, HB_COMP_PARAM );
|
||||
}
|
||||
|
||||
hb_compGenJumpFalse( $<sNumber>11 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJumpFalse( $<sNumber>11 - HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
hb_compLoopEnd( HB_COMP_PARAM );
|
||||
if( hb_compExprAsSymbol( $<asExpr>2 ) )
|
||||
hb_compForEnd( HB_COMP_PARAM, hb_compExprAsSymbol( $<asExpr>2 ) );
|
||||
@@ -1651,7 +1651,7 @@ ForEach : FOREACH ForList IN ForArgs /* 1 2 3 4 */
|
||||
hb_compEnumStart( HB_COMP_PARAM, $2, $4, $6 );
|
||||
|
||||
hb_compLoopStart( HB_COMP_PARAM, HB_TRUE );
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
}
|
||||
Crlf /* 8 */
|
||||
{
|
||||
@@ -1662,7 +1662,7 @@ ForEach : FOREACH ForList IN ForArgs /* 1 2 3 4 */
|
||||
{
|
||||
hb_compLoopHere( HB_COMP_PARAM );
|
||||
hb_compEnumNext( HB_COMP_PARAM, $2, $6 );
|
||||
hb_compGenJump( $<sNumber>7 - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJump( $<sNumber>7 - HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
|
||||
hb_compGenJumpHere( $<sNumber>9, HB_COMP_PARAM );
|
||||
hb_compLoopEnd( HB_COMP_PARAM );
|
||||
@@ -1816,7 +1816,7 @@ BlockSeq : /* no always */ { $$ = 0; }
|
||||
{
|
||||
HB_COMP_EXPR_FREE( hb_compExprGenPush( $2, HB_COMP_PARAM ) );
|
||||
hb_compGenPCode1( HB_P_SEQBLOCK, HB_COMP_PARAM );
|
||||
$$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1827,7 +1827,7 @@ AlwaysSeq : /* no always */ { $$ = 0; }
|
||||
Always : ALWAYS
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->funFlags &= ~ ( FUN_WITH_RETURN | FUN_BREAK_CODE );
|
||||
$$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
++HB_COMP_PARAM->functions.pLast->wAlwaysCounter;
|
||||
hb_compSequenceAlways( HB_COMP_PARAM );
|
||||
}
|
||||
@@ -1841,7 +1841,7 @@ RecoverSeq : /* no recover */ { $$ = 0; HB_COMP_PARAM->functions.pLast->funFl
|
||||
RecoverEmpty : RECOVER
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->funFlags &= ~ FUN_BREAK_CODE;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
if( HB_COMP_PARAM->functions.pLast->wSeqCounter )
|
||||
--HB_COMP_PARAM->functions.pLast->wSeqCounter;
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
@@ -1852,7 +1852,7 @@ RecoverEmpty : RECOVER
|
||||
RecoverUsing : RECOVERUSING IdentName
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->funFlags &= ~ FUN_BREAK_CODE;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
if( HB_COMP_PARAM->functions.pLast->wSeqCounter )
|
||||
--HB_COMP_PARAM->functions.pLast->wSeqCounter;
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
@@ -1901,7 +1901,7 @@ WithObject : WITHOBJECT Expression Crlf
|
||||
{
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
HB_COMP_EXPR_FREE( hb_compExprGenPush( $2, HB_COMP_PARAM ) );
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compGenPCode1( HB_P_WITHOBJECTSTART, HB_COMP_PARAM );
|
||||
HB_COMP_PARAM->functions.pLast->wWithObjectCnt++;
|
||||
}
|
||||
@@ -1966,7 +1966,7 @@ static void hb_compLoopStart( HB_COMP_DECL, HB_BOOL fCanLoop )
|
||||
else
|
||||
pFunc->pLoops = pLoop;
|
||||
|
||||
pLoop->ulOffset = pFunc->lPCodePos; /* store the start position */
|
||||
pLoop->ulOffset = pFunc->nPCodePos; /* store the start position */
|
||||
pLoop->fCanLoop = fCanLoop; /* can we use LOOP inside */
|
||||
pLoop->wSeqCounter = pFunc->wSeqCounter; /* store current SEQUENCE counter */
|
||||
pLoop->wWithObjectCnt = pFunc->wWithObjectCnt; /* store current WITH OBJECT counter */
|
||||
@@ -2068,7 +2068,7 @@ static void hb_compLoopLoop( HB_COMP_DECL )
|
||||
wWithObjectCnt++;
|
||||
}
|
||||
/* store the position to fix */
|
||||
pLoop->ulOffset = pFunc->lPCodePos;
|
||||
pLoop->ulOffset = pFunc->nPCodePos;
|
||||
hb_compGenJump( 0, HB_COMP_PARAM );
|
||||
}
|
||||
}
|
||||
@@ -2124,7 +2124,7 @@ static void hb_compLoopExit( HB_COMP_DECL )
|
||||
wWithObjectCnt++;
|
||||
}
|
||||
/* store the position to fix */
|
||||
pLoop->ulOffset = pFunc->lPCodePos;
|
||||
pLoop->ulOffset = pFunc->nPCodePos;
|
||||
hb_compGenJump( 0, HB_COMP_PARAM );
|
||||
}
|
||||
}
|
||||
@@ -2553,7 +2553,7 @@ static void hb_compSwitchStart( HB_COMP_DECL, HB_EXPR_PTR pExpr )
|
||||
pSwitch->pCases = NULL;
|
||||
pSwitch->pLast = NULL;
|
||||
pSwitch->ulDefault = 0;
|
||||
pSwitch->ulOffset = pFunc->lPCodePos;
|
||||
pSwitch->ulOffset = pFunc->nPCodePos;
|
||||
pSwitch->pExpr = pExpr;
|
||||
pSwitch->pPrev = pFunc->pSwitch;
|
||||
pFunc->pSwitch = pSwitch;
|
||||
@@ -2570,7 +2570,7 @@ static void hb_compSwitchAdd( HB_COMP_DECL, HB_EXPR_PTR pExpr )
|
||||
{
|
||||
/* normal CASE */
|
||||
pCase = (HB_SWITCHCASE_PTR) hb_xgrab( sizeof( HB_SWITCHCASE ) );
|
||||
pCase->ulOffset = pFunc->lPCodePos;
|
||||
pCase->ulOffset = pFunc->nPCodePos;
|
||||
pCase->pNext = NULL;
|
||||
pExpr = hb_compExprReduce( pExpr, HB_COMP_PARAM );
|
||||
if( !( hb_compExprIsLong( pExpr ) || hb_compExprIsString( pExpr ) ) )
|
||||
@@ -2602,7 +2602,7 @@ static void hb_compSwitchAdd( HB_COMP_DECL, HB_EXPR_PTR pExpr )
|
||||
}
|
||||
else
|
||||
{
|
||||
pFunc->pSwitch->ulDefault = pFunc->lPCodePos;
|
||||
pFunc->pSwitch->ulDefault = pFunc->nPCodePos;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2663,7 +2663,7 @@ static void hb_compSwitchEnd( HB_COMP_DECL )
|
||||
HB_BOOL fMacroText = ( HB_COMP_PARAM->supported & HB_COMPFLAG_MACROTEXT ) != 0;
|
||||
|
||||
pExpr = hb_compExprGenPush( pExpr, HB_COMP_PARAM );
|
||||
ulCountPos = pFunc->lPCodePos + 1;
|
||||
ulCountPos = pFunc->nPCodePos + 1;
|
||||
hb_compGenPCode3( HB_P_SWITCH, 0, 0, HB_COMP_PARAM );
|
||||
HB_COMP_PARAM->fLongOptimize = HB_FALSE;
|
||||
HB_COMP_PARAM->supported &= ~HB_COMPFLAG_MACROTEXT;
|
||||
|
||||
@@ -5710,7 +5710,7 @@ yyreduce:
|
||||
#line 1034 "harbour.y"
|
||||
{ /* 3 */
|
||||
HB_CBVAR_PTR pVar;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compCodeBlockStart( HB_COMP_PARAM, HB_TRUE );
|
||||
HB_COMP_PARAM->functions.pLast->funFlags |= FUN_EXTBLOCK;
|
||||
HB_COMP_PARAM->functions.pLast->fVParams =
|
||||
@@ -5740,8 +5740,8 @@ yyreduce:
|
||||
hb_compCodeBlockEnd( HB_COMP_PARAM );
|
||||
(yyval.asExpr) = hb_compExprSetCodeblockBody( (yyvsp[(1) - (5)].asExpr),
|
||||
HB_COMP_PARAM->functions.pLast->pCode + (yyvsp[(3) - (5)].sNumber),
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos - (yyvsp[(3) - (5)].sNumber) );
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos = (yyvsp[(3) - (5)].sNumber);
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos - (yyvsp[(3) - (5)].sNumber) );
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos = (yyvsp[(3) - (5)].sNumber);
|
||||
HB_COMP_PARAM->lastLinePos = 0;
|
||||
;}
|
||||
break;
|
||||
@@ -6365,7 +6365,7 @@ yyreduce:
|
||||
#line 1503 "harbour.y"
|
||||
{
|
||||
hb_compLoopHere( HB_COMP_PARAM );
|
||||
hb_compGenJump( (yyvsp[(1) - (5)].sNumber) - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJump( (yyvsp[(1) - (5)].sNumber) - HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
;}
|
||||
break;
|
||||
|
||||
@@ -6383,7 +6383,7 @@ yyreduce:
|
||||
case 526:
|
||||
#line 1518 "harbour.y"
|
||||
{
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
++HB_COMP_PARAM->functions.pLast->wWhileCounter;
|
||||
hb_compLoopStart( HB_COMP_PARAM, HB_TRUE );
|
||||
@@ -6422,7 +6422,7 @@ yyreduce:
|
||||
case 532:
|
||||
#line 1553 "harbour.y"
|
||||
{ /* 11 */
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
;}
|
||||
break;
|
||||
|
||||
@@ -6463,7 +6463,7 @@ yyreduce:
|
||||
hb_compGenPCode1( HB_P_FORTEST, HB_COMP_PARAM );
|
||||
}
|
||||
|
||||
hb_compGenJumpFalse( (yyvsp[(11) - (12)].sNumber) - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJumpFalse( (yyvsp[(11) - (12)].sNumber) - HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
hb_compLoopEnd( HB_COMP_PARAM );
|
||||
if( hb_compExprAsSymbol( (yyvsp[(2) - (12)].asExpr) ) )
|
||||
hb_compForEnd( HB_COMP_PARAM, hb_compExprAsSymbol( (yyvsp[(2) - (12)].asExpr) ) );
|
||||
@@ -6544,7 +6544,7 @@ yyreduce:
|
||||
hb_compEnumStart( HB_COMP_PARAM, (yyvsp[(2) - (6)].asExpr), (yyvsp[(4) - (6)].asExpr), (yyvsp[(6) - (6)].iNumber) );
|
||||
|
||||
hb_compLoopStart( HB_COMP_PARAM, HB_TRUE );
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
;}
|
||||
break;
|
||||
|
||||
@@ -6561,7 +6561,7 @@ yyreduce:
|
||||
{
|
||||
hb_compLoopHere( HB_COMP_PARAM );
|
||||
hb_compEnumNext( HB_COMP_PARAM, (yyvsp[(2) - (10)].asExpr), (yyvsp[(6) - (10)].iNumber) );
|
||||
hb_compGenJump( (yyvsp[(7) - (10)].sNumber) - HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJump( (yyvsp[(7) - (10)].sNumber) - HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
|
||||
hb_compGenJumpHere( (yyvsp[(9) - (10)].sNumber), HB_COMP_PARAM );
|
||||
hb_compLoopEnd( HB_COMP_PARAM );
|
||||
@@ -6739,7 +6739,7 @@ yyreduce:
|
||||
{
|
||||
HB_COMP_EXPR_FREE( hb_compExprGenPush( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ) );
|
||||
hb_compGenPCode1( HB_P_SEQBLOCK, HB_COMP_PARAM );
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
;}
|
||||
break;
|
||||
|
||||
@@ -6752,7 +6752,7 @@ yyreduce:
|
||||
#line 1828 "harbour.y"
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->funFlags &= ~ ( FUN_WITH_RETURN | FUN_BREAK_CODE );
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
++HB_COMP_PARAM->functions.pLast->wAlwaysCounter;
|
||||
hb_compSequenceAlways( HB_COMP_PARAM );
|
||||
;}
|
||||
@@ -6767,7 +6767,7 @@ yyreduce:
|
||||
#line 1842 "harbour.y"
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->funFlags &= ~ FUN_BREAK_CODE;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
if( HB_COMP_PARAM->functions.pLast->wSeqCounter )
|
||||
--HB_COMP_PARAM->functions.pLast->wSeqCounter;
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
@@ -6779,7 +6779,7 @@ yyreduce:
|
||||
#line 1853 "harbour.y"
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->funFlags &= ~ FUN_BREAK_CODE;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
if( HB_COMP_PARAM->functions.pLast->wSeqCounter )
|
||||
--HB_COMP_PARAM->functions.pLast->wSeqCounter;
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
@@ -6849,7 +6849,7 @@ yyreduce:
|
||||
{
|
||||
hb_compLinePushIfInside( HB_COMP_PARAM );
|
||||
HB_COMP_EXPR_FREE( hb_compExprGenPush( (yyvsp[(2) - (3)].asExpr), HB_COMP_PARAM ) );
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
(yyval.sNumber) = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compGenPCode1( HB_P_WITHOBJECTSTART, HB_COMP_PARAM );
|
||||
HB_COMP_PARAM->functions.pLast->wWithObjectCnt++;
|
||||
;}
|
||||
@@ -7135,7 +7135,7 @@ static void hb_compLoopStart( HB_COMP_DECL, HB_BOOL fCanLoop )
|
||||
else
|
||||
pFunc->pLoops = pLoop;
|
||||
|
||||
pLoop->ulOffset = pFunc->lPCodePos; /* store the start position */
|
||||
pLoop->ulOffset = pFunc->nPCodePos; /* store the start position */
|
||||
pLoop->fCanLoop = fCanLoop; /* can we use LOOP inside */
|
||||
pLoop->wSeqCounter = pFunc->wSeqCounter; /* store current SEQUENCE counter */
|
||||
pLoop->wWithObjectCnt = pFunc->wWithObjectCnt; /* store current WITH OBJECT counter */
|
||||
@@ -7237,7 +7237,7 @@ static void hb_compLoopLoop( HB_COMP_DECL )
|
||||
wWithObjectCnt++;
|
||||
}
|
||||
/* store the position to fix */
|
||||
pLoop->ulOffset = pFunc->lPCodePos;
|
||||
pLoop->ulOffset = pFunc->nPCodePos;
|
||||
hb_compGenJump( 0, HB_COMP_PARAM );
|
||||
}
|
||||
}
|
||||
@@ -7293,7 +7293,7 @@ static void hb_compLoopExit( HB_COMP_DECL )
|
||||
wWithObjectCnt++;
|
||||
}
|
||||
/* store the position to fix */
|
||||
pLoop->ulOffset = pFunc->lPCodePos;
|
||||
pLoop->ulOffset = pFunc->nPCodePos;
|
||||
hb_compGenJump( 0, HB_COMP_PARAM );
|
||||
}
|
||||
}
|
||||
@@ -7722,7 +7722,7 @@ static void hb_compSwitchStart( HB_COMP_DECL, HB_EXPR_PTR pExpr )
|
||||
pSwitch->pCases = NULL;
|
||||
pSwitch->pLast = NULL;
|
||||
pSwitch->ulDefault = 0;
|
||||
pSwitch->ulOffset = pFunc->lPCodePos;
|
||||
pSwitch->ulOffset = pFunc->nPCodePos;
|
||||
pSwitch->pExpr = pExpr;
|
||||
pSwitch->pPrev = pFunc->pSwitch;
|
||||
pFunc->pSwitch = pSwitch;
|
||||
@@ -7739,7 +7739,7 @@ static void hb_compSwitchAdd( HB_COMP_DECL, HB_EXPR_PTR pExpr )
|
||||
{
|
||||
/* normal CASE */
|
||||
pCase = (HB_SWITCHCASE_PTR) hb_xgrab( sizeof( HB_SWITCHCASE ) );
|
||||
pCase->ulOffset = pFunc->lPCodePos;
|
||||
pCase->ulOffset = pFunc->nPCodePos;
|
||||
pCase->pNext = NULL;
|
||||
pExpr = hb_compExprReduce( pExpr, HB_COMP_PARAM );
|
||||
if( !( hb_compExprIsLong( pExpr ) || hb_compExprIsString( pExpr ) ) )
|
||||
@@ -7771,7 +7771,7 @@ static void hb_compSwitchAdd( HB_COMP_DECL, HB_EXPR_PTR pExpr )
|
||||
}
|
||||
else
|
||||
{
|
||||
pFunc->pSwitch->ulDefault = pFunc->lPCodePos;
|
||||
pFunc->pSwitch->ulDefault = pFunc->nPCodePos;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7832,7 +7832,7 @@ static void hb_compSwitchEnd( HB_COMP_DECL )
|
||||
HB_BOOL fMacroText = ( HB_COMP_PARAM->supported & HB_COMPFLAG_MACROTEXT ) != 0;
|
||||
|
||||
pExpr = hb_compExprGenPush( pExpr, HB_COMP_PARAM );
|
||||
ulCountPos = pFunc->lPCodePos + 1;
|
||||
ulCountPos = pFunc->nPCodePos + 1;
|
||||
hb_compGenPCode3( HB_P_SWITCH, 0, 0, HB_COMP_PARAM );
|
||||
HB_COMP_PARAM->fLongOptimize = HB_FALSE;
|
||||
HB_COMP_PARAM->supported &= ~HB_COMPFLAG_MACROTEXT;
|
||||
@@ -8021,4 +8021,3 @@ void yyerror( HB_COMP_DECL, const char * s )
|
||||
else
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E', HB_COMP_ERR_YACC, s, HB_COMP_PARAM->pLex->lasttok );
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ PHB_DEBUGINFO hb_compGetDebugInfo( HB_COMP_DECL )
|
||||
if( ( pFunc->funFlags & FUN_FILE_DECL ) == 0 )
|
||||
{
|
||||
nPos = ulLine = 0;
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
nSkip = 0;
|
||||
switch( pFunc->pCode[ nPos ] )
|
||||
|
||||
@@ -126,128 +126,128 @@ static void hb_compCodeTraceMark( PHB_CODETRACE_INFO pInfo, HB_SIZE nPCodePos, H
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_default )
|
||||
{
|
||||
HB_SIZE nSize = hb_compPCodeSize( pFunc, lPCodePos );
|
||||
HB_SIZE nSize = hb_compPCodeSize( pFunc, nPCodePos );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, nSize );
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + nSize );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, nSize );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + nSize );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumpnear )
|
||||
{
|
||||
HB_SIZE nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 2 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 2 );
|
||||
return hb_compCodeTraceNextPos( cargo, nNewPos );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jump )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 3 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 3 );
|
||||
return hb_compCodeTraceNextPos( cargo, nNewPos );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumpfar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
return hb_compCodeTraceNextPos( cargo, nNewPos );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumpfalsenear )
|
||||
{
|
||||
HB_SIZE nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 2 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 2 );
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 2 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 2 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumpfalse )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 3 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 3 );
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 3 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 3 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumpfalsefar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 4 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 4 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumptruenear )
|
||||
{
|
||||
HB_SIZE nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 2 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 2 );
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 2 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 2 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumptrue )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 3 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 3 );
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 3 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 3 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_jumptruefar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 4 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 4 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_seqalways )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
hb_compCodeTraceAddJump( cargo, nAlwaysPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 4 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 4 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_alwaysbegin )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysEndPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysEndPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
hb_compCodeTraceAddJump( cargo, nAlwaysEndPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 4 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 4 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_seqbegin )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nRecoverPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nRecoverPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
/* this is a hack for -gc3 output - it's not really necessary
|
||||
* for pure PCODE evaluation
|
||||
@@ -258,18 +258,18 @@ static HB_CODETRACE_FUNC( hb_p_seqbegin )
|
||||
hb_compCodeTraceAddJump( cargo, nRecoverPos - 4 );
|
||||
}
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
hb_compCodeTraceAddJump( cargo, nRecoverPos );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, lPCodePos + 4 );
|
||||
return hb_compCodeTraceNextPos( cargo, nPCodePos + 4 );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_seqend )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 4 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 4 );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, nNewPos );
|
||||
}
|
||||
@@ -277,81 +277,81 @@ static HB_CODETRACE_FUNC( hb_p_seqend )
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_switch )
|
||||
{
|
||||
HB_USHORT usCases = HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] ), us;
|
||||
HB_SIZE nStart = lPCodePos, nNewPos;
|
||||
HB_USHORT usCases = HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ), us;
|
||||
HB_SIZE nStart = nPCodePos, nNewPos;
|
||||
|
||||
lPCodePos += 3;
|
||||
nPCodePos += 3;
|
||||
for( us = 0; us < usCases; ++us )
|
||||
{
|
||||
switch( pFunc->pCode[ lPCodePos ] )
|
||||
switch( pFunc->pCode[ nPCodePos ] )
|
||||
{
|
||||
case HB_P_PUSHBYTE:
|
||||
lPCodePos += 2;
|
||||
nPCodePos += 2;
|
||||
break;
|
||||
case HB_P_PUSHINT:
|
||||
lPCodePos += 3;
|
||||
nPCodePos += 3;
|
||||
break;
|
||||
case HB_P_PUSHLONG:
|
||||
case HB_P_PUSHDATE:
|
||||
lPCodePos += 5;
|
||||
nPCodePos += 5;
|
||||
break;
|
||||
case HB_P_PUSHLONGLONG:
|
||||
lPCodePos += 9;
|
||||
nPCodePos += 9;
|
||||
break;
|
||||
case HB_P_PUSHSTRSHORT:
|
||||
lPCodePos += 2 + pFunc->pCode[ lPCodePos + 1 ];
|
||||
nPCodePos += 2 + pFunc->pCode[ nPCodePos + 1 ];
|
||||
break;
|
||||
case HB_P_PUSHSTR:
|
||||
lPCodePos += 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
nPCodePos += 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
break;
|
||||
case HB_P_PUSHSTRLARGE:
|
||||
lPCodePos += 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
nPCodePos += 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
break;
|
||||
case HB_P_PUSHNIL:
|
||||
/* default clause */
|
||||
us = usCases;
|
||||
lPCodePos++;
|
||||
nPCodePos++;
|
||||
break;
|
||||
}
|
||||
switch( pFunc->pCode[ lPCodePos ] )
|
||||
switch( pFunc->pCode[ nPCodePos ] )
|
||||
{
|
||||
case HB_P_JUMPNEAR:
|
||||
nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
lPCodePos += 2;
|
||||
nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
nPCodePos += 2;
|
||||
break;
|
||||
case HB_P_JUMP:
|
||||
nNewPos = lPCodePos + HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
lPCodePos += 3;
|
||||
nNewPos = nPCodePos + HB_PCODE_MKSHORT( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
nPCodePos += 3;
|
||||
break;
|
||||
/*case HB_P_JUMPFAR:*/
|
||||
default:
|
||||
nNewPos = lPCodePos + HB_PCODE_MKINT24( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
lPCodePos += 4;
|
||||
nNewPos = nPCodePos + HB_PCODE_MKINT24( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
nPCodePos += 4;
|
||||
break;
|
||||
}
|
||||
hb_compCodeTraceAddJump( cargo, nNewPos );
|
||||
}
|
||||
hb_compCodeTraceMark( cargo, nStart, lPCodePos - nStart );
|
||||
hb_compCodeTraceMark( cargo, nStart, nPCodePos - nStart );
|
||||
|
||||
return hb_compCodeTraceNextPos( cargo, us > usCases ?
|
||||
cargo->nPCodeSize : lPCodePos );
|
||||
cargo->nPCodeSize : nPCodePos );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_endblock )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pFunc );
|
||||
HB_SYMBOL_UNUSED( lPCodePos );
|
||||
HB_SYMBOL_UNUSED( nPCodePos );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 1 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 1 );
|
||||
return hb_compCodeTraceNextPos( cargo, cargo->nPCodeSize );
|
||||
}
|
||||
|
||||
static HB_CODETRACE_FUNC( hb_p_endproc )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pFunc );
|
||||
HB_SYMBOL_UNUSED( lPCodePos );
|
||||
HB_SYMBOL_UNUSED( nPCodePos );
|
||||
|
||||
hb_compCodeTraceMark( cargo, lPCodePos, 1 );
|
||||
hb_compCodeTraceMark( cargo, nPCodePos, 1 );
|
||||
return hb_compCodeTraceNextPos( cargo, cargo->nPCodeSize );
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ void hb_compCodeTraceMarkDead( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
const PHB_CODETRACE_FUNC * pFuncTable = s_codeTraceFuncTable;
|
||||
HB_CODETRACE_INFO code_info;
|
||||
|
||||
if( ! HB_COMP_ISSUPPORTED( HB_COMPFLAG_OPTJUMP ) || pFunc->lPCodePos < 2 )
|
||||
if( ! HB_COMP_ISSUPPORTED( HB_COMPFLAG_OPTJUMP ) || pFunc->nPCodePos < 2 )
|
||||
return;
|
||||
|
||||
assert( HB_P_LAST_PCODE == sizeof( s_codeTraceFuncTable ) / sizeof( PHB_CODETRACE_FUNC ) );
|
||||
@@ -560,7 +560,7 @@ void hb_compCodeTraceMarkDead( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
code_info.nJumpPos = 0;
|
||||
code_info.nJumpSize = 0;
|
||||
code_info.nJumpCount = 0;
|
||||
code_info.nPCodeSize = pFunc->lPCodePos;
|
||||
code_info.nPCodeSize = pFunc->nPCodePos;
|
||||
code_info.fFinished = HB_FALSE;
|
||||
|
||||
code_info.pCodeMark = ( HB_BYTE * ) hb_xgrab( code_info.nPCodeSize );
|
||||
@@ -605,7 +605,7 @@ void hb_compCodeTraceMarkDead( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
*/
|
||||
/*
|
||||
pFunc->pCode[ nPos - nCount ] = pFunc->pCode[ nPos - 1 ];
|
||||
pFunc->lPCodePos = pFunc->lPCodeSize = nPos - nCount + 1;
|
||||
pFunc->nPCodePos = pFunc->lPCodeSize = nPos - nCount + 1;
|
||||
*/
|
||||
hb_compNOOPfill( pFunc, nPos - nCount, nCount, HB_FALSE, HB_TRUE );
|
||||
}
|
||||
|
||||
@@ -66,13 +66,13 @@ typedef HB_FIX_FUNC_ * HB_FIX_FUNC_PTR;
|
||||
|
||||
static HB_FIX_FUNC( hb_p_pushblock )
|
||||
{
|
||||
HB_BYTE * pLocal = &pFunc->pCode[ lPCodePos + 7 ];
|
||||
HB_BYTE * pLocal = &pFunc->pCode[ nPCodePos + 7 ];
|
||||
HB_USHORT wVar;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
/* opcode + codeblock size + number of parameters + number of local variables */
|
||||
wVar = HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 5 ] );
|
||||
wVar = HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 5 ] );
|
||||
|
||||
/* fix local variable's reference */
|
||||
while( wVar-- )
|
||||
@@ -86,18 +86,18 @@ static HB_FIX_FUNC( hb_p_pushblock )
|
||||
/* only local variables used outside of a codeblock need fixing
|
||||
* skip the codeblock body
|
||||
*/
|
||||
return HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
return HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
}
|
||||
|
||||
static HB_FIX_FUNC( hb_p_pushblocklarge )
|
||||
{
|
||||
HB_BYTE * pLocal = &pFunc->pCode[ lPCodePos + 8 ];
|
||||
HB_BYTE * pLocal = &pFunc->pCode[ nPCodePos + 8 ];
|
||||
HB_USHORT wVar;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
/* opcode + codeblock size + number of parameters + number of local variables */
|
||||
wVar = HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 6 ] );
|
||||
wVar = HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 6 ] );
|
||||
|
||||
/* fix local variable's reference */
|
||||
while( wVar-- )
|
||||
@@ -111,12 +111,12 @@ static HB_FIX_FUNC( hb_p_pushblocklarge )
|
||||
/* only local variables used outside of a codeblock need fixing
|
||||
* skip the codeblock body
|
||||
*/
|
||||
return HB_PCODE_MKUINT24( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
return HB_PCODE_MKUINT24( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
}
|
||||
|
||||
static HB_FIX_FUNC( hb_p_localfix )
|
||||
{
|
||||
HB_BYTE * pVar = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pVar = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SHORT iVar = HB_PCODE_MKSHORT( pVar );
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
@@ -131,7 +131,7 @@ static HB_FIX_FUNC( hb_p_localfix )
|
||||
static HB_FIX_FUNC( hb_p_localnearerr )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pFunc );
|
||||
HB_SYMBOL_UNUSED( lPCodePos );
|
||||
HB_SYMBOL_UNUSED( nPCodePos );
|
||||
/*
|
||||
* this code should never be executed because compiler should
|
||||
* generate only non size optimized HB_P_POPLOCAL pcodes
|
||||
|
||||
@@ -62,7 +62,7 @@ typedef HB_LABEL_FUNC_ * PHB_LABEL_FUNC;
|
||||
*/
|
||||
static HB_LABEL_FUNC( hb_p_jumpnear )
|
||||
{
|
||||
HB_SIZE nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
return 2;
|
||||
@@ -70,8 +70,8 @@ static HB_LABEL_FUNC( hb_p_jumpnear )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jump )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
return 3;
|
||||
@@ -79,8 +79,8 @@ static HB_LABEL_FUNC( hb_p_jump )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumpfar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
return 4;
|
||||
@@ -88,7 +88,7 @@ static HB_LABEL_FUNC( hb_p_jumpfar )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumpfalsenear )
|
||||
{
|
||||
HB_SIZE nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
|
||||
cargo->fCondJump = HB_TRUE;
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -97,8 +97,8 @@ static HB_LABEL_FUNC( hb_p_jumpfalsenear )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumpfalse )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
|
||||
cargo->fCondJump = HB_TRUE;
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -107,8 +107,8 @@ static HB_LABEL_FUNC( hb_p_jumpfalse )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumpfalsefar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
cargo->fCondJump = HB_TRUE;
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -117,7 +117,7 @@ static HB_LABEL_FUNC( hb_p_jumpfalsefar )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumptruenear )
|
||||
{
|
||||
HB_SIZE nNewPos = lPCodePos + ( signed char ) pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ];
|
||||
|
||||
cargo->fCondJump = HB_TRUE;
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -126,8 +126,8 @@ static HB_LABEL_FUNC( hb_p_jumptruenear )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumptrue )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr );
|
||||
|
||||
cargo->fCondJump = HB_TRUE;
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -136,8 +136,8 @@ static HB_LABEL_FUNC( hb_p_jumptrue )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_jumptruefar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
cargo->fCondJump = HB_TRUE;
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -146,8 +146,8 @@ static HB_LABEL_FUNC( hb_p_jumptruefar )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_seqalways )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
if( cargo->fSetSeqBegin )
|
||||
cargo->pulLabels[ nAlwaysPos ]++;
|
||||
@@ -156,8 +156,8 @@ static HB_LABEL_FUNC( hb_p_seqalways )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_alwaysbegin )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysEndPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nAlwaysEndPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
if( cargo->fSetSeqBegin )
|
||||
cargo->pulLabels[ nAlwaysEndPos ]++;
|
||||
@@ -166,8 +166,8 @@ static HB_LABEL_FUNC( hb_p_alwaysbegin )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_seqbegin )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_SIZE nRecoverPos = lPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SIZE nRecoverPos = nPCodePos + HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
if( cargo->fSetSeqBegin )
|
||||
cargo->pulLabels[ nRecoverPos ]++;
|
||||
@@ -176,9 +176,9 @@ static HB_LABEL_FUNC( hb_p_seqbegin )
|
||||
|
||||
static HB_LABEL_FUNC( hb_p_seqend )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_ISIZ nOffset = HB_PCODE_MKINT24( pAddr );
|
||||
HB_SIZE nNewPos = lPCodePos + nOffset;
|
||||
HB_SIZE nNewPos = nPCodePos + nOffset;
|
||||
|
||||
if( cargo->fSetSeqBegin || nOffset != 4 )
|
||||
cargo->pulLabels[ nNewPos ]++;
|
||||
@@ -385,7 +385,7 @@ void hb_compGenLabelTable( PFUNCTION pFunc, PHB_LABEL_INFO label_info )
|
||||
|
||||
hb_compPCodeEval( pFunc, ( HB_PCODE_FUNC_PTR * ) pFuncTable, ( void * ) label_info );
|
||||
|
||||
for( n = 0; n < pFunc->lPCodePos; ++n )
|
||||
for( n = 0; n < pFunc->nPCodePos; ++n )
|
||||
{
|
||||
if( label_info->pulLabels[ n ] )
|
||||
{
|
||||
|
||||
@@ -1545,11 +1545,11 @@ static void hb_compOptimizeJumps( HB_COMP_DECL )
|
||||
nNextByte++;
|
||||
}
|
||||
|
||||
nBytes2Copy = ( HB_COMP_PARAM->functions.pLast->lPCodePos - nNextByte ) ;
|
||||
nBytes2Copy = ( HB_COMP_PARAM->functions.pLast->nPCodePos - nNextByte ) ;
|
||||
memmove( pCode + nOptimized, pCode + nNextByte, nBytes2Copy );
|
||||
nOptimized += nBytes2Copy;
|
||||
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos = nOptimized;
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos = nOptimized;
|
||||
HB_COMP_PARAM->functions.pLast->lPCodeSize = nOptimized;
|
||||
|
||||
hb_xfree( HB_COMP_PARAM->functions.pLast->pNOOPs );
|
||||
@@ -1590,8 +1590,8 @@ static void hb_compOptimizeFrames( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
/* if( !( pFunc->funFlags & FUN_USES_STATICS ) ) */
|
||||
if( pFunc->pCode[ 8 ] == HB_P_ENDPROC )
|
||||
{
|
||||
pFunc->lPCodePos -= 3;
|
||||
memmove( pFunc->pCode + 5, pFunc->pCode + 8, pFunc->lPCodePos - 5 );
|
||||
pFunc->nPCodePos -= 3;
|
||||
memmove( pFunc->pCode + 5, pFunc->pCode + 8, pFunc->nPCodePos - 5 );
|
||||
}
|
||||
else /* Check Global Statics. */
|
||||
{
|
||||
@@ -1653,7 +1653,7 @@ static void hb_compOptimizeFrames( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
* make a room for HB_P_LARGE[V]FRAME
|
||||
*/
|
||||
hb_compGenPCode1( 0, HB_COMP_PARAM );
|
||||
memmove( pFunc->pCode + 4, pFunc->pCode + 3, pFunc->lPCodePos - 4 );
|
||||
memmove( pFunc->pCode + 4, pFunc->pCode + 3, pFunc->nPCodePos - 4 );
|
||||
pFunc->pCode[ 0 ] = HB_P_LARGEFRAME;
|
||||
pFunc->pCode[ 1 ] = HB_LOBYTE( iLocals );
|
||||
pFunc->pCode[ 2 ] = HB_HIBYTE( iLocals );
|
||||
@@ -1678,13 +1678,13 @@ static void hb_compOptimizeFrames( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
{
|
||||
if( bSkipSFRAME )
|
||||
{
|
||||
pFunc->lPCodePos -= 6;
|
||||
memmove( pFunc->pCode, pFunc->pCode + 6, pFunc->lPCodePos );
|
||||
pFunc->nPCodePos -= 6;
|
||||
memmove( pFunc->pCode, pFunc->pCode + 6, pFunc->nPCodePos );
|
||||
}
|
||||
else
|
||||
{
|
||||
pFunc->lPCodePos -= 3;
|
||||
memmove( pFunc->pCode, pFunc->pCode + 3, pFunc->lPCodePos );
|
||||
pFunc->nPCodePos -= 3;
|
||||
memmove( pFunc->pCode, pFunc->pCode + 3, pFunc->nPCodePos );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1694,9 +1694,9 @@ static void hb_compOptimizeFrames( HB_COMP_DECL, PFUNCTION pFunc )
|
||||
|
||||
if( bSkipSFRAME )
|
||||
{
|
||||
pFunc->lPCodePos -= 3;
|
||||
pFunc->nPCodePos -= 3;
|
||||
memmove( pFunc->pCode + 3 + iOffset, pFunc->pCode + 6 + iOffset,
|
||||
pFunc->lPCodePos - 3 - iOffset );
|
||||
pFunc->nPCodePos - 3 - iOffset );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2250,7 +2250,7 @@ static void hb_compPrepareJumps( HB_COMP_DECL )
|
||||
pFunc->pJumps = ( HB_SIZE * ) hb_xrealloc( pFunc->pJumps, sizeof( HB_SIZE ) * ( pFunc->iJumps + 1 ) );
|
||||
else
|
||||
pFunc->pJumps = ( HB_SIZE * ) hb_xgrab( sizeof( HB_SIZE ) );
|
||||
pFunc->pJumps[ pFunc->iJumps++ ] = ( HB_SIZE ) ( pFunc->lPCodePos - 4 );
|
||||
pFunc->pJumps[ pFunc->iJumps++ ] = ( HB_SIZE ) ( pFunc->nPCodePos - 4 );
|
||||
}
|
||||
|
||||
HB_SIZE hb_compGenJump( HB_ISIZ nOffset, HB_COMP_DECL )
|
||||
@@ -2261,7 +2261,7 @@ HB_SIZE hb_compGenJump( HB_ISIZ nOffset, HB_COMP_DECL )
|
||||
hb_compGenPCode4( HB_P_JUMPFAR, HB_LOBYTE( nOffset ), HB_HIBYTE( nOffset ), ( HB_BYTE ) ( ( nOffset >> 16 ) & 0xFF ), HB_COMP_PARAM );
|
||||
hb_compPrepareJumps( HB_COMP_PARAM );
|
||||
|
||||
return HB_COMP_PARAM->functions.pLast->lPCodePos - 3;
|
||||
return HB_COMP_PARAM->functions.pLast->nPCodePos - 3;
|
||||
}
|
||||
|
||||
HB_SIZE hb_compGenJumpFalse( HB_ISIZ nOffset, HB_COMP_DECL )
|
||||
@@ -2272,7 +2272,7 @@ HB_SIZE hb_compGenJumpFalse( HB_ISIZ nOffset, HB_COMP_DECL )
|
||||
hb_compGenPCode4( HB_P_JUMPFALSEFAR, HB_LOBYTE( nOffset ), HB_HIBYTE( nOffset ), ( HB_BYTE ) ( ( nOffset >> 16 ) & 0xFF ), HB_COMP_PARAM );
|
||||
hb_compPrepareJumps( HB_COMP_PARAM );
|
||||
|
||||
return HB_COMP_PARAM->functions.pLast->lPCodePos - 3;
|
||||
return HB_COMP_PARAM->functions.pLast->nPCodePos - 3;
|
||||
}
|
||||
|
||||
HB_SIZE hb_compGenJumpTrue( HB_ISIZ nOffset, HB_COMP_DECL )
|
||||
@@ -2283,7 +2283,7 @@ HB_SIZE hb_compGenJumpTrue( HB_ISIZ nOffset, HB_COMP_DECL )
|
||||
hb_compGenPCode4( HB_P_JUMPTRUEFAR, HB_LOBYTE( nOffset ), HB_HIBYTE( nOffset ), ( HB_BYTE ) ( ( nOffset >> 16 ) & 0xFF ), HB_COMP_PARAM );
|
||||
hb_compPrepareJumps( HB_COMP_PARAM );
|
||||
|
||||
return HB_COMP_PARAM->functions.pLast->lPCodePos - 3;
|
||||
return HB_COMP_PARAM->functions.pLast->nPCodePos - 3;
|
||||
}
|
||||
|
||||
void hb_compGenJumpThere( HB_SIZE nFrom, HB_SIZE nTo, HB_COMP_DECL )
|
||||
@@ -2301,7 +2301,7 @@ void hb_compGenJumpThere( HB_SIZE nFrom, HB_SIZE nTo, HB_COMP_DECL )
|
||||
|
||||
void hb_compGenJumpHere( HB_SIZE nOffset, HB_COMP_DECL )
|
||||
{
|
||||
hb_compGenJumpThere( nOffset, HB_COMP_PARAM->functions.pLast->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenJumpThere( nOffset, HB_COMP_PARAM->functions.pLast->nPCodePos, HB_COMP_PARAM );
|
||||
}
|
||||
|
||||
void hb_compLinePush( HB_COMP_DECL ) /* generates the pcode with the currently compiled source code line */
|
||||
@@ -2311,14 +2311,14 @@ void hb_compLinePush( HB_COMP_DECL ) /* generates the pcode with the currently c
|
||||
if( HB_COMP_PARAM->fDebugInfo && HB_COMP_PARAM->lastModule != HB_COMP_PARAM->currModule )
|
||||
{
|
||||
if( HB_COMP_PARAM->functions.pLast->pCode[ HB_COMP_PARAM->lastLinePos ] == HB_P_LINE &&
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos - HB_COMP_PARAM->lastLinePos == 3 )
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos -= 3;
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos - HB_COMP_PARAM->lastLinePos == 3 )
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos -= 3;
|
||||
hb_compGenModuleName( HB_COMP_PARAM, NULL );
|
||||
}
|
||||
|
||||
if( HB_COMP_PARAM->currLine != HB_COMP_PARAM->lastLine )
|
||||
{
|
||||
if( HB_COMP_PARAM->functions.pLast->lPCodePos - HB_COMP_PARAM->lastLinePos == 3 &&
|
||||
if( HB_COMP_PARAM->functions.pLast->nPCodePos - HB_COMP_PARAM->lastLinePos == 3 &&
|
||||
HB_COMP_PARAM->functions.pLast->pCode[ HB_COMP_PARAM->lastLinePos ] == HB_P_LINE )
|
||||
{
|
||||
HB_COMP_PARAM->functions.pLast->pCode[ HB_COMP_PARAM->lastLinePos + 1 ] = HB_LOBYTE( HB_COMP_PARAM->currLine );
|
||||
@@ -2326,7 +2326,7 @@ void hb_compLinePush( HB_COMP_DECL ) /* generates the pcode with the currently c
|
||||
}
|
||||
else
|
||||
{
|
||||
HB_COMP_PARAM->lastLinePos = HB_COMP_PARAM->functions.pLast->lPCodePos;
|
||||
HB_COMP_PARAM->lastLinePos = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
hb_compGenPCode3( HB_P_LINE, HB_LOBYTE( HB_COMP_PARAM->currLine ),
|
||||
HB_HIBYTE( HB_COMP_PARAM->currLine ), HB_COMP_PARAM );
|
||||
}
|
||||
@@ -3093,8 +3093,8 @@ static void hb_compRemovePCODE( HB_COMP_DECL, HB_SIZE nPos, HB_SIZE nCount,
|
||||
else
|
||||
{
|
||||
memmove( pFunc->pCode + nPos, pFunc->pCode + nPos + nCount,
|
||||
pFunc->lPCodePos - nPos - nCount );
|
||||
pFunc->lPCodePos -= nCount;
|
||||
pFunc->nPCodePos - nPos - nCount );
|
||||
pFunc->nPCodePos -= nCount;
|
||||
|
||||
for( n = pFunc->iNOOPs; n; --n )
|
||||
{
|
||||
@@ -3168,7 +3168,7 @@ HB_SIZE hb_compSequenceBegin( HB_COMP_DECL )
|
||||
hb_compGenPCode4( HB_P_SEQBEGIN, 0, 0, 0, HB_COMP_PARAM );
|
||||
hb_compPrepareJumps( HB_COMP_PARAM );
|
||||
|
||||
return HB_COMP_PARAM->functions.pLast->lPCodePos - 3;
|
||||
return HB_COMP_PARAM->functions.pLast->nPCodePos - 3;
|
||||
}
|
||||
|
||||
/* Generate the opcode to close BEGIN/END sequence
|
||||
@@ -3184,7 +3184,7 @@ HB_SIZE hb_compSequenceEnd( HB_COMP_DECL )
|
||||
|
||||
hb_compPrepareJumps( HB_COMP_PARAM );
|
||||
|
||||
return HB_COMP_PARAM->functions.pLast->lPCodePos - 3;
|
||||
return HB_COMP_PARAM->functions.pLast->nPCodePos - 3;
|
||||
}
|
||||
|
||||
HB_SIZE hb_compSequenceAlways( HB_COMP_DECL )
|
||||
@@ -3193,7 +3193,7 @@ HB_SIZE hb_compSequenceAlways( HB_COMP_DECL )
|
||||
|
||||
hb_compPrepareJumps( HB_COMP_PARAM );
|
||||
|
||||
return HB_COMP_PARAM->functions.pLast->lPCodePos - 3;
|
||||
return HB_COMP_PARAM->functions.pLast->nPCodePos - 3;
|
||||
}
|
||||
|
||||
/* Remove unnecessary opcodes in case there were no executable statements
|
||||
@@ -3211,7 +3211,7 @@ void hb_compSequenceFinish( HB_COMP_DECL, HB_SIZE nStartPos, HB_SIZE nEndPos,
|
||||
if( nAlways )
|
||||
{
|
||||
/* remove HB_P_ALWAYSEND opcode */
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos--;
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos--;
|
||||
/* remove HB_P_SEQALWAYS ... HB_P_ALWAYSBEGIN opcodes */
|
||||
hb_compRemovePCODE( HB_COMP_PARAM, nStartPos,
|
||||
nAlways - nStartPos + 4, fCanMove );
|
||||
@@ -3219,7 +3219,7 @@ void hb_compSequenceFinish( HB_COMP_DECL, HB_SIZE nStartPos, HB_SIZE nEndPos,
|
||||
else
|
||||
{
|
||||
hb_compRemovePCODE( HB_COMP_PARAM, nStartPos,
|
||||
HB_COMP_PARAM->functions.pLast->lPCodePos -
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos -
|
||||
nStartPos, fCanMove );
|
||||
}
|
||||
HB_COMP_PARAM->lastLinePos = nStartPos - 3;
|
||||
@@ -3244,7 +3244,7 @@ void hb_compSequenceFinish( HB_COMP_DECL, HB_SIZE nStartPos, HB_SIZE nEndPos,
|
||||
}
|
||||
}
|
||||
/* empty always block? */
|
||||
if( HB_COMP_PARAM->functions.pLast->lPCodePos - nAlways == 5 &&
|
||||
if( HB_COMP_PARAM->functions.pLast->nPCodePos - nAlways == 5 &&
|
||||
!HB_COMP_PARAM->fDebugInfo )
|
||||
{
|
||||
/* remove HB_P_ALWAYSBEGIN and HB_P_ALWAYSEND opcodes */
|
||||
@@ -3519,7 +3519,7 @@ void hb_compCodeBlockEnd( HB_COMP_DECL )
|
||||
}
|
||||
wLocalsCnt = wLocals;
|
||||
|
||||
nSize = pCodeblock->lPCodePos + 2;
|
||||
nSize = pCodeblock->nPCodePos + 2;
|
||||
if( HB_COMP_PARAM->fDebugInfo )
|
||||
{
|
||||
nSize += 3 + strlen( HB_COMP_PARAM->currModule ) + strlen( pFuncName );
|
||||
@@ -3577,7 +3577,7 @@ void hb_compCodeBlockEnd( HB_COMP_DECL )
|
||||
|
||||
}
|
||||
|
||||
hb_compGenPCodeN( pCodeblock->pCode, pCodeblock->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenPCodeN( pCodeblock->pCode, pCodeblock->nPCodePos, HB_COMP_PARAM );
|
||||
|
||||
if( HB_COMP_PARAM->iWarnings )
|
||||
{
|
||||
@@ -3631,7 +3631,7 @@ void hb_compCodeBlockStop( HB_COMP_DECL )
|
||||
* codeblock was defined
|
||||
*/
|
||||
HB_COMP_PARAM->functions.pLast = pCodeblock->pOwner;
|
||||
hb_compGenPCodeN( pCodeblock->pCode, pCodeblock->lPCodePos, HB_COMP_PARAM );
|
||||
hb_compGenPCodeN( pCodeblock->pCode, pCodeblock->nPCodePos, HB_COMP_PARAM );
|
||||
|
||||
if( HB_COMP_PARAM->iWarnings )
|
||||
{
|
||||
@@ -3656,7 +3656,7 @@ void hb_compCodeBlockRewind( HB_COMP_DECL )
|
||||
PFUNCTION pCodeblock; /* pointer to the current codeblock */
|
||||
|
||||
pCodeblock = HB_COMP_PARAM->functions.pLast;
|
||||
pCodeblock->lPCodePos = 0;
|
||||
pCodeblock->nPCodePos = 0;
|
||||
|
||||
/* Release the NOOP array. */
|
||||
if( pCodeblock->pNOOPs )
|
||||
|
||||
@@ -61,15 +61,15 @@ typedef HB_OPT_FUNC_ * HB_OPT_FUNC_PTR;
|
||||
|
||||
static HB_OPT_FUNC( hb_p_poplocal )
|
||||
{
|
||||
HB_BYTE * pVar = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pVar = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SHORT iVar = HB_PCODE_MKSHORT( pVar );
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( HB_LIM_INT8( iVar ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_POPLOCALNEAR;
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 2, 1, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_POPLOCALNEAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 2, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 3;
|
||||
@@ -77,32 +77,32 @@ static HB_OPT_FUNC( hb_p_poplocal )
|
||||
|
||||
static HB_OPT_FUNC( hb_p_pushlocal )
|
||||
{
|
||||
HB_BYTE * pVar = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pVar = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SHORT iVar = HB_PCODE_MKSHORT( pVar );
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POPLOCAL &&
|
||||
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 4 ] ) == iVar &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POPLOCAL &&
|
||||
HB_PCODE_MKSHORT( &pFunc->pCode[ nPCodePos + 4 ] ) == iVar &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 6, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 6, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POPLOCALNEAR &&
|
||||
( HB_SCHAR ) pFunc->pCode[ lPCodePos + 4 ] == iVar &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
else if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POPLOCALNEAR &&
|
||||
( HB_SCHAR ) pFunc->pCode[ nPCodePos + 4 ] == iVar &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 5, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 5, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
else if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( HB_LIM_INT8( iVar ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_PUSHLOCALNEAR;
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 2, 1, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_PUSHLOCALNEAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 2, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 3;
|
||||
@@ -112,23 +112,23 @@ static HB_OPT_FUNC( hb_p_pushlocalnear )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 2 ] == HB_P_POPLOCAL &&
|
||||
( HB_SCHAR ) pFunc->pCode[ lPCodePos + 1 ] ==
|
||||
HB_PCODE_MKSHORT( &pFunc->pCode[ lPCodePos + 3 ] ) &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 2 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 2 ] == HB_P_POPLOCAL &&
|
||||
( HB_SCHAR ) pFunc->pCode[ nPCodePos + 1 ] ==
|
||||
HB_PCODE_MKSHORT( &pFunc->pCode[ nPCodePos + 3 ] ) &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 2 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 5, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 5, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( pFunc->pCode[ lPCodePos + 2 ] == HB_P_POPLOCALNEAR &&
|
||||
pFunc->pCode[ lPCodePos + 1 ] == pFunc->pCode[ lPCodePos + 3 ] &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 2 ) )
|
||||
else if( pFunc->pCode[ nPCodePos + 2 ] == HB_P_POPLOCALNEAR &&
|
||||
pFunc->pCode[ nPCodePos + 1 ] == pFunc->pCode[ nPCodePos + 3 ] &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 2 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( pFunc->pCode[ lPCodePos + 2 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 2 ) )
|
||||
else if( pFunc->pCode[ nPCodePos + 2 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 2 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 3, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 3, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 2;
|
||||
@@ -136,7 +136,7 @@ static HB_OPT_FUNC( hb_p_pushlocalnear )
|
||||
|
||||
static HB_OPT_FUNC( hb_p_localaddint )
|
||||
{
|
||||
HB_BYTE * pVar = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pVar = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_SHORT iVar = HB_PCODE_MKSHORT( pVar );
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
@@ -145,7 +145,7 @@ static HB_OPT_FUNC( hb_p_localaddint )
|
||||
{
|
||||
pVar[ 0 ] = HB_P_LOCALNEARADDINT;
|
||||
pVar[ 1 ] = HB_LOBYTE( iVar );
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 5;
|
||||
@@ -155,17 +155,17 @@ static HB_OPT_FUNC( hb_p_pushstatic )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POPSTATIC &&
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] ) ==
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 4 ] ) &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POPSTATIC &&
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ) ==
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 4 ] ) &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 6, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 6, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
else if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 3;
|
||||
@@ -175,17 +175,17 @@ static HB_OPT_FUNC( hb_p_pushmemvar )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POPMEMVAR &&
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] ) ==
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 4 ] ) &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POPMEMVAR &&
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ) ==
|
||||
HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 4 ] ) &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 6, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 6, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
else if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 3;
|
||||
@@ -195,10 +195,10 @@ static HB_OPT_FUNC( hb_p_pushnil )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 1 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 1 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 1 ] == HB_P_POP &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 1 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 2, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 2, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -208,7 +208,7 @@ static HB_OPT_FUNC( hb_p_false )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
switch( pFunc->pCode[ lPCodePos + 1 ] )
|
||||
switch( pFunc->pCode[ nPCodePos + 1 ] )
|
||||
{
|
||||
case HB_P_POP:
|
||||
case HB_P_NOT:
|
||||
@@ -218,23 +218,23 @@ static HB_OPT_FUNC( hb_p_false )
|
||||
case HB_P_JUMPTRUENEAR:
|
||||
case HB_P_JUMPTRUE:
|
||||
case HB_P_JUMPTRUEFAR:
|
||||
if( ! hb_compHasJump( pFunc, lPCodePos + 1 ) )
|
||||
if( ! hb_compHasJump( pFunc, nPCodePos + 1 ) )
|
||||
{
|
||||
int iCount = 1;
|
||||
|
||||
switch( pFunc->pCode[ lPCodePos + 1 ] )
|
||||
switch( pFunc->pCode[ nPCodePos + 1 ] )
|
||||
{
|
||||
case HB_P_JUMPFALSENEAR:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_JUMPNEAR;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_JUMPNEAR;
|
||||
break;
|
||||
case HB_P_JUMPFALSE:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_JUMP;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_JUMP;
|
||||
break;
|
||||
case HB_P_JUMPFALSEFAR:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_JUMPFAR;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_JUMPFAR;
|
||||
break;
|
||||
case HB_P_NOT:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_TRUE;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_TRUE;
|
||||
break;
|
||||
case HB_P_POP:
|
||||
iCount = 2;
|
||||
@@ -249,7 +249,7 @@ static HB_OPT_FUNC( hb_p_false )
|
||||
iCount = 5;
|
||||
break;
|
||||
}
|
||||
hb_compNOOPfill( pFunc, lPCodePos, iCount, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, iCount, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ static HB_OPT_FUNC( hb_p_true )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
switch( pFunc->pCode[ lPCodePos + 1 ] )
|
||||
switch( pFunc->pCode[ nPCodePos + 1 ] )
|
||||
{
|
||||
case HB_P_POP:
|
||||
case HB_P_NOT:
|
||||
@@ -270,23 +270,23 @@ static HB_OPT_FUNC( hb_p_true )
|
||||
case HB_P_JUMPFALSENEAR:
|
||||
case HB_P_JUMPFALSE:
|
||||
case HB_P_JUMPFALSEFAR:
|
||||
if( ! hb_compHasJump( pFunc, lPCodePos + 1 ) )
|
||||
if( ! hb_compHasJump( pFunc, nPCodePos + 1 ) )
|
||||
{
|
||||
int iCount = 1;
|
||||
|
||||
switch( pFunc->pCode[ lPCodePos + 1 ] )
|
||||
switch( pFunc->pCode[ nPCodePos + 1 ] )
|
||||
{
|
||||
case HB_P_JUMPTRUENEAR:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_JUMPNEAR;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_JUMPNEAR;
|
||||
break;
|
||||
case HB_P_JUMPTRUE:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_JUMP;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_JUMP;
|
||||
break;
|
||||
case HB_P_JUMPTRUEFAR:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_JUMPFAR;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_JUMPFAR;
|
||||
break;
|
||||
case HB_P_NOT:
|
||||
pFunc->pCode[ lPCodePos + 1 ] = HB_P_FALSE;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = HB_P_FALSE;
|
||||
break;
|
||||
case HB_P_POP:
|
||||
iCount = 2;
|
||||
@@ -301,7 +301,7 @@ static HB_OPT_FUNC( hb_p_true )
|
||||
iCount = 5;
|
||||
break;
|
||||
}
|
||||
hb_compNOOPfill( pFunc, lPCodePos, iCount, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, iCount, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -312,15 +312,15 @@ static HB_OPT_FUNC( hb_p_duplicate )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
switch( pFunc->pCode[ lPCodePos + 1 ] )
|
||||
switch( pFunc->pCode[ nPCodePos + 1 ] )
|
||||
{
|
||||
case HB_P_JUMPTRUEFAR:
|
||||
case HB_P_JUMPFALSEFAR:
|
||||
if( pFunc->pCode[ lPCodePos + 5 ] == HB_P_POP )
|
||||
if( pFunc->pCode[ nPCodePos + 5 ] == HB_P_POP )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 2 ];
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 2 ];
|
||||
HB_ISIZ nOffset = HB_PCODE_MKINT24( pAddr ), nLastOffset = 0;
|
||||
HB_SIZE nNewPos = lPCodePos + 1 + nOffset;
|
||||
HB_SIZE nNewPos = nPCodePos + 1 + nOffset;
|
||||
HB_BOOL fNot = HB_FALSE, fOK = HB_TRUE, fRepeat = HB_TRUE;
|
||||
|
||||
do
|
||||
@@ -348,11 +348,11 @@ static HB_OPT_FUNC( hb_p_duplicate )
|
||||
pFunc->pCode[ nNewPos + 1 ] == HB_P_JUMPFALSEFAR ) )
|
||||
{
|
||||
HB_ISIZ nJump;
|
||||
if( pFunc->pCode[ nNewPos + 1 ] != pFunc->pCode[ lPCodePos + 1 ] )
|
||||
if( pFunc->pCode[ nNewPos + 1 ] != pFunc->pCode[ nPCodePos + 1 ] )
|
||||
fNot = !fNot;
|
||||
nJump = fNot ? 4 : HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 2 ] );
|
||||
nOffset += nJump + 1;
|
||||
nNewPos = lPCodePos + 1 + nOffset;
|
||||
nNewPos = nPCodePos + 1 + nOffset;
|
||||
fRepeat = nJump > 0;
|
||||
}
|
||||
else
|
||||
@@ -369,10 +369,10 @@ static HB_OPT_FUNC( hb_p_duplicate )
|
||||
|
||||
if( ( pFunc->pCode[ nNewPos ] == HB_P_JUMPTRUEFAR ||
|
||||
pFunc->pCode[ nNewPos ] == HB_P_JUMPFALSEFAR ) &&
|
||||
!hb_compHasJump( pFunc, lPCodePos + 1 ) &&
|
||||
!hb_compHasJump( pFunc, lPCodePos + 5 ) )
|
||||
!hb_compHasJump( pFunc, nPCodePos + 1 ) &&
|
||||
!hb_compHasJump( pFunc, nPCodePos + 5 ) )
|
||||
{
|
||||
if( pFunc->pCode[ nNewPos ] != pFunc->pCode[ lPCodePos + 1 ] )
|
||||
if( pFunc->pCode[ nNewPos ] != pFunc->pCode[ nPCodePos + 1 ] )
|
||||
fNot = !fNot;
|
||||
if( fNot )
|
||||
nOffset += 4;
|
||||
@@ -380,8 +380,8 @@ static HB_OPT_FUNC( hb_p_duplicate )
|
||||
nOffset += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] );
|
||||
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset );
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 5, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 5, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else if( nLastOffset )
|
||||
{
|
||||
@@ -399,7 +399,7 @@ static HB_OPT_FUNC( hb_p_not )
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
switch( pFunc->pCode[ lPCodePos + 1 ] )
|
||||
switch( pFunc->pCode[ nPCodePos + 1 ] )
|
||||
{
|
||||
case HB_P_NOT:
|
||||
opcode = HB_P_NOOP;
|
||||
@@ -425,30 +425,30 @@ static HB_OPT_FUNC( hb_p_not )
|
||||
/* This optimization will be enabled in the future in a little bit differ form */
|
||||
#if 0
|
||||
case HB_P_DUPLICATE:
|
||||
if( ( pFunc->pCode[ lPCodePos + 2 ] == HB_P_JUMPTRUEFAR ||
|
||||
pFunc->pCode[ lPCodePos + 2 ] == HB_P_JUMPFALSEFAR ) &&
|
||||
pFunc->pCode[ lPCodePos + 6 ] == HB_P_POP )
|
||||
if( ( pFunc->pCode[ nPCodePos + 2 ] == HB_P_JUMPTRUEFAR ||
|
||||
pFunc->pCode[ nPCodePos + 2 ] == HB_P_JUMPFALSEFAR ) &&
|
||||
pFunc->pCode[ nPCodePos + 6 ] == HB_P_POP )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 3 ];
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 3 ];
|
||||
HB_ISIZ nOffset = HB_PCODE_MKINT24( pAddr );
|
||||
|
||||
if( nOffset > 0 )
|
||||
{
|
||||
hb_p_duplicate( pFunc, lPCodePos + 1, NULL );
|
||||
hb_p_duplicate( pFunc, nPCodePos + 1, NULL );
|
||||
nOffset = HB_PCODE_MKINT24( pAddr );
|
||||
}
|
||||
|
||||
if( ( pFunc->pCode[ lPCodePos + 1 ] == HB_P_NOT ||
|
||||
( pFunc->pCode[ lPCodePos + 1 ] == HB_P_DUPLICATE &&
|
||||
pFunc->pCode[ lPCodePos + nOffset + 2 ] == HB_P_NOT ) ) &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 1 ) )
|
||||
if( ( pFunc->pCode[ nPCodePos + 1 ] == HB_P_NOT ||
|
||||
( pFunc->pCode[ nPCodePos + 1 ] == HB_P_DUPLICATE &&
|
||||
pFunc->pCode[ nPCodePos + nOffset + 2 ] == HB_P_NOT ) ) &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 1 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
if( pFunc->pCode[ lPCodePos + 2 ] == HB_P_JUMPTRUEFAR )
|
||||
pFunc->pCode[ lPCodePos + 2 ] = HB_P_JUMPFALSEFAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
if( pFunc->pCode[ nPCodePos + 2 ] == HB_P_JUMPTRUEFAR )
|
||||
pFunc->pCode[ nPCodePos + 2 ] = HB_P_JUMPFALSEFAR;
|
||||
else
|
||||
pFunc->pCode[ lPCodePos + 2 ] = HB_P_JUMPTRUEFAR;
|
||||
if( pFunc->pCode[ lPCodePos + 1 ] == HB_P_DUPLICATE )
|
||||
pFunc->pCode[ nPCodePos + 2 ] = HB_P_JUMPTRUEFAR;
|
||||
if( pFunc->pCode[ nPCodePos + 1 ] == HB_P_DUPLICATE )
|
||||
{
|
||||
++nOffset;
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset );
|
||||
@@ -463,29 +463,29 @@ static HB_OPT_FUNC( hb_p_not )
|
||||
}
|
||||
|
||||
if( opcode < HB_P_LAST_PCODE &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 1 ) )
|
||||
! hb_compHasJump( pFunc, nPCodePos + 1 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
if( opcode == HB_P_NOOP )
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 1, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 1, 1, HB_FALSE, HB_FALSE );
|
||||
else
|
||||
pFunc->pCode[ lPCodePos + 1 ] = opcode;
|
||||
pFunc->pCode[ nPCodePos + 1 ] = opcode;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static HB_OPT_FUNC( hb_p_jumpfar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_ISIZ nOffset = HB_PCODE_MKINT24( pAddr );
|
||||
HB_SIZE nNewPos = lPCodePos + nOffset;
|
||||
HB_SIZE nNewPos = nPCodePos + nOffset;
|
||||
HB_BOOL fLine = HB_FALSE;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( nOffset == 4 )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -499,28 +499,28 @@ static HB_OPT_FUNC( hb_p_jumpfar )
|
||||
{
|
||||
case HB_P_JUMPFAR:
|
||||
nOffset += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] );
|
||||
if( !fLine || pFunc->pCode[ lPCodePos + nOffset ] == HB_P_LINE )
|
||||
if( !fLine || pFunc->pCode[ nPCodePos + nOffset ] == HB_P_LINE )
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset );
|
||||
break;
|
||||
|
||||
case HB_P_JUMPFALSEFAR:
|
||||
nNewPos += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] );
|
||||
if( nNewPos == lPCodePos + 4 && ( !fLine ||
|
||||
if( nNewPos == nPCodePos + 4 && ( !fLine ||
|
||||
( pFunc->pCode[ nNewPos ] == HB_P_LINE &&
|
||||
pFunc->pCode[ lPCodePos + nOffset + 4 ] == HB_P_LINE ) ) )
|
||||
pFunc->pCode[ nPCodePos + nOffset + 4 ] == HB_P_LINE ) ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_JUMPTRUEFAR;
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_JUMPTRUEFAR;
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset + 4 );
|
||||
}
|
||||
break;
|
||||
|
||||
case HB_P_JUMPTRUEFAR:
|
||||
nNewPos += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] );
|
||||
if( nNewPos == lPCodePos + 4 && ( !fLine ||
|
||||
if( nNewPos == nPCodePos + 4 && ( !fLine ||
|
||||
( pFunc->pCode[ nNewPos ] == HB_P_LINE &&
|
||||
pFunc->pCode[ lPCodePos + nOffset + 4 ] == HB_P_LINE ) ) )
|
||||
pFunc->pCode[ nPCodePos + nOffset + 4 ] == HB_P_LINE ) ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_JUMPFALSEFAR;
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_JUMPFALSEFAR;
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset + 4 );
|
||||
}
|
||||
break;
|
||||
@@ -531,29 +531,29 @@ static HB_OPT_FUNC( hb_p_jumpfar )
|
||||
|
||||
static HB_OPT_FUNC( hb_p_jumpfalsefar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_ISIZ nOffset = HB_PCODE_MKINT24( pAddr );
|
||||
HB_SIZE nNewPos = lPCodePos + nOffset;
|
||||
HB_SIZE nNewPos = nPCodePos + nOffset;
|
||||
HB_BOOL fLine = HB_FALSE;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( nOffset == 8 && pFunc->pCode[ lPCodePos + 4 ] == HB_P_JUMPFAR &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 4 ) )
|
||||
if( nOffset == 8 && pFunc->pCode[ nPCodePos + 4 ] == HB_P_JUMPFAR &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 4 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ lPCodePos + 4 ] = HB_P_JUMPTRUEFAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos + 4 ] = HB_P_JUMPTRUEFAR;
|
||||
}
|
||||
else if( nOffset == 11 && pFunc->pCode[ lPCodePos + 4 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ lPCodePos + 11 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ lPCodePos + 7 ] == HB_P_JUMPFAR &&
|
||||
pFunc->pCode[ lPCodePos + 7 +
|
||||
HB_PCODE_MKINT24( &pFunc->pCode[ lPCodePos + 8 ] ) ] == HB_P_LINE &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 4 ) &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 7 ) )
|
||||
else if( nOffset == 11 && pFunc->pCode[ nPCodePos + 4 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ nPCodePos + 11 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ nPCodePos + 7 ] == HB_P_JUMPFAR &&
|
||||
pFunc->pCode[ nPCodePos + 7 +
|
||||
HB_PCODE_MKINT24( &pFunc->pCode[ nPCodePos + 8 ] ) ] == HB_P_LINE &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 4 ) &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 7 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 7, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ lPCodePos + 7 ] = HB_P_JUMPTRUEFAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 7, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos + 7 ] = HB_P_JUMPTRUEFAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -566,7 +566,7 @@ static HB_OPT_FUNC( hb_p_jumpfalsefar )
|
||||
if( pFunc->pCode[ nNewPos ] == HB_P_JUMPFAR )
|
||||
{
|
||||
nOffset += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] );
|
||||
if( !fLine || pFunc->pCode[ lPCodePos + nOffset ] == HB_P_LINE )
|
||||
if( !fLine || pFunc->pCode[ nPCodePos + nOffset ] == HB_P_LINE )
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset );
|
||||
}
|
||||
}
|
||||
@@ -575,29 +575,29 @@ static HB_OPT_FUNC( hb_p_jumpfalsefar )
|
||||
|
||||
static HB_OPT_FUNC( hb_p_jumptruefar )
|
||||
{
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ];
|
||||
HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ];
|
||||
HB_ISIZ nOffset = HB_PCODE_MKINT24( pAddr );
|
||||
HB_SIZE nNewPos = lPCodePos + nOffset;
|
||||
HB_SIZE nNewPos = nPCodePos + nOffset;
|
||||
HB_BOOL fLine = HB_FALSE;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( nOffset == 8 && pFunc->pCode[ lPCodePos + 4 ] == HB_P_JUMPFAR &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 4 ) )
|
||||
if( nOffset == 8 && pFunc->pCode[ nPCodePos + 4 ] == HB_P_JUMPFAR &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 4 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ lPCodePos + 4 ] = HB_P_JUMPFALSEFAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 4, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos + 4 ] = HB_P_JUMPFALSEFAR;
|
||||
}
|
||||
else if( nOffset == 11 && pFunc->pCode[ lPCodePos + 4 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ lPCodePos + 11 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ lPCodePos + 7 ] == HB_P_JUMPFAR &&
|
||||
pFunc->pCode[ lPCodePos + 7 +
|
||||
HB_PCODE_MKINT24( &pFunc->pCode[ lPCodePos + 8 ] ) ] == HB_P_LINE &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 4 ) &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 7 ) )
|
||||
else if( nOffset == 11 && pFunc->pCode[ nPCodePos + 4 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ nPCodePos + 11 ] == HB_P_LINE &&
|
||||
pFunc->pCode[ nPCodePos + 7 ] == HB_P_JUMPFAR &&
|
||||
pFunc->pCode[ nPCodePos + 7 +
|
||||
HB_PCODE_MKINT24( &pFunc->pCode[ nPCodePos + 8 ] ) ] == HB_P_LINE &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 4 ) &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 7 ) )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 7, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ lPCodePos + 7 ] = HB_P_JUMPFALSEFAR;
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 7, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos + 7 ] = HB_P_JUMPFALSEFAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -610,7 +610,7 @@ static HB_OPT_FUNC( hb_p_jumptruefar )
|
||||
if( pFunc->pCode[ nNewPos ] == HB_P_JUMPFAR )
|
||||
{
|
||||
nOffset += HB_PCODE_MKINT24( &pFunc->pCode[ nNewPos + 1 ] );
|
||||
if( !fLine || pFunc->pCode[ lPCodePos + nOffset ] == HB_P_LINE )
|
||||
if( !fLine || pFunc->pCode[ nPCodePos + nOffset ] == HB_P_LINE )
|
||||
HB_PUT_LE_UINT24( pAddr, nOffset );
|
||||
}
|
||||
}
|
||||
@@ -619,71 +619,71 @@ static HB_OPT_FUNC( hb_p_jumptruefar )
|
||||
|
||||
static HB_OPT_FUNC( hb_p_switch )
|
||||
{
|
||||
HB_USHORT usCases = HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] ), us;
|
||||
HB_SIZE nStart = lPCodePos;
|
||||
HB_USHORT usCases = HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ), us;
|
||||
HB_SIZE nStart = nPCodePos;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
lPCodePos += 3;
|
||||
nPCodePos += 3;
|
||||
for( us = 0; us < usCases; ++us )
|
||||
{
|
||||
switch( pFunc->pCode[ lPCodePos ] )
|
||||
switch( pFunc->pCode[ nPCodePos ] )
|
||||
{
|
||||
case HB_P_PUSHBYTE:
|
||||
lPCodePos += 2;
|
||||
nPCodePos += 2;
|
||||
break;
|
||||
case HB_P_PUSHINT:
|
||||
lPCodePos += 3;
|
||||
nPCodePos += 3;
|
||||
break;
|
||||
case HB_P_PUSHLONG:
|
||||
case HB_P_PUSHDATE:
|
||||
lPCodePos += 5;
|
||||
nPCodePos += 5;
|
||||
break;
|
||||
case HB_P_PUSHLONGLONG:
|
||||
lPCodePos += 9;
|
||||
nPCodePos += 9;
|
||||
break;
|
||||
case HB_P_PUSHSTRSHORT:
|
||||
lPCodePos += 2 + pFunc->pCode[ lPCodePos + 1 ];
|
||||
nPCodePos += 2 + pFunc->pCode[ nPCodePos + 1 ];
|
||||
break;
|
||||
case HB_P_PUSHSTR:
|
||||
lPCodePos += 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
nPCodePos += 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
break;
|
||||
case HB_P_PUSHSTRLARGE:
|
||||
lPCodePos += 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
nPCodePos += 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
break;
|
||||
case HB_P_PUSHNIL:
|
||||
/* default clause */
|
||||
us = usCases;
|
||||
lPCodePos++;
|
||||
nPCodePos++;
|
||||
break;
|
||||
}
|
||||
switch( pFunc->pCode[ lPCodePos ] )
|
||||
switch( pFunc->pCode[ nPCodePos ] )
|
||||
{
|
||||
case HB_P_JUMPNEAR:
|
||||
lPCodePos += 2;
|
||||
nPCodePos += 2;
|
||||
break;
|
||||
case HB_P_JUMP:
|
||||
lPCodePos += 3;
|
||||
nPCodePos += 3;
|
||||
break;
|
||||
/*case HB_P_JUMPFAR:*/
|
||||
default:
|
||||
lPCodePos += 4;
|
||||
nPCodePos += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return lPCodePos - nStart;
|
||||
return nPCodePos - nStart;
|
||||
}
|
||||
|
||||
static HB_OPT_FUNC( hb_p_function )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_RETVALUE &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_RETVALUE &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_DO;
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 3, 1, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_DO;
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 3, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
@@ -692,11 +692,11 @@ static HB_OPT_FUNC( hb_p_functionshort )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 2 ] == HB_P_RETVALUE &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 2 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 2 ] == HB_P_RETVALUE &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 2 ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_DOSHORT;
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 2, 1, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_DOSHORT;
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 2, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
@@ -705,11 +705,11 @@ static HB_OPT_FUNC( hb_p_macrofunc )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_RETVALUE &&
|
||||
! hb_compHasJump( pFunc, lPCodePos + 3 ) )
|
||||
if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_RETVALUE &&
|
||||
! hb_compHasJump( pFunc, nPCodePos + 3 ) )
|
||||
{
|
||||
pFunc->pCode[ lPCodePos ] = HB_P_MACRODO;
|
||||
hb_compNOOPfill( pFunc, lPCodePos + 3, 1, HB_FALSE, HB_FALSE );
|
||||
pFunc->pCode[ nPCodePos ] = HB_P_MACRODO;
|
||||
hb_compNOOPfill( pFunc, nPCodePos + 3, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
@@ -718,10 +718,10 @@ static HB_OPT_FUNC( hb_p_endblock )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( lPCodePos + 1 < pFunc->lPCodePos &&
|
||||
pFunc->pCode[ lPCodePos + 1 ] == HB_P_ENDBLOCK )
|
||||
if( nPCodePos + 1 < pFunc->nPCodePos &&
|
||||
pFunc->pCode[ nPCodePos + 1 ] == HB_P_ENDBLOCK )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -730,10 +730,10 @@ static HB_OPT_FUNC( hb_p_endproc )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
|
||||
if( lPCodePos + 1 < pFunc->lPCodePos &&
|
||||
pFunc->pCode[ lPCodePos + 1 ] == HB_P_ENDPROC )
|
||||
if( nPCodePos + 1 < pFunc->nPCodePos &&
|
||||
pFunc->pCode[ nPCodePos + 1 ] == HB_P_ENDPROC )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 1, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -1046,7 +1046,7 @@ static void hb_compPCodeEnumScanLocals( PFUNCTION pFunc, PHB_OPT_LOCAL pLocals )
|
||||
HB_SHORT isVar = 0;
|
||||
HB_BOOL fWasJump = 0;
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
if( hb_compIsJump( pFunc->pCode[ nPos ] ) )
|
||||
fWasJump = 1;
|
||||
@@ -1200,7 +1200,7 @@ static void hb_compPCodeEnumSelfifyLocal( PFUNCTION pFunc, HB_SHORT isLocal )
|
||||
{
|
||||
HB_SIZE nPos = 0, nLastPos = 0;
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
switch( pFunc->pCode[ nPos ] )
|
||||
{
|
||||
@@ -1329,9 +1329,9 @@ static void hb_compPCodeEnumAssignedUnused( HB_COMP_DECL, PFUNCTION pFunc, PHB_O
|
||||
HB_SHORT isLocal;
|
||||
HB_USHORT usLine = 0;
|
||||
|
||||
pMap = ( HB_BYTE * ) hb_xgrab( pFunc->lPCodePos );
|
||||
pMap = ( HB_BYTE * ) hb_xgrab( pFunc->nPCodePos );
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
HB_BOOL fCheck;
|
||||
|
||||
@@ -1412,7 +1412,7 @@ static void hb_compPCodeEnumAssignedUnused( HB_COMP_DECL, PFUNCTION pFunc, PHB_O
|
||||
pLocals[ isLocal - 1 ].bFlags != OPT_LOCAL_FLAG_POPSELF &&
|
||||
pLocals[ isLocal - 1 ].bFlags != ( OPT_LOCAL_FLAG_PUSH | OPT_LOCAL_FLAG_POPSELF ) )
|
||||
{
|
||||
memset( pMap, 0, pFunc->lPCodePos );
|
||||
memset( pMap, 0, pFunc->nPCodePos );
|
||||
pMap[ nPos ] = 1;
|
||||
|
||||
if( ! hb_compPCodeTraceAssignedUnused( pFunc, nPos + hb_compPCodeSize( pFunc, nPos ),
|
||||
@@ -1448,7 +1448,7 @@ static void hb_compPCodeEnumRenumberLocals( PFUNCTION pFunc, PHB_OPT_LOCAL pLoca
|
||||
{
|
||||
HB_SIZE nPos = 0;
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
switch( pFunc->pCode[ nPos ] )
|
||||
{
|
||||
@@ -1568,7 +1568,7 @@ void hb_compPCodeTraceOptimizer( HB_COMP_DECL )
|
||||
{
|
||||
HB_SIZE nPos = 0;
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
if( pFunc->pCode[ nPos ] == HB_P_PARAMETER )
|
||||
return;
|
||||
|
||||
@@ -38,82 +38,82 @@
|
||||
static HB_PSIZE_FUNC( hb_p_pushstrshort )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return 2 + pFunc->pCode[ lPCodePos + 1 ];
|
||||
return 2 + pFunc->pCode[ nPCodePos + 1 ];
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_pushstr )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
return 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_pushstrlarge )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
return 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_pushstrhidden )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return 4 + HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 2 ] );
|
||||
return 4 + HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 2 ] );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_pushblock )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
return HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_pushblockshort )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return pFunc->pCode[ lPCodePos + 1 ];
|
||||
return pFunc->pCode[ nPCodePos + 1 ];
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_pushblocklarge )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return HB_PCODE_MKUINT24( &pFunc->pCode[ lPCodePos + 1 ] );
|
||||
return HB_PCODE_MKUINT24( &pFunc->pCode[ nPCodePos + 1 ] );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_localname )
|
||||
{
|
||||
HB_SIZE nStart = lPCodePos;
|
||||
HB_SIZE nStart = nPCodePos;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
lPCodePos += 3;
|
||||
while( pFunc->pCode[ lPCodePos++ ] ) {};
|
||||
nPCodePos += 3;
|
||||
while( pFunc->pCode[ nPCodePos++ ] ) {};
|
||||
|
||||
return ( lPCodePos - nStart );
|
||||
return ( nPCodePos - nStart );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_modulename )
|
||||
{
|
||||
HB_SIZE nStart = lPCodePos;
|
||||
HB_SIZE nStart = nPCodePos;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
lPCodePos += 3;
|
||||
while( pFunc->pCode[ lPCodePos++ ]) {};
|
||||
nPCodePos += 3;
|
||||
while( pFunc->pCode[ nPCodePos++ ]) {};
|
||||
|
||||
return ( lPCodePos - nStart );
|
||||
return ( nPCodePos - nStart );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_staticname )
|
||||
{
|
||||
HB_SIZE nStart = lPCodePos;
|
||||
HB_SIZE nStart = nPCodePos;
|
||||
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
lPCodePos += 4;
|
||||
while( pFunc->pCode[ lPCodePos++ ] ) {};
|
||||
nPCodePos += 4;
|
||||
while( pFunc->pCode[ nPCodePos++ ] ) {};
|
||||
|
||||
return ( lPCodePos - nStart );
|
||||
return ( nPCodePos - nStart );
|
||||
}
|
||||
|
||||
static HB_PSIZE_FUNC( hb_p_threadstatics )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
return 3 + ( ( HB_SIZE ) HB_PCODE_MKUSHORT( &pFunc->pCode[ lPCodePos + 1 ] ) << 1 );
|
||||
return 3 + ( ( HB_SIZE ) HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ) << 1 );
|
||||
}
|
||||
|
||||
const HB_BYTE hb_comp_pcode_len[] = {
|
||||
@@ -525,7 +525,7 @@ void hb_compPCodeEval( PFUNCTION pFunc, const HB_PCODE_FUNC_PTR * pFunctions, vo
|
||||
assert( sizeof( hb_comp_pcode_len ) == HB_P_LAST_PCODE );
|
||||
assert( sizeof( s_psize_table ) / sizeof( HB_PCODE_FUNC_PTR ) == HB_P_LAST_PCODE );
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
opcode = pFunc->pCode[ nPos ];
|
||||
if( opcode < HB_P_LAST_PCODE )
|
||||
@@ -582,7 +582,7 @@ void hb_compPCodeTrace( PFUNCTION pFunc, const HB_PCODE_FUNC_PTR * pFunctions, v
|
||||
/* Make sure that table is correct */
|
||||
assert( sizeof( hb_comp_pcode_len ) == HB_P_LAST_PCODE );
|
||||
|
||||
while( nPos < pFunc->lPCodePos )
|
||||
while( nPos < pFunc->nPCodePos )
|
||||
{
|
||||
HB_BYTE opcode = pFunc->pCode[ nPos ];
|
||||
if( opcode < HB_P_LAST_PCODE )
|
||||
@@ -611,12 +611,12 @@ void hb_compGenPCode1( HB_BYTE byte, HB_COMP_DECL )
|
||||
{
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xgrab( HB_PCODE_CHUNK );
|
||||
pFunc->lPCodeSize = HB_PCODE_CHUNK;
|
||||
pFunc->lPCodePos = 0;
|
||||
pFunc->nPCodePos = 0;
|
||||
}
|
||||
else if( ( pFunc->lPCodeSize - pFunc->lPCodePos ) < 1 )
|
||||
else if( ( pFunc->lPCodeSize - pFunc->nPCodePos ) < 1 )
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xrealloc( pFunc->pCode, pFunc->lPCodeSize += HB_PCODE_CHUNK );
|
||||
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte;
|
||||
}
|
||||
|
||||
void hb_compGenPCode2( HB_BYTE byte1, HB_BYTE byte2, HB_COMP_DECL )
|
||||
@@ -627,13 +627,13 @@ void hb_compGenPCode2( HB_BYTE byte1, HB_BYTE byte2, HB_COMP_DECL )
|
||||
{
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xgrab( HB_PCODE_CHUNK );
|
||||
pFunc->lPCodeSize = HB_PCODE_CHUNK;
|
||||
pFunc->lPCodePos = 0;
|
||||
pFunc->nPCodePos = 0;
|
||||
}
|
||||
else if( ( pFunc->lPCodeSize - pFunc->lPCodePos ) < 2 )
|
||||
else if( ( pFunc->lPCodeSize - pFunc->nPCodePos ) < 2 )
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xrealloc( pFunc->pCode, pFunc->lPCodeSize += HB_PCODE_CHUNK );
|
||||
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte1;
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte2;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte1;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte2;
|
||||
}
|
||||
|
||||
void hb_compGenPCode3( HB_BYTE byte1, HB_BYTE byte2, HB_BYTE byte3, HB_COMP_DECL )
|
||||
@@ -644,14 +644,14 @@ void hb_compGenPCode3( HB_BYTE byte1, HB_BYTE byte2, HB_BYTE byte3, HB_COMP_DECL
|
||||
{
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xgrab( HB_PCODE_CHUNK );
|
||||
pFunc->lPCodeSize = HB_PCODE_CHUNK;
|
||||
pFunc->lPCodePos = 0;
|
||||
pFunc->nPCodePos = 0;
|
||||
}
|
||||
else if( ( pFunc->lPCodeSize - pFunc->lPCodePos ) < 3 )
|
||||
else if( ( pFunc->lPCodeSize - pFunc->nPCodePos ) < 3 )
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xrealloc( pFunc->pCode, pFunc->lPCodeSize += HB_PCODE_CHUNK );
|
||||
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte1;
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte2;
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte3;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte1;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte2;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte3;
|
||||
}
|
||||
|
||||
void hb_compGenPCode4( HB_BYTE byte1, HB_BYTE byte2, HB_BYTE byte3, HB_BYTE byte4, HB_COMP_DECL )
|
||||
@@ -662,15 +662,15 @@ void hb_compGenPCode4( HB_BYTE byte1, HB_BYTE byte2, HB_BYTE byte3, HB_BYTE byte
|
||||
{
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xgrab( HB_PCODE_CHUNK );
|
||||
pFunc->lPCodeSize = HB_PCODE_CHUNK;
|
||||
pFunc->lPCodePos = 0;
|
||||
pFunc->nPCodePos = 0;
|
||||
}
|
||||
else if( ( pFunc->lPCodeSize - pFunc->lPCodePos ) < 4 )
|
||||
else if( ( pFunc->lPCodeSize - pFunc->nPCodePos ) < 4 )
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xrealloc( pFunc->pCode, pFunc->lPCodeSize += HB_PCODE_CHUNK );
|
||||
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte1;
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte2;
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte3;
|
||||
pFunc->pCode[ pFunc->lPCodePos++ ] = byte4;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte1;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte2;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte3;
|
||||
pFunc->pCode[ pFunc->nPCodePos++ ] = byte4;
|
||||
}
|
||||
|
||||
void hb_compGenPCodeN( const HB_BYTE * pBuffer, HB_SIZE nSize, HB_COMP_DECL )
|
||||
@@ -681,15 +681,15 @@ void hb_compGenPCodeN( const HB_BYTE * pBuffer, HB_SIZE nSize, HB_COMP_DECL )
|
||||
{
|
||||
pFunc->lPCodeSize = ( ( nSize / HB_PCODE_CHUNK ) + 1 ) * HB_PCODE_CHUNK;
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xgrab( pFunc->lPCodeSize );
|
||||
pFunc->lPCodePos = 0;
|
||||
pFunc->nPCodePos = 0;
|
||||
}
|
||||
else if( pFunc->lPCodePos + nSize > pFunc->lPCodeSize )
|
||||
else if( pFunc->nPCodePos + nSize > pFunc->lPCodeSize )
|
||||
{
|
||||
/* not enough free space in pcode buffer - increase it */
|
||||
pFunc->lPCodeSize += ( ( ( nSize / HB_PCODE_CHUNK ) + 1 ) * HB_PCODE_CHUNK );
|
||||
pFunc->pCode = ( HB_BYTE * ) hb_xrealloc( pFunc->pCode, pFunc->lPCodeSize );
|
||||
}
|
||||
|
||||
memcpy( pFunc->pCode + pFunc->lPCodePos, pBuffer, nSize );
|
||||
pFunc->lPCodePos += nSize;
|
||||
memcpy( pFunc->pCode + pFunc->nPCodePos, pBuffer, nSize );
|
||||
pFunc->nPCodePos += nSize;
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ HB_EXTERN_END
|
||||
static HB_STRIP_FUNC( hb_p_line )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( cargo );
|
||||
if( pFunc->pCode[ lPCodePos + 3 ] == HB_P_LINE )
|
||||
if( pFunc->pCode[ nPCodePos + 3 ] == HB_P_LINE )
|
||||
{
|
||||
hb_compNOOPfill( pFunc, lPCodePos, 3, HB_FALSE, HB_FALSE );
|
||||
hb_compNOOPfill( pFunc, nPCodePos, 3, HB_FALSE, HB_FALSE );
|
||||
}
|
||||
|
||||
return 3;
|
||||
|
||||
Reference in New Issue
Block a user