2006-12-15 16:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbdefs.h
  * harbour/include/hberrors.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprc.c
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
  * harbour/source/common/hbstr.c
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencobj.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbgenerr.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/rtl/console.c
  * harbour/source/rtl/isprint.c
  * harbour/source/rtl/left.c
  * harbour/source/rtl/right.c
  * harbour/source/rtl/strtran.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
    * general PCODE cleanup and address most of TODO/TOFIX notes in
      source code:
      ! fixed GPF traps when too long string or codeblock is generatd
      + added support for 16MB codeblocks and strings
      ! removed macrocompiler limitation for jumps range
      ! fixed GPF when more then 255 local variables is used and added
        support for 2^15 locals
      ! removed all strtok() functions
      % added optimization for all +=, -=, *=, %=, ^=, **= operations
        when left side of expression is variable or array item
      % added optimization for all +=, -=, *=, %=, ^=, **= operations
        when left side of expression is object method and updated ++, --
        for new code. It's still disabled until we will not add support
        for late evaluated reference items to HVM
      ! fixed a[++i]++ and similar operations (a[++i]*=2, ...). Now ++i is
        executed only once. It's not Clipper compatible but it was in
        TODO note in source code. It can be disabled by -kc option
      * finished support to xHarbour like #pragma TEXTHIDDEN(1)
      ! fixed local add int optimization when PARAMETERS used after
        optimization changed local variable number over 255
      ! fixed GPF trap when in HB_P_<op>EQ PCODEs when executed for
        direct values
      * others
    ! fixed problems reported by Chen
    * optimized strtran(), left(), right() to not create new string copy
      when the same value is returned
This commit is contained in:
Przemyslaw Czerpak
2006-12-15 15:54:28 +00:00
parent 22159d57b5
commit bdb38dde43
39 changed files with 2275 additions and 1411 deletions

View File

@@ -118,13 +118,13 @@ HB_CODEBLOCK_PTR hb_codeblockNew( const BYTE * pBuffer,
USHORT uiLocals,
const BYTE * pLocalPosTable,
PHB_SYMB pSymbols,
USHORT usLen )
ULONG ulLen )
{
HB_CODEBLOCK_PTR pCBlock;
PHB_ITEM pLocals;
BYTE * pCode;
HB_TRACE(HB_TR_DEBUG, ("hb_codeblockNew(%p, %hu, %p, %p, %hu)", pBuffer, uiLocals, pLocalPosTable, pSymbols, usLen));
HB_TRACE(HB_TR_DEBUG, ("hb_codeblockNew(%p, %hu, %p, %p, %lu)", pBuffer, uiLocals, pLocalPosTable, pSymbols, ulLen));
/*
* allocate memory for code block body and detach items hb_gcAlloc()
@@ -132,15 +132,15 @@ HB_CODEBLOCK_PTR hb_codeblockNew( const BYTE * pBuffer,
* calling hb_gcLock()/hb_gcUnlock(). [druzus]
*/
if( usLen )
if( ulLen )
{
/*
* The codeblock pcode is stored in dynamically allocated memory that
* can be deallocated after creation of a codeblock. We have to duplicate
* the passed buffer
*/
pCode = ( BYTE * ) hb_xgrab( usLen );
memcpy( pCode, pBuffer, usLen );
pCode = ( BYTE * ) hb_xgrab( ulLen );
memcpy( pCode, pBuffer, ulLen );
}
else
{
@@ -216,7 +216,7 @@ HB_CODEBLOCK_PTR hb_codeblockNew( const BYTE * pBuffer,
pCBlock = ( HB_CODEBLOCK_PTR ) hb_gcAlloc( sizeof( HB_CODEBLOCK ), hb_codeblockDeleteGarbage );
pCBlock->pCode = pCode;
pCBlock->dynBuffer = usLen != 0;
pCBlock->dynBuffer = ulLen != 0;
pCBlock->pDefSymb = hb_stackBaseItem()->item.asSymbol.value;
pCBlock->pSymbols = pSymbols;
pCBlock->lStatics = hb_stackGetStaticsBase();
@@ -228,12 +228,12 @@ HB_CODEBLOCK_PTR hb_codeblockNew( const BYTE * pBuffer,
return pCBlock;
}
HB_CODEBLOCK_PTR hb_codeblockMacroNew( BYTE * pBuffer, USHORT usLen )
HB_CODEBLOCK_PTR hb_codeblockMacroNew( BYTE * pBuffer, ULONG ulLen )
{
HB_CODEBLOCK_PTR pCBlock;
BYTE * pCode;
HB_TRACE(HB_TR_DEBUG, ("hb_codeblockMacroNew(%p, %i)", pBuffer, usLen));
HB_TRACE(HB_TR_DEBUG, ("hb_codeblockMacroNew(%p, %lu)", pBuffer, ulLen));
/*
* The codeblock pcode is stored in dynamically allocated memory that
@@ -245,8 +245,8 @@ HB_CODEBLOCK_PTR hb_codeblockMacroNew( BYTE * pBuffer, USHORT usLen )
* to be safe for automatic GC activation in hb_xgrab() without
* calling hb_gcLock()/hb_gcUnlock(). [druzus]
*/
pCode = ( BYTE * ) hb_xgrab( usLen );
memcpy( pCode, pBuffer, usLen );
pCode = ( BYTE * ) hb_xgrab( ulLen );
memcpy( pCode, pBuffer, ulLen );
pCBlock = ( HB_CODEBLOCK_PTR ) hb_gcAlloc( sizeof( HB_CODEBLOCK ), hb_codeblockDeleteGarbage );
/* Store the number of referenced local variables */