Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

nci/suif/suif2b/j2s/j2s_runtime/rt_macros.h File Reference

#include <assert.h>

Defines

#define ASSERT(expr)    assert((expr))
#define DBG_ASSERT(expr)    assert((expr))
#define ASSERT_CLASS_ID(id)    ASSERT(((id) >= 0) && ((id) < j2s_AllClassesNum))
#define ASSERT_ATYPE(x)    ASSERT((T_BOOLEAN <= (x)) && ((x) <= T_LONG))
#define B(expr)    ((expr) ? B_TRUE : B_FALSE)
#define WS_MASK   (sizeof(int) - 1)
#define WORD_SIZE   (sizeof(int))
#define STRUCT2BYTES(x)    ((sizeof(x) + WS_MASK) & ~WS_MASK)
#define ROUND_BYTES_UP(x)    (((x) + WS_MASK) & ~WS_MASK)
#define SHOWERR(s)    fprintf(stderr, s)
#define SHOWERR1(s, p1)    fprintf(stderr, s, p1)
#define SHOWERR2(s, p1, p2)    fprintf(stderr, s, p1, p2)
#define SHOWERR3(s, p1, p2, p3)    fprintf(stderr, s, p1, p2, p3)
#define FSHOWERR(s)    {fprintf(stderr, s); fflush(stderr);}
#define FSHOWERR1(s, p1)    {fprintf(stderr, s, p1); fflush(stderr);}
#define FSHOWERR2(s, p1, p2)    {fprintf(stderr, s, p1, p2); fflush(stderr);}
#define FSHOWERR3(s, p1, p2, p3)    {fprintf(stderr, s, p1, p2, p3); fflush(stderr);}
#define DUMP(level, s)    {IndentLevel(stderr, level);fprintf(stderr, s);}
#define DUMP1(level, s, p1)    {IndentLevel(stderr, level);fprintf(stderr, s, p1);}
#define DUMP2(level, s, p1, p2)    {IndentLevel(stderr, level);fprintf(stderr, s, p1, p2);}
#define DUMP3(level, s, p1, p2, p3)    {IndentLevel(stderr, level);fprintf(stderr, s, p1, p2, p3);}
#define RT_ALLOC(x)    RT::Heap::alloc(x)
#define RT_ALLOC_ATOMIC(x)    RT::Heap::alloc_atomic(x)
#define RT_FREE(x)    RT::Heap::free((void *) (x))
#define IS_VALID_PTR(p)    (((p) != NULL))
#define ASSERT_PTR(p)    ASSERT(IS_VALID_PTR((p)) == B_TRUE)
#define DBG_ASSERT_PTR(p)    DBG_ASSERT(IS_VALID_PTR((p)) == B_TRUE)
#define HIDE_NICE_CLASS(c)
#define THROW(id)    NThrowable::_throw_(id, "")
#define THROW_MSG(id, msg)    NThrowable::_throw_(id, msg)
#define EH_ADDR_CUR()
#define EH_GET_CUR()
#define EH_SET_CUR(exc)
#define EH_ARG
#define EH_GET_ARG()
#define EH_SET_ARG(exc)
#define INITIAL_INDENT_LEVEL   1
#define NEW(x)    (x *) RT_ALLOC(sizeof(x))
#define NEW_ATOMIC(x)    (x *) RT_ALLOC_ATOMIC(sizeof(x))
#define GC_GARBAGE(x)    x = NULL;
#define NO_SUPER_CLASS   NULL
#define INIT_INSTANCE_FIELD(C, o)
#define INIT_HIDDEN_INSTANCE_FIELD(C, o)
#define INIT_CLASS_FIELD(C, o)
#define SYM_PROC(proc_name)
#define SYM_VAR(proc_name)
#define SYM_FNPTR(proc_name)
#define TYPEDEF_PROC_0(proc_name, rv)
#define DECL_PROC_0(proc_name, rv)
#define TD_DECL_PROC_0(proc_name, rv)
#define TYPEDEF_PROC_1(proc_name, rv, arg1)
#define DECL_PROC_1(proc_name, rv, arg1)
#define TD_DECL_PROC_1(proc_name, rv, arg1)
#define TYPEDEF_PROC_2(proc_name, rv, arg1, arg2)
#define DECL_PROC_2(proc_name, rv, arg1, arg2)
#define TD_DECL_PROC_2(proc_name, rv, arg1, arg2)
#define TYPEDEF_PROC_3(proc_name, rv, arg1, arg2, arg3)
#define DECL_PROC_3(proc_name, rv, arg1, arg2, arg3)
#define TD_DECL_PROC_3(proc_name, rv, arg1, arg2, arg3)
#define VAR_PROC(proc_name)
#define INIT_FNPTR(clazz_name, clazz, name, descriptor)
#define DEF_SET_INSTANCE_FIELD(_f, _t, _at)
#define DEF_GET_INSTANCE_FIELD(_f, _t, _at)
#define DEF_INSTANCE_FIELD(_f, _t, _at)
#define DEFX_SET_INSTANCE_FIELD(_f, _t, _at)
#define DEFX_GET_INSTANCE_FIELD(_f, _t, _at)
#define DEFX_INSTANCE_FIELD(_f, _t, _at)
#define DEF_SET_CLASS_FIELD(_f, _t, _at)
#define DEF_GET_CLASS_FIELD(_f, _t, _at)
#define DEF_CLASS_FIELD(_f, _t, _at)
#define DEFA_SET_CLASS_FIELD(_f, _t, _at, _c)
#define DEFA_GET_CLASS_FIELD(_f, _t, _at, _c)
#define DEFA_CLASS_FIELD(_f, _t, _at, _c)

