0fae2fdd2ce993f00eb568d28c45a201a65ffcfc
23 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0fae2fdd2c |
2006-10-07 04:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
+ added validation for class data names. As additional preprocessor
rule to not use <!marker!>
* harbour/include/hboo.ch
* harbour/source/rtl/tclass.prg
* harbour/source/vm/classes.c
+ added delegate messages
* harbour/include/hbstack.h
* harbour/source/vm/arrays.c
* harbour/source/vm/estack.c
* harbour/source/vm/hvm.c
* harbour/source/vm/proc.c
+ added startup symbol to hb_stack. It gives very good stop
condition for all procedures which trace stack calls and
resolves the problem with hb_stack.pBase which was never
pointing to valid function/procedure symbol when no symbol
was put on HVM stack. Now after hb_stackInit() the first
item is allocated for "hb_stackInit()" symbol so hb_stack.pBase
is always a pointer to valid function/procedure symbol.
* changed the guard condition for buggy code in hb_stackPop()
and similar code from:
hb_stack.pPos < hb_stack.pItems
to:
hb_stack.pPos <= hb_stack.pBase
The old condition was generating usable error message only in the
startup function. In deeply called functions it was only waste of
CPU time on one of the most often call functions. Before it was
activated internal stack structures were corrupted.
If we were leaving for many years without really working stack
underflow protection then maybe we should think about disabling
it at when HB_STACK_MACROS are used and keep it only in real
stack functions for HVM developers. Single protection in
hb_stackOldFrame() I've just added is enough for basic C code
validation.
I created the second version of stack macros without it in
hbstack.h but I would like to hear other developers opinion.
|
||
|
|
4aeac1e509 |
2006-09-20 14:15 UTC+0100 Ryszard Glab <rglab//imid.med.pl>
* include/hbpcode.h
+ added new pcode HB_P_VFRAME
* include/hbapi.h
+ added USHORT paramdeclcnt to asSymbol structure
* include/hbstack.h
* source/vm/estack.c
+ added hb_stackLocalVariable() to acces local variables
* source/compiler/genc.c
* source/compiler/gencc.c
* source/compiler/harbour.c
* source/compiler/harbour.l
* source/compiler/harbour.y
* source/compiler/hbdead.c
* source/compiler/hbfix.c
* source/compiler/hblbl.c
* source/compiler/hbpcode.c
* source/compiler/hbstripl.c
* source/vm/hvm.c
+ added support for variable number of parameters in
functions/procedures
+ tests/varparam.prg
* example usage of new syntax for variable number of
parameters
* source/vm/arrayshb.c
* changed HB_APARAMS() to use current stack frame if no
arguments are passed ( HB_APARAMS() == HB_APARAMS(0) )
SYNTAX for variable number of parameters
1) [FUNCTION|PROCEDURE] name( ... )
or
2) [FUNCTION|PROCEDURE] name( var1, var2, varN, ... )
To access passed parameters use the following:
PCOUNT() - returns number of passed parameters
HB_PVALUE( iParamNum ) - returns <iParamNum> parameter
HB_APARAMS() - returns array with all passed parameters
or usual name of parameter variable in case of syntax 2)
|
||
|
|
8bef490815 |
2006-08-19 01:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
* moved HB_STACK_STATE declaration from hbstack.h to hbapi.h
it's covered by _HB_API_INTERNAL_ macro so it should not
effect 3-rd party code
* modified hb_struSymbol structure:
LONG stackbase
replaced by:
PHB_STACK_STATE stackstate
this modification allows to keepadditional information bound with
function call stack accessible from different HVM modules.
Now it's used by memvars code to keep/update PRIVATE variables
stack pointers. I plan to store in HB_STACK_STATE structure
information additional information for classes code like super
casting or instance variables offsets in new OOP model I'm working on.
It can be also used by debugger code to retrieve some informations
about executed functions without active updating by main HVM loop.
+ added hb_memvarsClear() - cleanly clears all PRIVATE and PUBLIC
variables
+ added hb_memvarUpdatePrivatesBase() - updates PRIVATE stack base
offset so PRIVATE variables created in current function/procedure
will not be removed when it returns
- removed hb_memvarsRelease() and hb_memvarValueNew()
* harbour/include/hbstack.h
+ added hb_stackClearMevarsBase() - helper function for hb_memvarsClear()
clears PRIVATE stack offsets in executed functions
* changed to static offset from int to long - in different places we
were using int or long in HVM so I cleaned the HVM code to always
operate on the same type
* harbour/source/vm/estack.c
* set/restore PRIVATE stack base offset in hb_stackNewFrame()/
hb_stackOldFrame()
* updated for new HB_IT_SYMBOL structure
* harbour/source/vm/hvm.c
! removed setting/restoring PRIVATE stack base offset in hb_vmExecute()
It make code like:
eval(&("{||VAR:=1}"))
Clipper compatible
* updated for new HB_IT_SYMBOL structure
* changed order of execution exit procedures for clean memvars removing
and future destructors execution. I'll describe it better when I'll
add destructors.
* harbour/source/vm/memvars.c
! fixed CLEAR MEMORY - now this function should be safe in Harbour
It's not exactly compatible with Clipper because I intentionally
didn't replicated some Clipper bugs like possible memory corruption.
+ added hb_memvarsClear() - cleanly clears all PRIVATE and PUBLIC
variables
+ added hb_memvarUpdatePrivatesBase() - updates PRIVATE stack base
offset so PRIVATE variables created in current function/procedure
will not be removed when it returns
! fixed releasing PUBLIC and PRIVATE variables which were passed by
reference and are still active on HVM stack or in codeblocks as
detached locals (see: hb_memvarDetachDynSym())
* modified hb_memvarFindSymbol() to be more Clipper compatible
% optimized hb_memvarRelease() to operate or PHB_DYNS instead of
string comparison and not make linear dynamic symbol scan for
PUBLIC or not existing symbols
- removed hb_memvarReleasePublic()
* harbour/include/hbvmpub.h
* harbour/include/hbxvm.h
* harbour/source/compiler/gencc.c
* harbour/source/vm/classes.c
* harbour/source/vm/debug.c
* harbour/source/vm/itemapi.c
* harbour/source/vm/pcount.c
* harbour/source/vm/proc.c
* harbour/source/vm/pvalue.c
* updated for the above modifications
* harbour/source/rtl/memvarbl.prg
* harbour/source/rtl/menuto.prg
* use __mvEXIST( cMemvar ) instead of __mvSCOPE( cMemvar ) > HB_MV_ERROR
__mvEXIST() is much faster function
* harbour/source/rtl/type.c
* execute hb_memvarUpdatePrivatesBase() after macro type checking.
This should not be necessary but we are not Clipper compatible here
and this is work around for difference in our TYPE() implementation.
Clipper for:
? TYPE("VAR:=1")
create PUBLIC variable VAR when [x]Harbour PRIVATE one.
Should we try to make it Clipper compatible?
The above should fix problems reported with memvars. We are not 100%
Clipper compatible but unlike in Clipper we cannot break VM internals
using some operation on references to memvars and detached locals
and/or RELEASE.../ CLEAR MEMORY. This modifications should be intensively
tested. If you will find any problems with current code please inform me.
I'd like to hear your opinions about memvars created by TYPE() (see above).
Should we change it? It may not be very easy operation - we will have to
change macro compiler and add new PCODE for that.
|
||
|
|
68cb7f510b |
2006-08-17 12:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
* harbour/include/hbapi.h
* harbour/include/hbapigt.h
* harbour/include/hbapiitm.h
* harbour/include/hbdefs.h
* harbour/include/hbrdddbf.h
* harbour/include/hbstack.h
* harbour/include/hbsxfunc.h
* harbour/source/common/expropt1.c
* harbour/source/common/hbstr.c
* harbour/source/compiler/harbour.c
* harbour/source/compiler/hbident.c
* harbour/source/pp/ppcore.c
* harbour/source/rdd/hbdbsort.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rdd/hbsix/sxcompr.c
* harbour/source/rtl/hardcr.c
* harbour/source/rtl/inkey.c
* harbour/source/rtl/isprint.c
* harbour/source/rtl/math.c
* harbour/source/rtl/mtran.c
* harbour/source/rtl/natmsg.c
* harbour/source/rtl/gtcrs/chrmap.c
* harbour/source/rtl/gtcrs/gtcrs.c
* harbour/source/rtl/gtsln/gtsln.c
* harbour/source/rtl/gtsln/gtsln.h
* harbour/source/rtl/gtsln/kbsln.c
* harbour/source/rtl/gtsln/keytrans.c
* harbour/source/rtl/gtsln/mousesln.c
* harbour/source/vm/estack.c
* harbour/source/vm/extend.c
* harbour/source/vm/runner.c
* harbour/utils/hbver/hbverfix.c
* general code cleanup, public functions declared in header files,
local changed to static, added mising void for functions without
parameters, etc.
We still have some public functions which are not used by core code
and not declared in header files, like:
hb_memvarValueBaseAddress(), hb_memvarGetVarHandle(),
hb_memvarGetValueByHandle(), hb_clsCreate(), hb_clsAdd(),
hb_clsAssociate(), hb_hashTableDel(), hb_hashTableSize(),
I haven't touched them yet though we will have to keep in mind that
we should make sth with them.
|
||
|
|
8210adba05 |
2006-08-16 12:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
* harbour/source/vm/estack.c
+ added:
int hb_stackCallDepth( void )
LONG hb_stackBaseProcOffset( int iLevel )
* harbour/source/vm/arrays.c
* harbour/source/vm/proc.c
* use hb_stackBaseProcOffset()
* harbour/source/vm/hvm.c
- removed s_ulProcLevel used by HB_DBG_PROCLEVEL() - count the call
stack dynamically using stack data - a little bit slower but it's
not widely used function, now is MT safe and we eliminated some
small overhead in each function call so statistically we improved
overall performance
|
||
|
|
084842364e |
2006-07-25 12:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
* harbour/source/vm/hvm.c
! fixed typo in hb_stackWithObjectOffset() macro definition
|
||
|
|
f1fa94f3c4 |
2006-07-25 10:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
! make GOTOP() when new index is open and is set as control one
* harbour/include/hbcomp.h
* harbour/include/hbstack.h
* harbour/include/hbxvm.h
* harbour/source/compiler/gencc.c
* harbour/source/compiler/hblbl.c
* harbour/source/vm/classes.c
* harbour/source/vm/estack.c
* harbour/source/vm/hvm.c
* harbour/source/vm/itemapi.c
* added automatic destructors for FOR EACH and WITH OBJECT statement
* s_lWithObjectBase changed to lWithObjectBase hb_stack membera
* added hb_stackWithObject*() functions/macros to manipulate
WITH OBJECT offset/item
* removed setting/restoring lForEach and lWithObject in functions
preamble/postamble
! fixed restoring s_lRecoverBase on HB_QUIT_REQUESTED
! fixed possible GPF on enumerators copping
* moved FOR EACH / WITH OBJECT massages suport from HVM to classy.c
! fixed access to first stack item in hb_vmIsLocalRef()
* harbour/TODO
- removed note about hb_objGetMethod() - it's already addressed
|
||
|
|
688bec195a |
2006-07-04 13:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
* harbour/source/vm/estack.c
- removed hb_stackTopItem()
+ added hb_stackItemBasePtr(), hb_stackAllocItem()
* changed the item initialization/clearing in push/pop operation
Now only complex item are cleared and it's not guaranteed that
the top item will be set to NIL. In fact it was not guarantied
even before my modifications. You coule be sure only that the
allocated item will not be complex one and you can safely pass
pointer to it to any other functions. It allow to clean a little
bit some code and remove redundant and repeated setting HB_IT_NIL
for allocated items.
Now using hb_stackPush() can be necessary only in some very seldom
cases. hb_stackAllocItem() allocates new item and returns pointer
to this item. After some code cleaning hb_stackPush() is not used
by core Harbour code at all so if you have it in your sources then
please check if you should not update them.
* harbour/source/rdd/usrrdd/usrrdd.c
* use hb_vmPushNil() instead of hb_stackPush()
* harbour/source/vm/arrays.c
* changed hb_arrayNew() to be safe for automatic GC activation
* some minor speed improvement
* harbour/source/vm/codebloc.c
* changed hb_codeblockNew() and hb_codeblockMacroNew() to be safe
for automatic GC activation
* harbour/source/vm/debug.c
* use only stack function/macros instead of direct accessing hb_stack
I hope that I haven't break anything.
* harbour/source/vm/hvm.c
! use hb_stackAllocItem() instead of hb_stackTopItem() to make our
HVM reentrant safe. This modifications also fixed some possible
bugs which could be exploited by other modules which have to execute
.prg code - f.e. in RDD when relation codeblock has to be executed
to position record in fieldget/fieldput operations.
* harbour/source/vm/itemapi.c
* harbour/source/vm/memvars.c
* use hb_stackAllocItem()
The above modifications finish stack usage and making our HVM reentrant
safe. There is only one thing which have to be fixed yet. It's HVM
support for xbase++ syntax in things like:
func(&<paramList>), aVal[&<indexList>], {&<itemList>}
To fix it we will have to change PCODE generated by compiler and
replace some PCODEs used for current code by the new one. I will
wait with this modifications for Ryszard.
With the above exception now we are ready to implement destructors,
add automatic GC and begin to work on MT though before that I'd like
to clean the RT error support.
Please carefully check if all is correct. It was modification in core
code and even small typo can break whole application.
|
||
|
|
5cbcaa09f0 |
2006-06-27 10:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
* harbour/source/vm/proc.c
+ added BOOL hb_procinfo( int iLevel, char * szName,
USHORT * puiLine, char * szFile )
* harbour/include/hbstack.h
* harbour/source/vm/estack.c
+ added hb_stackTotalItems(), hb_stackDateBuffer(),
hb_stackGetStaticsBase(), hb_stackSetStaticsBase(),
hb_stackBaseProcInfo()
* harbour/source/vm/garbage.c
* indenting
* harbour/source/vm/classes.c
* harbour/source/vm/codebloc.c
* harbour/source/vm/extend.c
* harbour/source/vm/fm.c
* harbour/source/vm/hvm.c
* replaced direct stack access by stack functions/macros
* harbour/source/vm/debug.c
* removed hb_stackLenGlobal() and replace it by hb_stackTopOffset()
Warning!!! hb_stackTopOffset() returnes results smaller by 1.
The TOP stack item is undefined and should not be accessed by
debuger.
* changed HB_DBG_VMSTKGLIST() to operate on functions/macros.
It's possible that the above will badly interact with core debugger
code so I stop farther modifications leaving them for someone who
knows debugger core code.
|
||
|
|
917c8057e6 |
2006-06-14 13:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/linux/dir.cf
* harbour/config/linux/gcc.cf
* formatting
* harbour/config/linux/global.cf
* harbour/config/linux/install.cf
* added -ldl to linked library list and RANLIB executing after library
creation
* harbour/contrib/ole/ole2.c
* added #include "hbapicls.h"
+ harbour/include/hbapicls.h
* harbour/include/hbapi.h
+ added HB_IT_ENUM item
+ added collect member to HB_IT_POINTER structure for POINTER items
inspected by GC
* changed the order of HB_CODEBLOCK members to safe few bytes on
alignment
* removed counters from HB_CODEBLOCK and HB_BASEARRAY structure
+ added hb_xRefInc(), hb_xRefDec(), hb_xRefFree(), hb_xRefCount(),
hb_xRefResize() functions. They are internal Harbour VM functions
and covered by internal API macro. Should not be used by 3-rd
party code because we may change them in the future or even remove.
+ added hb_gcRefInc(), hb_gcRefDec(), hb_gcRefFree(), hb_gcRefCount()
functions. These are also internal function which corresponds to the
above hb_x*() ones.
- removed hb_arrayRelease() function. This function is not longer
necessary and it should never be public function - it was implemented
in very dangerous way.
- removed hb_codeblockDelete() function.
- removed hb_memvarValueDecGarbageRef()
+ added USHORT usLen parameter to hb_codeblockMacroNew() - when sets
to non 0 value it informs that PCODE should be copied to dynamically
allocated buffer.
* moved all classes/object functions to separate file: hbapicls.h
+ added hb_retptrGC()
+ added internal function hb_memvarGetItem()
* harbour/include/hbapiitm.h
- removed hb_itemForwardValue() and added macro which translates
hb_itemForwardValue() to hb_itemMove()
+ added hb_itemUnShareString() and hb_itemReSizeString() functions
+ added hb_itemSetNil() macro
* harbour/include/hbdefs.h
* some cleanups in macro definitions
* harbour/include/hbexprb.c
* indenting
* harbour/include/hbvm.h
* harbour/include/hbinit.h
+ added hb_vmProcessSymbolsExt(), hb_vmRegisterSymbols(),
hb_vmFreeSymbols(), hb_vmBeginSymbolGroup(),
hb_vmInitSymbolGroup(), hb_vmExitSymbolGroup()
* changed hb_vmProcessSymbols() to return address of register symbol
table. For normal code it's the same address as given in parameter
so it does not break backward binary compatibility.
* changed symbol init macros to work correctly with modified address
of symbol table
* harbour/include/hbsetup.h
* added support for HB_USE_PROFILER macro. Now profiler code is
is disable in HVM by default
* commented out HB_ASORT_OPT_ITEMCOPY - it's not longer used - see note.
* harbour/include/hbstack.h
* added missing parenthesis in hb_stackItem() macro
* harbour/include/hbtypes.h
* updated VM_PROCESS_DLL_SYMBOLS definition
+ added VM_PROCESS_SYMBOLS_EXT
- removed HB_ARRAYRELEASE
* harbour/include/hbver.h
* changed revision number to 2
* harbour/include/hbvmpub.h
- remove pFunPtr from HB_DYNS and cover profiler member by
#ifndef HB_NO_PROFILER
+ added HB_PCODEFUNC structure
+ added HB_FS_PCODEFUNC, HB_FS_DYNCODE and HB_FS_LOCAL - the last one
is not used yet.
* harbour/include/hbxvm.h
* added some multipcode functions for some speed optimization in -gc3
output
* harbour/include/hbapicdp.h
* harbour/source/codepage/cpbg866.c
* harbour/source/codepage/cpbgiso.c
* harbour/source/codepage/cpbgwin.c
* harbour/source/codepage/cpeldos.c
* harbour/source/codepage/cpelwin.c
* harbour/source/codepage/cpesdos.c
* harbour/source/codepage/cpesmwi.c
* harbour/source/codepage/cpeswin.c
* harbour/source/codepage/cpgedos.c
* harbour/source/codepage/cpgewin.c
* harbour/source/codepage/cphu852.c
* harbour/source/codepage/cphuiso.c
* harbour/source/codepage/cphuwin.c
* harbour/source/codepage/cppl852.c
* harbour/source/codepage/cppliso.c
* harbour/source/codepage/cpplmaz.c
* harbour/source/codepage/cpplwin.c
* harbour/source/codepage/cppt850.c
* harbour/source/codepage/cpptiso.c
* harbour/source/codepage/cpru866.c
* harbour/source/codepage/cprukoi.c
* harbour/source/codepage/cpruwin.c
* harbour/source/codepage/cpsl437.c
* harbour/source/codepage/cpsl852.c
* harbour/source/codepage/cpsliso.c
* harbour/source/codepage/cpslwin.c
* harbour/source/codepage/cpsrwin.c
* harbour/source/common/hbfhnd.c
* harbour/source/common/hbstr.c
* harbour/source/common/hbver.c
* harbour/source/compiler/gencli.c
* harbour/source/rtl/fstemp.c
* harbour/source/rtl/hbgtcore.c
* harbour/source/rtl/langapi.c
* harbour/source/rtl/gtalleg/gtalleg.c
* harbour/source/rtl/gtalleg/ssf.h
* harbour/source/rtl/gtcgi/gtcgi.c
* harbour/source/rtl/gtcrs/gtcrs.c
* harbour/source/rtl/gtdos/gtdos.c
* harbour/source/rtl/gtos2/gtos2.c
* harbour/source/rtl/gtpca/gtpca.c
* harbour/source/rtl/gtsln/gtsln.c
* harbour/source/rtl/gtstd/gtstd.c
* harbour/source/rtl/gtwin/gtwin.c
* harbour/source/rtl/gtwvt/gtwvt.c
* harbour/source/rtl/gtxwc/gtxwc.c
* cleaned the code to avoid warnings for some non ANSI C constructions
* harbour/source/compiler/cmdcheck.c
* formatting
* harbour/source/compiler/gencc.c
* added some multipcode optimizations
* harbour/source/compiler/genc.c
* keep function name set by compiler for static initstatics
* harbour/source/compiler/harbour.c
* extend init statics name with the number of used static variables
* formatting
* harbour/source/compiler/hbusage.c
+ added my name to developers list - I hope that there is enough
of my code in Harbour (BTW for quite long time) ;-)
* harbour/source/rdd/dbcmd.c
- removed DBF2TEXT() function
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* generate RT error when someone tries to create DBF with memo fields
without MEMO RDD linked.
* harbour/source/rtl/errorapi.c
* replace all hb_vmDo() with hb_vmSend()
* harbour/source/rtl/math.c
* use hb_errPutArgs() to pass parameters to error object
* harbour/source/rtl/philes.c
* harbour/source/rtl/space.c
* harbour/source/rtl/strpeek.c
* some minor optimizations
* harbour/source/vm/arrays.c
- removed hb_arrayRelease() function.
* changed hb_arrayReleaseGarbage() to be safe for recursive call
* updated to use GC counters
* harbour/source/vm/arrayshb.c
* use stack function/macros instead of direct accessing HB_STACK members
* harbour/source/vm/asort.c
* removed unused HB_ASORT_OPT_ITEMCOPY
* harbour/source/vm/classes.c
* added class code from HVM
% added fast overloaded operator detection and execution
+ added hb_objHasOperator(), hb_objOperatorCall()
+ added separated overloading of "=" and "==" operators
* operate on PHB_SYMB not PHB_FUNC - support for pure PCODE function
without any machine code
* use stack function/macros instead of direct accessing HB_STACK members
* separated profiler code
* some code cleaning
* harbour/source/vm/codebloc.c
+ added USHORT usLen parameter to hb_codeblockMacroNew() - when sets
to non 0 value it informs that PCODE should be copied to dynamically
allocated buffer.
* updated to use GC counters
- removed hb_codeblockDelete() function.
* changed hb_codeblockDeleteGarbage() to be safe for recursive call
- removed restoring statics base in hb_codeblockEvaluate()
* harbour/source/vm/debug.c
* cleaned and optimized some code
* harbour/source/vm/dynlibhb.c
+ added support for loading and unloading dynamic libraries with PCODE
+ added support for dynamic libraries in Linux (.so)
+ added HB_LIBERROR() - returns error string with last error in
HB_LIBLOAD() - now works only in Linux
* harbour/source/vm/dynsym.c
* separated profiler code
+ use pDynSym->pSymbol->value.pFunPtr instead of pDynSym->pFunPtr
* harbour/source/vm/estack.c
+ added #include "hbapicls.h"
+ added hb_stackPushReturn(), hb_stackPopReturn()
* harbour/source/vm/eval.c
* harbour/source/vm/extend.c
* use stack function/macros instead of direct accessing HB_STACK members
+ added hb_retptrGC()
* harbour/source/vm/fm.c
+ added hb_xRefInc(), hb_xRefDec(), hb_xRefFree(), hb_xRefCount(),
hb_xRefResize() functions. They are internal Harbour VM functions
and covered by internal API macro. Should not be used by 3-rd
party code because we may change them in the future or even remove.
* harbour/source/vm/garbage.c
+ added hb_gcRefInc(), hb_gcRefDec(), hb_gcRefFree(), hb_gcRefCount()
functions. These are also internal function which corresponds to the
above hb_x*() ones.
* changed Step 3 of GC pass and execution of clean-up function to be
safe for recursive calls and additional activity.
Ryszard see my note and s_pDeletedBlock
+ added GC inspected HB_IT_POINTER items.
* harbour/source/vm/hvm.c
* separated profiler code
* separated class code from HVM
+ added support for loading and unloading libraries with PCODE modules
+ added support for pure PCODE functions
+ added support for string item resizing and preallocating string buffer
+ added some new multipcode functions for -gc3 optimization
+ added hb_vmProcessSymbolsExt(), hb_vmRegisterSymbols(),
hb_vmFreeSymbols(), hb_vmBeginSymbolGroup(),
hb_vmInitSymbolGroup(), hb_vmExitSymbolGroup()
* changed hb_vmProcessSymbols() to return address of register symbol
table. For normal code it's the same address as given in parameter
so it does not break backward binary compatibility.
+ use new code for operator overloading
* changed FOR EACH to dynamically check iteration scope in
hb_vmEnumNext()/hb_vmEnumPrev() and remove max number of iteration
stored on HVM stack
* temporary use hb_itemUnRefOnce() instead of hb_itemUnRefRefer() as
workaround for possible GPF. I'd like Ryszard will chose the final
version
* harbour/source/vm/itemapi.c
+ added support for preallocating string buffer size
+ added hb_itemUnShareString() and hb_itemReSizeString()
* updated string items to use counters allocated with each
memory block by xh_xgrab()/hb_xalloc()
* updated codeblock and array items to use GC reference counters
+ added GC inspected HB_IT_POINTER items.
* generate RT error in hb_itemUnreOnce() for enumerator items
out of scope
+ added hb_itemPutPtrGC()
* harbour/source/vm/macro.c
* use pDynSym->pSymbol->value.pFunPtr instead of pDynSym->pFunPtr
* harbour/source/vm/maindllp.c
* updated usage of hb_vmProcessSymbols()
* added hb_vmProcessSymbolsExt()
* harbour/source/vm/memvars.c
+ added hb_memvarGetItem()
- removed hb_memvarValueDecGarbageRef()
* harbour/source/vm/proc.c
+ added #include "hbapicls.h"
* harbour/source/vm/pvalue.c
* do not access stack structure directly but use hb_stack*()
functions (macros)
* harbour/source/vm/runner.c
* synced with xHarbour
* harbour/utils/hbtest/rt_misc.prg
* added overloading "=" operator. Now "==" and "=" can be overloaded
with different methods
All names I used for new functions/macros can be changed. Please look at
it and if you will some better propositions then we can use it.
hb_vmProcessSymbolsExt() is added but not used yet.
|
||
|
|
29f11ab65c |
2006-03-25 03:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
* harbour/source/vm/estack.c
* added pEnd to hb_stack structure to speed up hb_stackPush()
which is one of the most often used operation in HVM.
* harbour/include/hbapi.h
* small trick with HB_IS_* macros to give a compiler a chance to make
them faster on some machines
* harbour/source/compiler/genc.c
! fixed stripping non identifier characters from symbol table name
* harbour/source/compiler/hbpcode.c
* cleaned comment
* harbour/source/rdd/dbf1.c
* set Operation in error object to field name in field{put,get} methods.
+ added DBI_LOCKOFFSET
* harbour/source/vm/classes.c
* formatting
* harbour/source/vm/hvm.c
* harbour/source/vm/itemapi.c
* some minor speed optimizations
|
||
|
|
68ceb7444c |
2006-03-22 16:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
* harbour/source/vm/estack.c
+ added hb_stackDecrease( ULONG )
* harbour/include/hbxvm.h
* harbour/source/vm/hvm.c
+ added hb_xvmArrayItemPush(), hb_xvmArrayItemPop(), hb_xvmMultByInt()
* harbour/source/compiler/gencc.c
% use hb_xvmArrayItemPush(), hb_xvmArrayItemPop(), hb_xvmMultByInt()
If someone has time then it will be good to also add:
hb_xvmDivByInt(), hb_xvmModulusInt(), hb_xvmPlusInt(), hb_xvmMinusInt()
* harbour/source/vm/itemapi.c
* use simple memcpy() in hb_itemSwap() - it's save in current HVM
It could become unsafe if we add reference tracing or sth like
that in the future but in such case we will have to also update
hb_itemCopy() and hb_itemMove() so we can also update hb_itemSwap()
* harbour/source/vm/asort.c
* harbour/source/vm/classes.c
* harbour/source/vm/memvars.c
* harbour/source/vm/hvm.c
* cleaned the code which created HB_ITEMs on C stack. Only three
places have to be update yet and array/clodeblock creation little
bit modified and we will be able add automatic GC activation in
hb_xgrab() or hb_gcAlloc().
|
||
|
|
a290c984e7 |
2006-02-04 17:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/harbour.spec
* harbour/make_bsd.sh
* harbour/make_drw.sh
* harbour/make_gnu.sh
* harbour/make_rpm.sh
* harbour/make_tgz.sh
* harbour/bin/hb-func.sh
* harbour/bin/pack_src.sh
* harbour/config/c.cf
* harbour/config/global.cf
* harbour/config/rules.cf
* harbour/config/darwin/gcc.cf
* harbour/config/darwin/global.cf
* harbour/config/dos/djgpp.cf
* harbour/config/dos/global.cf
* harbour/config/dos/install.cf
* harbour/config/dos/owatcom.cf
* harbour/config/hpux/gcc.cf
* harbour/config/hpux/global.cf
* harbour/config/linux/gcc.cf
* harbour/config/linux/global.cf
* harbour/config/linux/owatcom.cf
* harbour/config/sunos/gcc.cf
* harbour/config/w32/watcom.cf
* include ADSRDD by default in RPMs
* updated for new RPM which does not accept some old tags
* set -fPIC on 64bit platforms
+ added /etc/harbour/hb-charmap.def
* updated for new GT system and drivers
* harbour/contrib/dot/pp.prg
* harbour/contrib/dot/pp_harb.ch
* use _APMAIN as startup function
* cleaned direct access to item internals
* harbour/contrib/libct/Makefile
+ harbour/contrib/libct/ctwfunc.c
+ harbour/contrib/libct/ctwin.c
+ harbour/contrib/libct/ctwin.h
* added CT3 like Window System - it's a GT driver which inherits
from the existing one and adds CTW functionality
* harbour/contrib/libct/screen1.c
* updated for GTAPI modifications
* harbour/contrib/libnf/Makefile
* harbour/contrib/libnf/chdir.c
* harbour/contrib/libnf/mkdir.c
* harbour/contrib/libnf/rmdir.c
* use hb_fs*() API functions instead of calling DOS interrupts
Now NF dir functions works on all platforms - it will be nice
to update other functions too.
* harbour/contrib/libnf/dispc.c
* harbour/contrib/libnf/ftattr.c
* updated for GT API modifications, some of this code still depends
on EGA/VGA video buffer so will work only if user will force in GT
using it - it will be nice to rewrite them
* harbour/contrib/odbc/odbc.c
* harbour/contrib/ole/ole2.c
* casting and cleaning direct access to item internals
* harbour/contrib/rdd_ads/ads1.c
* harbour/contrib/rdd_ads/adsfunc.c
* harbour/contrib/rdd_ads/adsmgmnt.c
* synced with xHarbour
* harbour/include/Makefile
* added new header files
+ harbour/include/hbgtinfo.ch
+ added GTI_* defintions for hb_gtInfo() function.
This function works in similar way to dbInfo() in RDD.
The GTI_* definitions are taken from xHarbour "as is" and
they should be cleaned - not all functionality are supported
in Harbour and some others should be implemented in differ
way then in xHarbour.
+ harbour/include/hbgtcore.h
* harbour/include/hbapigt.h
* new GTAPI
hbgtcore.h file should not be included by user code
it's only for internal use in GT drivers
* HB_inkey_enum changed to int - this is bit field not enumerated type.
Many of C/C++ compilers forbid bit operations on enum types and
forcing it by casting which finally exceeds the enum range is defined
as bug because it may badly interacts with some compiler optimizations
* harbour/include/hbapi.h
* harbour/include/hbapicdp.h
* harbour/include/hbapierr.h
* harbour/include/hbapifs.h
* harbour/include/hbapiitm.h
* harbour/include/hbapilng.h
* harbour/include/hbapirdd.h
* harbour/include/hbdate.h
* harbour/include/hbdefs.h
* harbour/include/hbinit.h
* harbour/include/hbpcode.h
* harbour/include/hbrdddbf.h
* harbour/include/hbset.h
* harbour/include/hbstack.h
* harbour/include/hbvm.h
* harbour/include/hbvmopt.h
* harbour/include/hbvmpub.h
* separated internal and external API. Now the definitions for
internal HVM structures and functions are excluded by default
they could be enabled if user include hbvmopt.h before other
header files. Such operation should be done _ONLY_ by core
code - if 3-rd party developers make sth like that then it's
for their own risk and such code may stop to work with next
Harbour versions. Without hbvmopt.h the internal structures
like HB_ITEM, HB_DYNS, ... are mapped to 'void' so there is
no way to access their members so we can modify them in the
future without afford for 3-rd party code.
There is one small exception 'type' should be the first member
for HB_ITEM structure because I used a small ugly hack in
HB_IS_*() macros with castin PHB_ITEM to HB_TYPE* - it works
without speed overhead but if you think that it will be
better/cleaner to not use such tricks then it's enough to
change HB_ITEM_TYPE() definitions in hbvmpub.h - see note.
* cleared the usage of HB_EXPORT - to avoid problems with some C/C++
compilers we agreed that the only one common way of using HB_EXPORT
is adding it ad begining of declaration - please keep this convention
in the future.
+ added new functions:
hb_extIsObject(), hb_codeblockId(), hb_idleSleep(),
hb_fsGetOsHandle(),
hb_dynsymFindSymbol(), hb_dynsymGetSymbol(),
hb_dynsymSymbol(), hb_dynsymName(),
hb_dynsymMemvarHandle(), hb_dynsymAreaHandle(), hb_dynsymSetAreaHandle()
* changed hb_arrayClone() declaration to:
PHB_ITEM hb_arrayClone( PHB_ITEM pArray )
* changed hb_arrayFromParams() declaration to:
PHB_ITEM hb_arrayFromParams( int iLevel )
The previous version needed a pointer to stack relocatable area
so any stack resizing could cause GPF.
* harbour/include/inkey.ch
* added definitions for extended mouse keys/events and some key
combinations
* harbour/source/codepage/uc1250.c
* harbour/source/codepage/uc1251.c
* harbour/source/codepage/uc1253.c
* harbour/source/codepage/uc1257.c
* harbour/source/codepage/uc737.c
* harbour/source/codepage/uc850.c
* harbour/source/codepage/uc852.c
* harbour/source/codepage/uc866.c
* harbour/source/codepage/uc88591b.c
* harbour/source/codepage/uc8859_1.c
* harbour/source/codepage/uc8859_2.c
* harbour/source/codepage/uc8859_5.c
* harbour/source/codepage/uckoi8.c
* harbour/source/codepage/uckoi8u.c
* harbour/source/codepage/ucmaz.c
* updated unicode values for characters in rabge 1-31 to keep
DOS compatibility
* harbour/source/common/expropt1.c
* harbour/source/common/hbarch.c
* harbour/source/common/hbdate.c
* harbour/source/common/hbstr.c
* harbour/source/common/hbver.c
* keep HB_EXPORT at the beginning of function declaration
* harbour/include/hbpcode.h
* harbour/include/hbcomp.h
* harbour/source/compiler/harbour.c
* harbour/source/compiler/harbour.y
* harbour/source/compiler/hbfix.c
+ harbour/source/compiler/hbdead.c
* harbour/source/compiler/hbpcode.c
+ harbour/source/compiler/hbstripl.c
% rewritten jump optimization
! fixed some minor problems
* do not optimize jumps and local variable access by shorter
PCODE version and HB_P_NOOP when jump optimization is
disabled, this is a note I left in source code in few places:
/*
* optimizing jumps here by shorting them and setting HB_P_NOOPs
* only slow down the compilation process for three reasons:
* 1. When it's dummy jump to next instruction we need two passes
* in hb_compOptimizeJumps() to fully remove it
* 2. hb_compOptimizeJumps() also make jump shortcutting in each pass
* 3. When Jump Optimization is disabled (-kJ) then it cause slowness
* at runtime because we will have more HVM loops: first for the
* shorter jump and next for the HB_P_NOOP PCODE(s)
* [druzuz]
*/
+ added support for multi passes in jump/dead code elimination
(hb_compOptimizeJumps())
By default is set upto three passes.
Now hb_compOptimizeJumps() keeps all compiler internal data clean
on exist and can be called any times and does not change other
compiler's functions behaviors
+ added dummy jumps elimination
+ added optimization for:
IF .T.
IF .F.
WHILE .T.
WHILE .F.
etc.
* restored empty BEGIN/RECOVER sequence block elimination
if Jump Optimization is enabled then it marks the block
with HB_P_NOOPS else it cut the generated PCODE
+ added dead code eliminator (new functions hb_compCodeTraceMarkDead()/
hb_compPCodeTrace() - it works only when Jump Optimization is
not disabled)
As a result of the above we have smaller and faster PCODE.
I do not think that we will have meta code support in the reasonable
time and because I need some valid compiler data/structures like
updated table of all jumps for real C code (not PCODE in .c files)
generation then I decide to make some modifications and the above
is in practice a side effect of this work.
* harbour/source/rdd/dbcmd.c
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/rddord.prg
* harbour/source/rdd/workarea.c
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rdd/dbfntx/dbfntx1.c
* harbour/source/rdd/nulsys/nulsys.c
* synced with my modifications in xHarbour
* updated for API modifications
* harbour/source/rtl/Makefile
+ added gtsys.c, gtfunc.c, hbgtcore.c
* harbour/source/rtl/accept.c
* harbour/source/rtl/alert.prg
* harbour/source/rtl/cdpapi.c
* harbour/source/rtl/console.c
* harbour/source/rtl/dates.c
* harbour/source/rtl/do.c
* harbour/source/rtl/errorapi.c
* harbour/source/rtl/errorsys.prg
* harbour/source/rtl/file.c
* harbour/source/rtl/fserror.c
* harbour/source/rtl/fstemp.c
* harbour/source/rtl/hbffind.c
* harbour/source/rtl/idle.c
* harbour/source/rtl/math.c
* harbour/source/rtl/oldclear.c
* harbour/source/rtl/strmatch.c
* harbour/source/rtl/strpeek.c
* harbour/source/rtl/valtype.c
* harbour/source/rtl/xsavescr.c
* updated for API modifications
* cleaned some compiler warnings
* harbour/source/rtl/filesys.c
+ added hb_fsGetOsHandle()
* updated for API modifications
* harbour/source/rtl/gt.c
* harbour/source/rtl/gtapi.c
* harbour/source/rtl/gtapiu.c
+ harbour/source/rtl/gtfunc.c
+ harbour/source/rtl/gtsys.c
+ harbour/source/rtl/hbgtcore.c
* harbour/source/rtl/inkey.c
* harbour/source/rtl/maxrow.c
* harbour/source/rtl/mouseapi.c
* harbour/source/rtl/setcolor.c
* harbour/source/rtl/setposbs.c
* harbour/source/rtl/shadow.c
* new GT API code
* harbour/source/rtl/saverest.c
* changed default behavior in SEVESCREEN/RESTSCREEN with parameters
out of screen range to be Clipper compatible. Added last logical
parameter to keep previous behavior for programs which begins to
use it.
* harbour/source/rtl/seconds.c
* include missing header file to fix C++ compilation
* make hb_secondsCPU global function
* harbour/source/rtl/set.c
* make HB_SET_TYPEAHEAD Clipper compatible
* harbour/source/rtl/gtcgi/Makefile
* harbour/source/rtl/gtcgi/gtcgi.c
- harbour/source/rtl/gtcgi/mousecgi.c
* rewritten for new GT API
some detail behaviors has been changed but I think the current
implementation is better for CGI programs output - please check
and fix me if necessary
* harbour/source/rtl/gtcrs/Makefile
- harbour/source/rtl/gtcrs/charmap.prg
+ harbour/source/rtl/gtcrs/chrmap.c
- harbour/source/rtl/gtcrs/debug.map
- harbour/source/rtl/gtcrs/eterm.map
* harbour/source/rtl/gtcrs/gtcrs.c
+ harbour/source/rtl/gtcrs/gtcrs.h
+ harbour/source/rtl/gtcrs/hb-charmap.def
- harbour/source/rtl/gtcrs/kbdcrs.c
- harbour/source/rtl/gtcrs/keymap.prg
- harbour/source/rtl/gtcrs/linux.map
- harbour/source/rtl/gtcrs/mousecrs.c
* new GTCRS based on my xHarbour and Flagship curses code
Please not that at runtime it looks for a file
/etc/harbour/hb-charmap.def where user can fully tune output
for his terminal. This file is included with proper path in
binaries created by make_rpm.sh and make_tgz.sh
Ryszard I've removed some of your extensions which are no longer
necessary and some other (keyboard sequence redefinition) should
be done in a little bit differ way. I would like to talk about it
when you test current code.
Added support for extended mouse keys (middle button and wheel).
* harbour/source/rtl/gtdos/Makefile
* harbour/source/rtl/gtdos/gtdos.c
- harbour/source/rtl/gtdos/mousedos.c
* rewritten for new GT API
Fixed some small problems, finished mouse code which for DJGPP
is fully Clipper compatible with real mouse SAVE/RESTORE code.
For other compilers it should be updated depending on memory
model and used DPMI driver (if any).
* harbour/source/rtl/gtos2/Makefile
* harbour/source/rtl/gtos2/gtos2.c
- harbour/source/rtl/gtos2/mouseos2.c
* rewritten for new GT API
Fixed some problems and finished the mouse code.
Please test it - I made all modifications without OS2 and
I was not able to make any test. I'm interesting in information
if it works and the speed difference - f.e. results from
tests/vidtest.prg run with previous and current version.
* harbour/source/rtl/gtpca/Makefile
* harbour/source/rtl/gtpca/gtpca.c
- harbour/source/rtl/gtpca/kbdos2.gcc
- harbour/source/rtl/gtpca/mousepca.c
* rewritten for new GT API
and finished so now it's full functional GT driver
I'm interesting in keyboard sequences used by PC-ANSI drivers
in DOS so it will be possible to implement also support for
extended keys input.
* harbour/source/rtl/gtsln/Makefile
* harbour/source/rtl/gtsln/gtsln.c
+ harbour/source/rtl/gtsln/gtsln.h
* harbour/source/rtl/gtsln/kbsln.c
* harbour/source/rtl/gtsln/keytrans.c
* harbour/source/rtl/gtsln/mousesln.c
* rewritten for new GT API basing on current xHarbour code
added support for slang 1.4x patched for UNICODE (Debian
patches used by most of current Linux distributions) and
slang 2.x - It's unicode ready, tries to detect terminal mode
(utf-8/iso) at startup and switch the internal logic to
iso/unicode mode. When compiled with slang 1.4x or 2.x
and terminal is in UTF-8 it can display all characters like
in DOS if only used font have them or good fall-back table is
loaded (f.e. the one created by QRCZAK)
Added support for extended mouse keys (middle button and wheel).
* harbour/source/rtl/gtstd/Makefile
* harbour/source/rtl/gtstd/gtstd.c
- harbour/source/rtl/gtstd/mousestd.c
* rewritten for new GT API
Now it can work as full screen GT driver redrawing the previous
screen contents from internal GT core buffers. I run with this
GT some of my programs and they work quite well ;-) of course
without colors.
* harbour/source/rtl/gtwin/Makefile
* harbour/source/rtl/gtwin/gtwin.c
- harbour/source/rtl/gtwin/mousewin.c
* updated for new GT API
+ harbour/source/rtl/gtxwc/Makefile
+ harbour/source/rtl/gtxwc/gtxwc.c
+ harbour/source/rtl/gtxwc/gtxwc.h
* new XWindow Console GT driver based on my and Giancarlo Niccolai
code form xHarbour - this GT can work in XWindow environment only
and create its own window for console output. It delays the
initialization to the moment when user try to display anything on
the screen so even without X Window system programs which uses this
GT can work as long as use only outstd/outerr output.
* harbour/source/vm/arrays.c
* updated for API modifications
+ added hb_arrayId(),
* changed hb_arrayClone() declaration to:
HB_EXPORT PHB_ITEM hb_arrayClone( PHB_ITEM pSrcArray )
* changed hb_arrayFromParams() declaration to:
PHB_ITEM hb_arrayFromParams( int iLevel )
* harbour/source/vm/arrayshb.c
* updated for API modifications
+ added new parameter iLevel to function HB_APARAMS()
* harbour/source/vm/classes.c
* harbour/source/vm/cmdarg.c
* harbour/source/vm/dynlibhb.c
* harbour/source/vm/estack.c
* harbour/source/vm/fm.c
* harbour/source/vm/garbage.c
* harbour/source/vm/maindll.c
* harbour/source/vm/maindllh.c
* harbour/source/vm/maindllp.c
* harbour/source/vm/mainstd.c
* harbour/source/vm/mainwin.c
* harbour/source/vm/memvars.c
* harbour/source/vm/pcount.c
* harbour/source/vm/proc.c
* updated for API modifications
* harbour/source/vm/codebloc.c
* updated for API modifications
+ added hb_codeblockId()
* harbour/source/vm/dynsym.c
* updated for API modifications
+ added new functions:
hb_dynsymFindSymbol(), hb_dynsymGetSymbol(),
hb_dynsymSymbol(), hb_dynsymName(),
hb_dynsymMemvarHandle(), hb_dynsymAreaHandle(), hb_dynsymSetAreaHandle()
* harbour/source/vm/eval.c
* updated for API modifications
* call hb_vmPushState()/hb_vmPopState() in hb_itemDo()/hb_itemDoC()
functions - it's necessary to make HVM reentrant safe.
* harbour/source/vm/extend.c
* updated for API modifications
+ added hb_extIsObject() similar to existing hb_extIsArray()
* harbour/source/vm/hvm.c
* updated for API modifications
+ added new functions: hb_vmPushState(), hb_vmPopState()
which save/restore HVM state (the top stack value which can be
processed and return item and maybe sth else in the future) making
HVM ready for reentrant.
* harbour/source/vm/itemapi.c
* updated for API modifications
+ added new function:
HB_EXPORT PHB_SYMB hb_itemGetSymbol( PHB_ITEM pItem );
! fixed bug in hb_itemPutNInt()
* harbour/tests/Makefile
* harbour/utils/hbdoc/Makefile
* harbour/utils/hbextern/Makefile
* harbour/utils/hbmake/Makefile
* harbour/utils/hbrun/Makefile
* harbour/utils/hbtest/Makefile
- removed badly added: dbfntx, dbfcdx, dbffpt, hbsix libraries.
what broke GNU make compilation for some compilers
This libraries should be included automatically when RDD lib
is included by *.cf files
Summary:
The whole patch (cvs diff -uN) is ~1.5MB length and I cannot describe
everything in details - sorry but it was too much modifications in
one commit so now just some of general notes.
The header files included as is does not have any information about
internal HVM structures and some functions. In practice only HB_SYMB
is public and it has to be public for .c files generated from .prg
so I force the fixed size of this structure (alignment independent)
by redefining some members to union with void * - it's a little bit
ugly trick but it effectively eliminates the problem of linking
binaries compiled with differ alignment C compiler switches.
The structures like HB_ITEM, HB_CODEBLOCK, HB_STACK, HB_DYNS are not
longer defined and pointers to the defined as void * - like in Clipper
the ITEM structure. It caused that I had to add some new functions
to make some operation still possible to implement. If I missed sth
and any of you will have a problem with your code then please inform
me about it and after a small discussion on Harbour developers list
we can decide if other functions should be added.
The internal API is still accessible. It's enough to include "hbvmopt.h"
file before other header files to enable it. Now only files in
source/vm directory include it.
The 3-rd party code which does not include hbvmopt.h (or tries to
set some internals macros) should be safe for future HVM modifications
and will work also with new binaries so 3-rd party library developers
should remember about it. If they won't then it's only their and
their clients problem not Harbour developers.
With this modifications I also create new GT model which is similar
to the one used by RDD with multi inheritance. It can be quite easy
extended to simultaneously load more then one GT subsystem (sth like
work areas in RDD) but I left it for the future when someone may
need it. hbapigt.h file now contains only information about public
functions and does not have any code which depends on current
internal implementation - it should be backword compatible as long
as somone did not try to use internal GT functions.
The internal GT system use hbgtcore.h file which should not be
included by 3-rd party code as long as someone will not make new
GT driver. The internal GT code is new so I expect that it will
be changed yet in the nearest future (I'm waiting for other developers
feedback) and in such case any 3-rd party GTs will have to be updated.
How it works:
The base GT driver (GTNUL) is fully functional GT driver which
makes all operations on memory buffer. After each screen write
Flush() method is called which check for dispcount() and if
it's 0 then call Refresh() method to update modified area by
Redraw() method. This method is dummy in GTNUL and external
output with this GT can be reached by outstd()/outerr() which
are now redirected to GT methods. A simple GT driver may overload
only Refresh() method to give full screen output.
Application can use only this GT driver and it seems to be very
good choice for GUI and background daemon/service programs.
This GT is loaded at startup then all other GTs can be loaded
later and inherit from the previously loaded GT drivers.
The new GT driver can overload as much method as wants/needs.
Now all GT operations are implemented as GT method so GT driver
can easy change their default behavior, f.e. it may fully overload
color parsing methods and use differ or extended to Clipper color
definitions.
I rewrote all existing GTs to work with new GT model.
OS2 users - please test GTOS2 which I was not able to test and
see the note in Redraw() method. If possible please make some
speed tests.
In fact now there is much more internal operations then it was
before but because they are done on memory only then current
code is much faster in this GT drivers which so far makes all
operations on real video area. I made some tests with GTNUL
and tests/vidtest.prg and the total overhead is minimal. Now
dipbegin()/dispend() in practice does not cost anything so it
gives additional speed improvement in application which extensively
use it.
More then one GT driver can be linked with final binaries and
chose on application startup by //GT<NAME> switch and/or environment
variable HB_GT=<name>
In the RTL is new GT function GTSYS() which works in similar way
to RDDSYS() in RDD subsystem and for linking default GT driver
for given platform. When RTL is compiled the default GT driver
is set to HB_GT_DEFAULT envvar and if not exist to HB_GT_LIB
envvar and if it also does not exist to hard coded platfom GTs
(see source/rtl/gtsys.c and source/rtl/Makefile for rules)
Adding to source code:
ANNOUNCE GTSYS
disable linking the default GT driver and:
REQUEST HB_GT_<name>
for linking given (<name>) GT driver, f.e.: REQUEST HB_GT_WIN
If you are working in SH environment (Linux and other *nixes users,
DJGPP bash, MinGW shell then it's possible to use -gt<name> switch
in hblnk / hbmk scripts to force linking GT drivers (it could be
repeated with different <name>) and the first one becomes the default
one. F.e.:
xhbmk -m -n -w -es2 -gtcrs -gtsln -gtstd -gtpca vidtest.prg
Usually the GT driver are loaded at HVM startup but it's possible
to load it later. I created new GT driver CTW which gives full
CT3 like Window system. The CT3 extended driver change the behavior
of some function in Clipper extended driver, f.e WRITECON() or
SETPOS() with parameters out of screen range. So I implemented it
CTW as RT GTs which is loaded when some of CTWIN function is used
(f.e. WOPEN()/WBOARD()) and inherits from any existing GT driver.
This is full CT3 WIN implementation with all detail behaviors I
found (with some CT3 bug fixes). It does not have any CT3 limitations
and can be used for any virtual screen/window size though I hardcoded
CT3 limitation for backword compatibility. If somone will want to
remove it then it will be enough to delete few lines from ctwin.c
file. I'm not CTWIN Clipper user so maybe I missed some side effects
in this driver and was not able to well test it so if you will find
any incompatibilities then please inform me.
THe default GT buffer uses 32bit character cell internally but
in savescreen/restscreen it uses VGA compatible two bytes character
cell. Some GT drivers may want to use differ character cell.
Now GTCRS and GTSLN use 32bit character cell by default. They
need additional information about character set (box/normal) to
properly display box characters. It is possible to force in this
GT drivers using Clipper compatible character cell by calling:
hb_gtInfo( GTI_COMPATBUFFER, <lCompat> ) -> <lPreviousSeting>
but in may cause that box drawing characters will be lost in
some countries after RESTSCREEN(). It will depend on used code
page.
HB_GTINFO() is new function which works in similar way to DBINFO()
in RDD. It allows to retrieve/change some of GT driver settings.
GTI_* actions are defined in hbgtinfo.ch - it has all GTI_*
definitions used in xHarbour. Now in Harbour only few of them
are implemented.
The new three .prg functions:
HB_SETKEYCP( <cTermCP> [,<cHostCP>] )
HB_SETDISPCP( <cTermCP> [,<cHostCP>] [,<lBoxChar>] )
HB_SETTERMCP( <cTermCP> [,<cHostCP>] [,<lBoxChar>] )
have been added. They set automatic input (HB_SETKEYCP)
and output (HB_SETDISPCP) (or both: HB_SETTERMCP) character
translation. They are also important for some GTs which
informing them about used internal code page for unicode
translation (GTXWC, GTSLN) and/or chosing proper character
set (standard/alternate) for letters and other (f.e. box
drawing characters) (GTCRS, GTSLN),
<cTermCP> is encoding used on external (terminal) side
<cHostCP> is encoding used internally, if not given then
current code page set HB_SETCODEPAGE() is used.
some of GTs which uses unicode output may
ignore <cTermCP>
<lBoxChar> is optional parameter which interacts with dispbox()
output disabling switching to alternate character
set in some GTs. It effectively causes that if internal
(host) code page contains some letters on the box char
positions then they will be shown also by box drawing
functions like dispbox() instead of CP437 characters.
In some cases it could be useful. By default lBoxChar
is not set and GTs which can switch between standard
and alternate character set (GTCRS, GTSLN) will try to
use alternate character set for box drawing functions.
Victor: I removed some of your functions. They can be very easy
implemented with hb_gt_GetChar()/hb_gt_PutChar() but I do not want to
make them part of documented external API because some GT drivers may
want to use absolutely differ color definitions and they will stop to
work so I do not want to make this functions documented external API.
Ryszard: Setting alternative debug keys does not longer work.
I like such possibilities but it should be implemented in differ
way to f.e. using HB_GTINFO interface to allow low level GT driver
extensions, f.e. in *nixes using CTRL+[A-Z] and SIGINT, SIGQUIT,
SIGTSTP signals for real asynchronous setting of debug/cancel flag
without keyboard polling from main HVM loop. I would like to discus
about such more general solution.
*** Please updated non GNU make files ***
|
||
|
|
188575920d |
2005-10-24 02:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/dot/pp.prg
* harbour/contrib/dot/pp_harb.ch
* harbour/include/hbapi.h
* harbour/include/hbapirdd.h
* harbour/include/hbdefs.h
* harbour/include/hbextern.ch
* harbour/include/hbinit.h
* harbour/include/hbstack.h
* harbour/include/hbsxfunc.h
* harbour/include/hbvm.h
+ harbour/include/hbvmopt.h
* harbour/include/hbvmpub.h
* harbour/source/codepage/cdp_tpl.c
* harbour/source/codepage/cdppl852.c
* harbour/source/codepage/cdppliso.c
* harbour/source/codepage/cdpplmaz.c
* harbour/source/codepage/cdpplwin.c
* harbour/source/compiler/genc.c
* harbour/source/compiler/harbour.c
* harbour/source/lang/msgca.c
* harbour/source/lang/msgpl852.c
* harbour/source/lang/msgpliso.c
* harbour/source/lang/msgplmaz.c
* harbour/source/lang/msgplwin.c
* harbour/source/rdd/Makefile
* harbour/source/rdd/dbcmd.c
- harbour/source/rdd/dbf0.prg
* harbour/source/rdd/dbf1.c
- harbour/source/rdd/delim0.prg
* harbour/source/rdd/delim1.c
* harbour/source/rdd/rddsys.prg
- harbour/source/rdd/sdf0.prg
* harbour/source/rdd/sdf1.c
* harbour/source/rdd/dbfcdx/Makefile
- harbour/source/rdd/dbfcdx/dbfcdx0.prg
* harbour/source/rdd/dbfcdx/dbfcdx1.c
- harbour/source/rdd/dbfcdx/sixcdx0.prg
* harbour/source/rdd/dbfdbt/Makefile
- harbour/source/rdd/dbfdbt/dbfdbt0.prg
* harbour/source/rdd/dbfdbt/dbfdbt1.c
* harbour/source/rdd/dbffpt/Makefile
- harbour/source/rdd/dbffpt/dbffpt0.prg
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rdd/dbfntx/Makefile
* harbour/source/rdd/dbfntx/dbfntx0.prg
* harbour/source/rdd/dbfntx/dbfntx1.c
* harbour/source/rdd/hbsix/Makefile
* harbour/source/rdd/hbsix/sxcompr.c
* harbour/source/rdd/hbsix/sxcrypt.c
* harbour/source/rdd/hbsix/sxdate.c
* harbour/source/rdd/hsx/hsx.c
* harbour/source/rdd/nulsys/nulsys.prg
* harbour/source/rtl/browdbx.prg
* harbour/source/rtl/cdpapi.c
* harbour/source/vm/arrays.c
* harbour/source/vm/arrayshb.c
* harbour/source/vm/asort.c
* harbour/source/vm/break.c
* harbour/source/vm/classes.c
* harbour/source/vm/cmdarg.c
* harbour/source/vm/codebloc.c
* harbour/source/vm/debug.c
* harbour/source/vm/dynlibhb.c
* harbour/source/vm/dynsym.c
* harbour/source/vm/estack.c
* harbour/source/vm/eval.c
* harbour/source/vm/evalhb.c
* harbour/source/vm/extend.c
* harbour/source/vm/fm.c
* harbour/source/vm/garbage.c
* harbour/source/vm/hvm.c
* harbour/source/vm/initsymb.c
* harbour/source/vm/itemapi.c
* harbour/source/vm/macro.c
* harbour/source/vm/maindllp.c
* harbour/source/vm/memvars.c
* harbour/source/vm/memvclip.c
* harbour/source/vm/pcount.c
* harbour/source/vm/proc.c
* harbour/source/vm/pvalue.c
* harbour/source/vm/runner.c
* remove default API and stack macros. Now API/stack macros can be
enabled by including hb_vmopt.h file.
This file should be included _ONLY_ by core code because binary
object/libraries generated after can work only with _EXACTLY_ the
same HVM compiled the same C alignment switches
* cleaned some HB_EXTERN_C declaration - Anotonio you should be able
to build FWH now
* cleaned startup initialization code -
please update lang and codepage files - I only updated
source/codepage/cdppl*.c and source/lang/msgpl*.c files
Or other files should be updated or they will not work MSC
* synced with recent xHarbour modification in RDD init code
|
||
|
|
05daa044c2 | two minor changes required for 64 bits support | ||
|
|
78070e00c4 |
2004-12-31 12:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicdp.h
* harbour/source/codepage/cdp_tpl.c
* harbour/source/codepage/cdpeldos.c
* harbour/source/codepage/cdpelwin.c
* harbour/source/codepage/cdpesdos.c
* harbour/source/codepage/cdpeswin.c
* harbour/source/codepage/cdpgedos.c
* harbour/source/codepage/cdpgewin.c
* harbour/source/codepage/cdphu852.c
* harbour/source/codepage/cdphuwin.c
* harbour/source/codepage/cdppl852.c
* harbour/source/codepage/cdppliso.c
* harbour/source/codepage/cdpplmaz.c
* harbour/source/codepage/cdpplwin.c
* harbour/source/codepage/cdppt850.c
* harbour/source/codepage/cdpptiso.c
* harbour/source/codepage/cdpru866.c
* harbour/source/codepage/cdprukoi.c
* harbour/source/codepage/cdpruwin.c
* harbour/source/codepage/cdpsl437.c
* harbour/source/codepage/cdpsl852.c
* harbour/source/codepage/cdpsliso.c
* harbour/source/codepage/cdpslwin.c
* harbour/source/codepage/cdpsrwin.c
* harbour/source/rtl/cdpapi.c
* fix memory leak reported for accented and multi byte CPs
+ harbour/source/codepage/cdpesmwi.c
* added missing Spanish modern CP
* harbour/include/hbstack.h
* harbour/include/hbapiitm.h
* harbour/source/vm/estack.c
* harbour/source/vm/itemapi.c
+ added hb_stackReturnItem()
- removed hb_itemReturnPtr()
* harbour/source/rdd/workarea.c
! fixed possible restoring of scopes in scoped relations after
'SET RELATION TO'
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* harbour/source/rdd/dbfdbt/dbfdbt1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* use hb_stackReturnItem() instead of direct stack accessing
* harbour/source/rdd/dbfntx/dbfntx1.c
! Fixed opening NTX file in ReadOnly mode
* use hb_stackReturnItem() instead of direct stack accessing
* harbour/source/rtl/filesys.c
* cleaned unnecessary initialization
* harbour/source/vm/memvars.c
* formatting and small fix for calling GC after hb_memvarsRelease()
|
||
|
|
e4ac791059 |
2004-12-28 10:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/harbour.spec
* harbour/hbgtmk.sh
* harbour/make_rpm.sh
* harbour/bin/pack_src.sh
* updated for recent changes in make process
* harbour/contrib/Makefile
* added odbc lib for Linux compilation
* harbour/contrib/btree/Makefile
* changed lib name from hb_btree to hbtree
* harbour/contrib/btree/hb_btree.api
* harbour/contrib/btree/hb_btree.c
* fixed GCC compilation in HB_TR_DEBUG mode
* harbour/contrib/hbzlib/hbzip.h
* harbour/contrib/hbzlib/include/hbzip.h
* harbour/include/hbapi.h
* harbour/include/hbapicdp.h
* harbour/include/hbapierr.h
* harbour/include/hbapifs.h
* harbour/include/hbapigt.h
* harbour/include/hbapiitm.h
* harbour/include/hbapilng.h
* harbour/include/hbapirdd.h
* harbour/include/hbcomp.h
* harbour/include/hbdate.h
* harbour/include/hbdbsort.h
* harbour/include/hberrors.h
* harbour/include/hbexprb.c
* harbour/include/hbexprop.h
* harbour/include/hbhash.h
* harbour/include/hbinit.h
* harbour/include/hbmacro.h
* harbour/include/hbpp.h
* harbour/include/hbrdddel.h
* harbour/include/hbrddntx.h
* harbour/include/hbrddsdf.h
* harbour/include/hbrddwrk.h
* harbour/include/hbset.h
* harbour/include/hbstack.h
* harbour/include/hbtrace.h
* harbour/include/hbvm.h
* harbour/include/hbvmpub.h
* changed #if defined (HB_EXTERN_C) to HB_EXTERN_BEGIN / HB_EXTERN_END
macros for easier manipulation with different ABI
* added HB_IS_BADITEM() macro for debugging
* synced CDP with xHarbour - added basic Unicode support
* synced RDD with xHarbour
* harbour/source/codepage/Makefile
* harbour/source/codepage/cdp_tpl.c
* harbour/source/codepage/cdpeldos.c
* harbour/source/codepage/cdpelwin.c
* harbour/source/codepage/cdpesdos.c
* harbour/source/codepage/cdpeswin.c
* harbour/source/codepage/cdpgedos.c
* harbour/source/codepage/cdpgewin.c
* harbour/source/codepage/cdphu852.c
* harbour/source/codepage/cdphuwin.c
* harbour/source/codepage/cdppl852.c
* harbour/source/codepage/cdppliso.c
* harbour/source/codepage/cdpplmaz.c
* harbour/source/codepage/cdpplwin.c
* harbour/source/codepage/cdppt850.c
* harbour/source/codepage/cdpptiso.c
* harbour/source/codepage/cdpru866.c
* harbour/source/codepage/cdprukoi.c
* harbour/source/codepage/cdpruwin.c
* harbour/source/codepage/cdpsl437.c
* harbour/source/codepage/cdpsl852.c
* harbour/source/codepage/cdpsliso.c
* harbour/source/codepage/cdpslwin.c
* harbour/source/codepage/cdpsrwin.c
+ harbour/source/codepage/uc1250.c
+ harbour/source/codepage/uc1251.c
+ harbour/source/codepage/uc1253.c
+ harbour/source/codepage/uc1257.c
+ harbour/source/codepage/uc737.c
+ harbour/source/codepage/uc850.c
+ harbour/source/codepage/uc852.c
+ harbour/source/codepage/uc866.c
+ harbour/source/codepage/uc88591b.c
+ harbour/source/codepage/uc8859_1.c
+ harbour/source/codepage/uc8859_2.c
+ harbour/source/codepage/uckoi8.c
+ harbour/source/codepage/uckoi8u.c
+ harbour/source/codepage/ucmaz.c
* harbour/source/rtl/cdpapi.c
* synced HB CDP API with xHarbour - added basic Unicode support
* harbour/source/common/expropt2.c
* harbour/source/common/hbstr.c
* removed unnecessary initialization to avoid BCC warnings
* harbour/source/compiler/harbour.c
* formatting
hb_compCodeBlockStop() looks like work in progress or is has
some old unused code - Ryszard, can you look at it?
* harbour/source/macro/macro.y
* removed hack for GCC and old Bison versions
* harbour/source/pp/ppcore.c
* removed unnecessary initialization to avoid BCC warnings
* harbour/source/pp/pptable.c
+ added some sets for RDD synchronization with xHarbour
* harbour/source/rdd/dbcmd.c
+ added __RDDGETTEMPALIAS
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/dbfuncs.prg
* harbour/source/rdd/dbnubs.c
* harbour/source/rdd/dbstrux.prg
* harbour/source/rdd/hbdbsort.c
* harbour/source/rdd/rddord.prg
* harbour/source/rdd/workarea.c
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* harbour/source/rdd/dbfdbt/dbfdbt1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rdd/dbfntx/dbfntx1.c
* synchronized with xHarbour - still dbcmd.c has to be synced yet
! fixed all known bugs
Alexander, please look at DBFNTX - I hope all is correct.
* harbour/source/vm/codebloc.c
* formatting
* harbour/source/vm/fm.c
+ added HB_PARANOID_MEM_CHECK to force reallocations in hb_xrealloc
and fill allocated and freed memory with HB_MEMFILER (0xff by default)
It's for debugging only.
* harbour/source/vm/hvm.c
! fixed hb_vmTopNumber() declaration for BCC
* use hb_gcCollectAll() at HVM exit instead of hb_gcReleaseAll() to
report allocated and not freed items - It could caused that some
programs begin to report memory leaks.
* harbour/source/vm/itemapi.c
* check for HB_IS_BADITEM inside hb_itemClear() when compiled with
HB_PARANOID_MEM_CHECK for debugging
* harbour/source/vm/memvars.c
* formatting
! fixed pItem initialization in hb_memvarDetachLocal()
BTW - is this really necessary? I copy it form hb_itemUnRef()
but in fact it cannot detect all possible item reference cycles
if they appear - can they appear?
|
||
|
|
8f2352f7fe |
2004-12-12 02:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/config/hpux/dir.cf
+ harbour/config/hpux/gcc.cf
+ harbour/config/hpux/global.cf
+ harbour/config/hpux/install.cf
* Marcelo's files build files for HPUX borrowed from xHarbour
* harbour/bin/hb-func.sh
* harbour/bin/hb-mkslib.sh
* harbour/bin/postinst.sh
* recent Phil's changes for Darwin and some of mine modifications and
cleanups
* harbour/include/Makefile
+ added some missing header files
* harbour/include/hbapi.h
+ added HB_ITEM_{GET|PUT}_NUMINTRAW() macros
+ added hb_objGetClass()
* harbour/include/hbdefs.h
* redefined multi commands macros to use do {...} while(0) for safe
use in any of C statement
+ added HB_OS_HPUX
* harbour/include/hbsetup.h
+ added HB_OS_HPUX
* harbour/include/hbstack.h
* hb_stackDec(), hb_stackPop(), hb_stackPush() redefined also as macros
when HB_STACK_MACROS is set
+ added function hb_stackIncrease()
* harbour/source/common/hbstr.c
* fixed possible buffer overflow
* harbour/include/hbrdddbf.h
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/workarea.c
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* harbour/source/rdd/dbfdbt/dbfdbt1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* my recent fixes in xHarbour
* harbour/source/rtl/copyfile.c
* small fix to error message
* harbour/source/rtl/idle.c
+ added HB_IDLESLEEP() and
void hb_idleSleep( double dSeconds )
* harbour/source/rtl/isprint.c
* use hb_xgrab()/hb_xfree() instead of malloc()/free()
* harbour/source/rtl/run.c
* added __WATCOMC__ to C compilers supporting system()
* harbour/source/vm/arrays.c
* cleaned hb_arrayFromStack(), hb_arrayFromParams()
* harbour/source/vm/arrayshb.c
* small fixes to error messages
! improved Clipper compatibility in AFILL()
* harbour/source/vm/asort.c
* separate entry for integer items - conversion to double may
damage big 64bit numbers
* harbour/source/vm/classes.c
+ added USHORT hb_objGetClass( PHB_ITEM pItem )
* harbour/source/vm/dynsym.c
! fixed accessing to uninitialized memory
* harbour/source/vm/estack.c
+ added hb_stackIncrease() and modification for new stack macros
* harbour/source/vm/hvm.c
* fixed some error messages
* some speed improvements
* harbour/source/vm/itemapi.c
* some small optimizations
* harbour/utils/hbtest/rt_misc.prg
* modified file name conversions test results for __PLATFORM__UNIX
|
||
|
|
a4bed99897 | 2004-04-16 13:55 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su> | ||
|
|
dcd06c1da2 | 2003-01-24 14:00 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su> | ||
|
|
6f6927ac25 |
2002-01-21 00:19 UTC+0100 Maurilio Longo <maurilio.longo@libero.it>
* include/hbstack.h
! fixed a few errors inside macro definition of stack operations
-DHB_STACK_MACROS defined
|
||
|
|
0e07837322 | See ChangeLog entry 2001-04-12 15:00 UTC-0400 David G. Holm <dholm@jsd-llc.com> | ||
|
|
cae8dad460 | Initial revision |