static HB_CODETRACE_FUNC( hb_p_jump ) { HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ]; HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr ); hb_compCodeTraceMark( cargo, nPCodePos, 3 ); return hb_compCodeTraceNextPos( cargo, nNewPos ); }
static HB_LABEL_FUNC( hb_p_jump ) { HB_BYTE * pAddr = &pFunc->pCode[ nPCodePos + 1 ]; HB_SIZE nNewPos = nPCodePos + HB_PCODE_MKSHORT( pAddr ); cargo->pnLabels[ nNewPos ]++; return 3; }
static HB_LABEL_FUNC( hb_p_jump ) { BYTE * pAddr = &pFunc->pCode[ lPCodePos + 1 ]; ULONG ulNewPos = lPCodePos + HB_PCODE_MKSHORT( pAddr ); cargo->pulLabels[ ulNewPos ]++; return 3; }
static HB_FIX_FUNC( hb_p_localfix ) { HB_BYTE * pVar = &pFunc->pCode[ nPCodePos + 1 ]; HB_SHORT iVar = HB_PCODE_MKSHORT( pVar ); HB_SYMBOL_UNUSED( cargo ); iVar += pFunc->wParamCount; pVar[ 0 ] = HB_LOBYTE( iVar ); pVar[ 1 ] = HB_HIBYTE( iVar ); return 0; }
static int hb_hrbReadHead( const char * szBody, HB_SIZE nBodySize, HB_SIZE * pnBodyOffset ) { const char * pVersion; HB_SIZE nSigSize; HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadHead(%p,%" HB_PFS "u,%p)", szBody, nBodySize, pnBodyOffset ) ); nSigSize = hb_hrbCheckSig( szBody, nBodySize ); if( nSigSize == 0 || nBodySize - nSigSize < 2 ) return 0; pVersion = szBody + nSigSize; *pnBodyOffset += nSigSize + 2; return HB_PCODE_MKSHORT( pVersion ); }
static HB_CODETRACE_FUNC( hb_p_switch ) { HB_USHORT usCases = HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ), us; HB_SIZE nStart = nPCodePos, nNewPos; nPCodePos += 3; for( us = 0; us < usCases; ++us ) { switch( pFunc->pCode[ nPCodePos ] ) { case HB_P_PUSHBYTE: nPCodePos += 2; break; case HB_P_PUSHINT: nPCodePos += 3; break; case HB_P_PUSHLONG: case HB_P_PUSHDATE: nPCodePos += 5; break; case HB_P_PUSHLONGLONG: nPCodePos += 9; break; case HB_P_PUSHSTRSHORT: nPCodePos += 2 + pFunc->pCode[ nPCodePos + 1 ]; break; case HB_P_PUSHSTR: nPCodePos += 3 + HB_PCODE_MKUSHORT( &pFunc->pCode[ nPCodePos + 1 ] ); break; case HB_P_PUSHSTRLARGE: nPCodePos += 4 + HB_PCODE_MKUINT24( &pFunc->pCode[ nPCodePos + 1 ] ); break; case HB_P_PUSHNIL: /* default clause */ us = usCases; nPCodePos++; break; } switch( pFunc->pCode[ nPCodePos ] ) { case HB_P_JUMPNEAR: nNewPos = nPCodePos + ( signed char ) pFunc->pCode[ nPCodePos + 1 ]; nPCodePos += 2; break; case HB_P_JUMP: nNewPos = nPCodePos + HB_PCODE_MKSHORT( &pFunc->pCode[ nPCodePos + 1 ] ); nPCodePos += 3; break; /*case HB_P_JUMPFAR:*/ default: nNewPos = nPCodePos + HB_PCODE_MKINT24( &pFunc->pCode[ nPCodePos + 1 ] ); nPCodePos += 4; break; } hb_compCodeTraceAddJump( cargo, nNewPos ); } hb_compCodeTraceMark( cargo, nStart, nPCodePos - nStart ); return hb_compCodeTraceNextPos( cargo, us > usCases ? cargo->nPCodeSize : nPCodePos ); }