Define Documentation

#define ASSERT( expr)   assert((expr))

#define ASSERT_ATYPE( x)   ASSERT((T_BOOLEAN <= (x)) && ((x) <= T_LONG))

#define ASSERT_CLASS_ID( id)   ASSERT(((id) >= 0) && ((id) < j2s_AllClassesNum))

#define ASSERT_PTR( p)   ASSERT(IS_VALID_PTR((p)) == B_TRUE)

#define B( expr)   ((expr) ? B_TRUE : B_FALSE)

#define DBG_ASSERT( expr)   assert((expr))

#define DBG_ASSERT_PTR( p)   DBG_ASSERT(IS_VALID_PTR((p)) == B_TRUE)

#define DECL_PROC_0( proc_name,
rv)

Initial value:

\
rv SYM_PROC(proc_name)()

#define DECL_PROC_1( proc_name,
rv,
arg1)

Initial value:

\
rv SYM_PROC(proc_name)(arg1)

#define DECL_PROC_2( proc_name,
rv,
arg1,
arg2)

Initial value:

\
rv SYM_PROC(proc_name)(arg1, arg2)

#define DECL_PROC_3( proc_name,
rv,
arg1,
arg2,
arg3)

Initial value:

\
rv SYM_PROC(proc_name)(arg1, arg2, arg3)

#define DEFA_CLASS_FIELD( _f,
_t,
_at,
_c)

Initial value:

\
static void *_f##Address;\
DEFA_SET_CLASS_FIELD(_f, _t, _at, _c)\
DEFA_GET_CLASS_FIELD(_f, _t, _at, _c)

#define DEFA_GET_CLASS_FIELD( _f,
_t,
_at,
_c)

Initial value:

\
static _at _f() { Stats::static_field_acc_rts_called();\
                  Globals::##_c##JClass->_clinit_();\
                  return (_at) ::get##_t##StaticField(_f##Address); }

#define DEFA_SET_CLASS_FIELD( _f,
_t,
_at,
_c)

Initial value:

\
static void _f(_at value)\
{ Stats::static_field_acc_rts_called();\
  Globals::##_c##JClass->_clinit_();\
  ::set##_t##StaticField((J##_t) value, _f##Address); }

#define DEFX_GET_INSTANCE_FIELD( _f,
_t,
_at)

