checkexception with flags and check for exception flag.
* src/vm/builtin.h (builtintable_entry): Removed checkexception, added
flags.
(BUILTINTABLE_FLAG_STUB): Defined.
(BUILTINTABLE_FLAG_EXCEPTION): Likewise.
* src/vm/builtintable.inc (builtintable_internal): Moved position of
flags.
(builtintable_automatic): Likewise.
(builtintable_function): Likewise.
--HG--
branch : exact-gc
calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 7615 2007-03-29 23:10:59Z michi $
+ $Id: builtin.c 7696 2007-04-12 20:18:54Z twisti $
*/
if (middle->opcode < opcode) {
first = middle + 1;
entries -= half + 1;
- } else
+ }
+ else
entries = half;
}
for (bte = builtintable_function; bte->fp != NULL; bte++) {
if ((METHODREF_CLASSNAME(mr) == bte->classname) &&
- (mr->name == bte->name) &&
- (mr->descriptor == bte->descriptor)) {
+ (mr->name == bte->name) &&
+ (mr->descriptor == bte->descriptor)) {
/* set the values in the instruction */
- iptr->opc = bte->opcode;
+ iptr->opc = bte->opcode;
iptr->sx.s23.s3.bte = bte;
- if (bte->checkexception)
+
+ if (bte->flags & BUILTINTABLE_FLAG_EXCEPTION)
iptr->flags.bits |= INS_FLAG_CHECK;
else
iptr->flags.bits &= ~INS_FLAG_CHECK;
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: builtin.h 7686 2007-04-11 10:53:53Z twisti $
+ $Id: builtin.h 7696 2007-04-12 20:18:54Z twisti $
*/
struct builtintable_entry {
s4 opcode; /* opcode which is replaced */
+ u4 flags; /* e.g. check for exception */
functionptr fp; /* function pointer of builtin */
char *cclassname; /* char name of the class */
char *cname; /* char name of the function */
utf *classname; /* class of the function */
utf *name; /* name of the function */
utf *descriptor; /* descriptor of the function */
- bool checkexception; /* check for exception after return */
methoddesc *md;
};
+/* builtin table flag defines *************************************************/
+
+#define BUILTINTABLE_FLAG_STUB 0x0001 /* builtin needs a stub */
+#define BUILTINTABLE_FLAG_EXCEPTION 0x0002 /* check for excepion on return */
+
+
/* function prototypes ********************************************************/
bool builtin_init(void);
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: builtintable.inc 7686 2007-04-11 10:53:53Z twisti $
+ $Id: builtintable.inc 7696 2007-04-12 20:18:54Z twisti $
*/
#if defined(__ALPHA__) || defined(DISABLE_GC)
{
ICMD_F2L,
+ 0,
BUILTIN_f2l,
NULL,
"f2l",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_D2L,
+ 0,
BUILTIN_d2l,
NULL,
"d2l",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_F2I,
+ 0,
BUILTIN_f2i,
NULL,
"f2i",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_D2I,
+ 0,
BUILTIN_d2i,
NULL,
"d2i",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !SUPPORT_DIVISION || defined(DISABLE_GC)
{
ICMD_IDIV,
+ 0,
BUILTIN_idiv,
NULL,
"idiv",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_IREM,
+ 0,
BUILTIN_irem,
NULL,
"irem",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_DIVISION && SUPPORT_LONG && SUPPORT_LONG_DIV) || defined(DISABLE_GC)
{
ICMD_LDIV,
+ 0,
BUILTIN_ldiv,
NULL,
"ldiv",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LREM,
+ 0,
BUILTIN_lrem,
NULL,
"lrem",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
{
ICMD_FREM,
+ 0,
BUILTIN_frem,
NULL,
"frem",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_DREM,
+ 0,
BUILTIN_drem,
NULL,
"drem",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEW,
+ 0,
BUILTIN_new,
NULL,
"new",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEW,
+ BUILTINTABLE_FLAG_STUB,
BUILTIN_FAST_new,
NULL,
- "new (fast)",
+ "fast-new",
"(Ljava/lang/Class;)Ljava/lang/Object;",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_ANEWARRAY,
+ 0,
BUILTIN_newarray,
NULL,
"newarray",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_boolean,
NULL,
"newarray_boolean",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_byte,
NULL,
"newarray_byte",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_char,
NULL,
"newarray_char",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_short,
NULL,
"newarray_short",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_int,
NULL,
"newarray_int",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_long,
NULL,
"newarray_long",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_float,
NULL,
"newarray_float",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_NEWARRAY,
+ 0,
BUILTIN_newarray_double,
NULL,
"newarray_double",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_CHECKCAST,
+ 0,
BUILTIN_arraycheckcast,
NULL,
"arraycheckcast",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_INSTANCEOF,
+ 0,
BUILTIN_arrayinstanceof,
NULL,
"arrayinstanceof",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_AASTORE,
+ 0,
BUILTIN_canstore,
NULL,
"canstore",
NULL,
NULL,
NULL,
- false,
NULL
},
#if defined(ENABLE_THREADS)
{
ICMD_MONITORENTER,
+ 0,
LOCK_monitor_enter,
NULL,
"monitorenter",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_MONITOREXIT,
+ 0,
LOCK_monitor_exit,
NULL,
"monitorexit",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
{
255,
+ 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
- false,
NULL
},
};
#if !(SUPPORT_LONG && SUPPORT_LONG_CMP)
{
ICMD_LCMP,
+ 0,
BUILTIN_lcmp,
NULL,
"lcmp",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_LONG && SUPPORT_LONG_LOGICAL)
{
ICMD_LAND,
+ 0,
BUILTIN_land,
NULL,
"land",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LOR,
+ 0,
BUILTIN_lor,
NULL,
"lor",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LXOR,
+ 0,
BUILTIN_lxor,
NULL,
"lxor",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !(SUPPORT_LONG && SUPPORT_LONG_LOGICAL) */
#if !(SUPPORT_LONG && SUPPORT_LONG_SHIFT)
{
ICMD_LSHL,
+ 0,
BUILTIN_lshl,
NULL,
"lshl",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LSHR,
+ 0,
BUILTIN_lshr,
NULL,
"lshr",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LUSHR,
+ 0,
BUILTIN_lushr,
NULL,
"lushr",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !(SUPPORT_LONG && SUPPORT_LONG_SHIFT) */
#if !(SUPPORT_LONG && SUPPORT_LONG_ADD)
{
ICMD_LADD,
+ 0,
BUILTIN_ladd,
NULL,
"ladd",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LSUB,
+ 0,
BUILTIN_lsub,
NULL,
"lsub",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_LNEG,
+ 0,
BUILTIN_lneg,
NULL,
"lneg",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !(SUPPORT_LONG && SUPPORT_LONG_ADD) */
#if !(SUPPORT_LONG && SUPPORT_LONG_MUL)
{
ICMD_LMUL,
+ 0,
BUILTIN_lmul,
NULL,
"lmul",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_FLOAT && SUPPORT_I2F)
{
ICMD_I2F,
+ 0,
BUILTIN_i2f,
NULL,
"i2f",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_DOUBLE && SUPPORT_I2D)
{
ICMD_I2D,
+ 0,
BUILTIN_i2d,
NULL,
"i2d",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_LONG && SUPPORT_FLOAT && SUPPORT_L2F)
{
ICMD_L2F,
+ 0,
BUILTIN_l2f,
NULL,
"l2f",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_LONG && SUPPORT_DOUBLE && SUPPORT_L2D)
{
ICMD_L2D,
+ 0,
BUILTIN_l2d,
NULL,
"l2d",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_FLOAT && SUPPORT_F2I)
{
ICMD_F2I,
+ 0,
BUILTIN_f2i,
NULL,
"f2i",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_FLOAT && SUPPORT_LONG && SUPPORT_F2L)
{
ICMD_F2L,
+ 0,
BUILTIN_f2l,
NULL,
"f2l",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_DOUBLE && SUPPORT_D2I)
{
ICMD_D2I,
+ 0,
BUILTIN_d2i,
NULL,
"d2i",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !(SUPPORT_DOUBLE && SUPPORT_LONG && SUPPORT_D2L)
{
ICMD_D2L,
+ 0,
BUILTIN_d2l,
NULL,
"d2l",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif
#if !SUPPORT_FLOAT
{
ICMD_FADD,
+ 0,
BUILTIN_fadd,
NULL,
"fadd",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_FSUB,
+ 0,
BUILTIN_fsub,
NULL,
"fsub",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_FMUL,
+ 0,
BUILTIN_fmul,
NULL,
"fmul",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_FDIV,
+ 0,
BUILTIN_fdiv,
NULL,
"fdiv",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_FNEG,
+ 0,
BUILTIN_fneg,
NULL,
"fneg",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !SUPPORT_FLOAT */
#if !SUPPORT_FLOAT || !SUPPORT_FLOAT_CMP
{
ICMD_FCMPL,
+ 0,
BUILTIN_fcmpl,
NULL,
"fcmpl",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_FCMPG,
+ 0,
BUILTIN_fcmpg,
NULL,
"fcmpg",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !SUPPORT_FLOAT || !SUPPORT_FLOAT_CMP */
#if !SUPPORT_DOUBLE
{
ICMD_DADD,
+ 0,
BUILTIN_dadd,
NULL,
"dadd",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_DSUB,
+ 0,
BUILTIN_dsub,
NULL,
"dsub",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_DMUL,
+ 0,
BUILTIN_dmul,
NULL,
"dmul",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_DDIV,
+ 0,
BUILTIN_ddiv,
NULL,
"ddiv",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_DNEG,
+ 0,
BUILTIN_dneg,
NULL,
"dneg",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !SUPPORT_DOUBLE */
#if !SUPPORT_DOUBLE || !SUPPORT_DOUBLE_CMP
{
ICMD_DCMPL,
+ 0,
BUILTIN_dcmpl,
NULL,
"dcmpl",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_DCMPG,
+ 0,
BUILTIN_dcmpg,
NULL,
"dcmpg",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !SUPPORT_DOUBLE || !SUPPORT_DOUBLE_CMP */
#if !(SUPPORT_FLOAT && SUPPORT_DOUBLE)
{
ICMD_F2D,
+ 0,
BUILTIN_f2d,
NULL,
"f2d",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_D2F,
+ 0,
BUILTIN_d2f,
NULL,
"d2f",
NULL,
NULL,
NULL,
- false,
NULL
},
#endif /* !(SUPPORT_FLOAT && SUPPORT_DOUBLE) */
{
255,
+ 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
- false,
NULL
},
};
{
ICMD_BUILTIN,
+ BUILTINTABLE_FLAG_EXCEPTION,
BUILTIN_arraycopy,
"java/lang/VMSystem",
"arraycopy",
NULL,
NULL,
NULL,
- true,
NULL
},
#endif
{
ICMD_BUILTIN,
+ BUILTINTABLE_FLAG_EXCEPTION,
BUILTIN_arraycopy,
"java/lang/System",
"arraycopy",
NULL,
NULL,
NULL,
- true,
NULL
},
#endif
{
ICMD_BUILTIN,
+ 0,
BUILTIN_currenttimemillis,
"java/lang/VMSystem",
"currentTimeMillis",
NULL,
NULL,
NULL,
- false,
NULL
},
{
ICMD_BUILTIN,
+ 0,
BUILTIN_currenttimemillis,
"java/lang/System",
"currentTimeMillis",
NULL,
NULL,
NULL,
- false,
NULL
},
{
255,
+ 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
- false,
NULL
},
};
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: arch.h 7601 2007-03-28 23:02:50Z michi $
*/
Authors: Michael Starzinger
Christian Thalinger
- $Id: arch.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: arch.h 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: arch.h 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: arch.h 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: arch.h 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7687 2007-04-11 16:39:22Z tbfg $
+ $Id: arch.h 7688 2007-04-12 09:05:12Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 7692 2007-04-12 14:47:24Z twisti $
+ $Id: codegen.c 7693 2007-04-12 14:56:49Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7596 2007-03-28 21:05:53Z twisti $
+ $Id: patcher.c 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7680 2007-04-10 05:02:20Z pm $
+ $Id: arch.h 7688 2007-04-12 09:05:12Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: stack.c 7663 2007-04-04 22:14:42Z twisti $
+ $Id: stack.c 7667 2007-04-05 00:16:05Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: arch.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: arch.h 7601 2007-03-28 23:02:50Z michi $
*/