2011-02-15 00:48 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbapicls.h
  * harbour/src/vm/classes.c
    + added new C function
         HB_SIZE hb_clsGetVarIndex( HB_USHORT uiClass, PHB_DYNS pVarSym );
      which can be used as hack to speedup accessing some object instance
      variables
This commit is contained in:
Przemyslaw Czerpak
2011-02-14 23:48:59 +00:00
parent dffcf7871f
commit a3d538cae5
3 changed files with 29 additions and 0 deletions

View File

@@ -16,6 +16,14 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-02-15 00:48 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
* harbour/src/vm/classes.c
+ added new C function
HB_SIZE hb_clsGetVarIndex( HB_USHORT uiClass, PHB_DYNS pVarSym );
which can be used as hack to speedup accessing some object instance
variables
2011-02-15 00:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbide/idemain.prg
+ Minor to prev. Now possible to build hbide with RDDADS

View File

@@ -116,6 +116,7 @@ extern HB_EXPORT const char * hb_clsFuncName( HB_USHORT uiClass );
extern HB_EXPORT const char * hb_clsMethodName( HB_USHORT uiClass, HB_USHORT uiMethod );
extern HB_EXPORT PHB_SYMB hb_clsFuncSym( HB_USHORT uiClass );
extern HB_EXPORT HB_BOOL hb_clsIsParent( HB_USHORT uiClass, const char * szParentName ); /* is a class handle inherited from szParentName Class ? */
extern HB_EXPORT HB_SIZE hb_clsGetVarIndex( HB_USHORT uiClass, PHB_DYNS pVarSym );
extern HB_EXPORT HB_USHORT hb_clsFindClass( const char * szClass, const char * szFunc );
/* object management */

View File

@@ -1404,6 +1404,26 @@ const char * hb_clsMethodName( HB_USHORT uiClass, HB_USHORT uiMethod )
return NULL;
}
HB_SIZE hb_clsGetVarIndex( HB_USHORT uiClass, PHB_DYNS pVarSym )
{
if( uiClass && uiClass <= s_uiClasses )
{
PMETHOD pMethod = hb_clsFindMsg( s_pClasses[ uiClass ], pVarSym );
if( pMethod )
{
PHB_SYMB pFuncSym = pMethod->pFuncSym;
if( pFuncSym == &s___msgSync || pFuncSym == &s___msgSyncClass )
pFuncSym = pMethod->pRealSym;
if( pFuncSym->value.pFunPtr == HB_FUNCNAME( msgSetData ) ||
pFuncSym->value.pFunPtr == HB_FUNCNAME( msgGetData ) )
return pMethod->uiData + pMethod->uiOffset;
}
}
return 0;
}
HB_USHORT hb_clsFindClass( const char * szClass, const char * szFunc )
{
HB_USHORT uiClass;