Initial value:

\
static _at _f(JObject *X) { return (_at) ::get##_t##Field(X, _f##Offset); }

#define DEFX_INSTANCE_FIELD( _f,
_t,
_at)

Initial value:

\
static int _f##Offset;\
DEFX_SET_INSTANCE_FIELD(_f, _t, _at)\
DEFX_GET_INSTANCE_FIELD(_f, _t, _at)

#define DEFX_SET_INSTANCE_FIELD( _f,
_t,
_at)

Initial value:

\
static void _f(JObject *X, _at value)\
{ ::set##_t##Field(X, _f##Offset, (J##_t) value); }

#define DEF_CLASS_FIELD( _f,
_t,
_at)

Initial value:

\
static void *_f##Address;\
DEF_SET_CLASS_FIELD(_f, _t, _at)\
DEF_GET_CLASS_FIELD(_f, _t, _at)

#define DEF_GET_CLASS_FIELD( _f,
_t,
_at)

Initial value:

\
static _at _f() { return (_at) ::get##_t##StaticField(_f##Address); }

#define DEF_GET_INSTANCE_FIELD( _f,
_t,
_at)

Initial value:

\
inline _at _f() { return (_at) ::get##_t##Field(this, _f##Offset); }

#define DEF_INSTANCE_FIELD( _f,
_t,
_at)

Initial value:

\
static int _f##Offset;\
DEF_SET_INSTANCE_FIELD(_f, _t, _at)\
DEF_GET_INSTANCE_FIELD(_f, _t, _at)

#define DEF_SET_CLASS_FIELD( _f,
_t,
_at)

Initial value:

\
static void _f(_at value)\
{ ::set##_t##StaticField((J##_t) value, _f##Address); }

#define DEF_SET_INSTANCE_FIELD( _f,
_t,
_at)

Initial value:

\
inline void _f(_at value)\
{ ::set##_t##Field(this, _f##Offset, (J##_t) value); }

#define DUMP( level,
s)   {IndentLevel(stderr, level);fprintf(stderr, s);}

#define DUMP1( level,
s,
p1)   {IndentLevel(stderr, level);fprintf(stderr, s, p1);}

#define DUMP2( level,
s,
p1,
p2)   {IndentLevel(stderr, level);fprintf(stderr, s, p1, p2);}

#define DUMP3( level,
s,
p1,
p2,
p3)   {IndentLevel(stderr, level);fprintf(stderr, s, p1, p2, p3);}

#define EH_ADDR_CUR()

#define EH_ARG

#define EH_GET_ARG()

#define EH_GET_CUR()

#define EH_SET_ARG( exc)

#define EH_SET_CUR( exc)

#define FSHOWERR( s)   {fprintf(stderr, s); fflush(stderr);}

#define FSHOWERR1( s,
p1)   {fprintf(stderr, s, p1); fflush(stderr);}

#define FSHOWERR2( s,
p1,
p2)   {fprintf(stderr, s, p1, p2); fflush(stderr);}

#define FSHOWERR3( s,
p1,
p2,
p3)   {fprintf(stderr, s, p1, p2, p3); fflush(stderr);}

#define GC_GARBAGE( x)   x = NULL;

#define HIDE_NICE_CLASS( c)

#define INITIAL_INDENT_LEVEL   1

#define INIT_CLASS_FIELD( C,
o)

Initial value:

\
  o##Address = NULL;\
  o##Address = Globals::##C##JClass->declaredFieldAddress(#o);\
  iface_assert(o##Address != NULL, "RTS: address for class field \""\
               #o "\" in Class \""\
               #C "\" was not found in metadata.\n")

#define INIT_FNPTR( clazz_name,
clazz,
name,
descriptor)

Initial value:

\
  SYM_VAR(clazz_name) = (SYM_FNPTR(clazz_name))\
    Globals::##clazz##JClass->\
    declaredMethodAddr(#name, #descriptor);\
  iface_assert(SYM_VAR(clazz_name) != NULL, "RTS: address for method \""\
               #name "\" and descriptor \"" #descriptor "\" in Class \""\
               #clazz "\" was not found in metadata.\n")

#define INIT_HIDDEN_INSTANCE_FIELD( C,
o)

Initial value:

\
  o##Offset = -1;\
  o##Offset = Globals::##C##JClass->declaredFieldOffset("$$" #o);\
  iface_assert(o##Offset >= 0, "RTS: offset for instance field \""\
               #o "\" in Class \""\
               #C "\" was not found in metadata.\n")

#define INIT_INSTANCE_FIELD( C,
o)

Initial value:

\
  o##Offset = -1;\
  o##Offset = Globals::##C##JClass->declaredFieldOffset(#o);\
  iface_assert(o##Offset >= 0, "RTS: offset for instance field \""\
               #o "\" in Class \""\
               #C "\" was not found in metadata.\n")

#define IS_VALID_PTR( p)   (((p) != NULL))

#define NEW( x)   (x *) RT_ALLOC(sizeof(x))

#define NEW_ATOMIC( x)   (x *) RT_ALLOC_ATOMIC(sizeof(x))

#define NO_SUPER_CLASS   NULL

#define ROUND_BYTES_UP( x)   (((x) + WS_MASK) & ~WS_MASK)

#define RT_ALLOC( x)   RT::Heap::alloc(x)

#define RT_ALLOC_ATOMIC( x)   RT::Heap::alloc_atomic(x)

#define RT_FREE( x)   RT::Heap::free((void *) (x))

#define SHOWERR( s)   fprintf(stderr, s)

#define SHOWERR1( s,
p1)   fprintf(stderr, s, p1)

#define SHOWERR2( s,
p1,
p2)   fprintf(stderr, s, p1, p2)

#define SHOWERR3( s,
p1,
p2,
p3)   fprintf(stderr, s, p1, p2, p3)

#define STRUCT2BYTES( x)   ((sizeof(x) + WS_MASK) & ~WS_MASK)

#define SYM_FNPTR( proc_name)

Initial value:

\
proc_name##_Proc

#define SYM_PROC( proc_name)

Initial value:

\
rts_##proc_name##_Proc

#define SYM_VAR( proc_name)

Initial value:

\
_rts_##proc_name##_Proc

#define TD_DECL_PROC_0( proc_name,
rv)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))();\
rv SYM_PROC(proc_name)()

#define TD_DECL_PROC_1( proc_name,
rv,
arg1)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))(arg1);\
rv SYM_PROC(proc_name)(arg1)

#define TD_DECL_PROC_2( proc_name,
rv,
arg1,
arg2)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))(arg1, arg2);\
rv SYM_PROC(proc_name)(arg1, arg2)

#define TD_DECL_PROC_3( proc_name,
rv,
arg1,
arg2,
arg3)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))(arg1, arg2, arg3);\
rv SYM_PROC(proc_name)(arg1, arg2, arg3)

#define THROW( id)   NThrowable::_throw_(id, "")

#define THROW_MSG( id,
msg)   NThrowable::_throw_(id, msg)

#define TYPEDEF_PROC_0( proc_name,
rv)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))()

#define TYPEDEF_PROC_1( proc_name,
rv,
arg1)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))(arg1)

#define TYPEDEF_PROC_2( proc_name,
rv,
arg1,
arg2)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))(arg1, arg2)

#define TYPEDEF_PROC_3( proc_name,
rv,
arg1,
arg2,
arg3)

Initial value:

\
typedef rv (* SYM_FNPTR(proc_name))(arg1, arg2, arg3)

#define VAR_PROC( proc_name)

Initial value:

\
SYM_FNPTR(proc_name)  SYM_VAR(proc_name)

#define WORD_SIZE   (sizeof(int))

#define WS_MASK   (sizeof(int) - 1)


Generated at Mon Jul 31 13:42:06 2000 for NCI SUIF by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000