Joseph Wenninger
Christian Thalinger
- $Id: parse.c 2969 2005-07-10 15:24:35Z twisti $
+ $Id: parse.c 3330 2005-10-04 18:52:44Z twisti $
*/
#include <string.h>
#include "config.h"
-#include "types.h"
+
+#include "vm/types.h"
+
#include "mm/memory.h"
#include "native/native.h"
#include "toolbox/logging.h"
/* managing arrays ****************************************************/
case JAVA_NEWARRAY:
- OP(ICMD_CHECKASIZE);
switch (code_get_s1(p + 1, inline_env->method)) {
case 4:
bte = builtintable_get_internal(BUILTIN_newarray_boolean);
log_text("Invalid array-type to create");
assert(0);
}
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
- OP(ICMD_CHECKEXCEPTION);
+ BUILTIN(bte, true, NULL, currentline);
break;
case JAVA_ANEWARRAY:
- OP(ICMD_CHECKASIZE);
i = code_get_u2(p + 1, inline_env->method);
compr = (constant_classref *) class_getconstant(inline_env->method->class, i, CONSTANT_Class);
if (c) {
bte = builtintable_get_internal(BUILTIN_newarray);
LOADCONST_A_BUILTIN(c->vftbl);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, true, NULL, currentline);
} else {
bte = builtintable_get_internal(PATCHER_builtin_newarray);
LOADCONST_A_BUILTIN(cr);
- BUILTIN(bte, bte->md->paramcount, cr, currentline);
+ BUILTIN(bte, true, cr, currentline);
}
s_count++;
- OP(ICMD_CHECKEXCEPTION);
break;
case JAVA_MULTIANEWARRAY:
inline_env->method->isleafmethod = false;
i = code_get_u2(p + 1, inline_env->method);
{
- constant_classref *cr;
- classinfo *c;
s4 v = code_get_u1(p + 3, inline_env->method);
cr = (constant_classref *) class_getconstant(inline_env->method->class, i, CONSTANT_Class);
/* load and store of object fields ************************************/
case JAVA_AASTORE:
-#if defined(__POWERPC__) || defined(__X86_64__) || defined(__I386__)
bte = builtintable_get_internal(BUILTIN_canstore);
OP2A(opcode, bte->md->paramcount, bte, currentline);
inline_env->method->isleafmethod = false;
-#else
- bte = builtintable_get_internal(BUILTIN_aastore);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
-#endif
break;
case JAVA_GETSTATIC:
if (!descriptor_params_from_paramtypes(md, ACC_STATIC))
return NULL;
- OP2A_NOINC(opcode, md->paramcount, mr, currentline);
+ OP2A_NOINC(opcode, 0, mr, currentline);
um = create_unresolved_method(inline_env->method->class,
inline_env->method, iptr);
if (!descriptor_params_from_paramtypes(md, 0))
return NULL;
- OP2A_NOINC(opcode, md->paramcount, mr, currentline);
+ OP2A_NOINC(opcode, 0, mr, currentline);
um = create_unresolved_method(inline_env->method->class,
inline_env->method, iptr);
if (!descriptor_params_from_paramtypes(md, 0))
return NULL;
- OP2A_NOINC(opcode, md->paramcount, mr, currentline);
+ OP2A_NOINC(opcode, 0, mr, currentline);
um = create_unresolved_method(inline_env->method->class,
inline_env->method, iptr);
if (c && c->initialized) {
bte = builtintable_get_internal(BUILTIN_new);
LOADCONST_A_BUILTIN(c);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, true, NULL, currentline);
} else {
bte = builtintable_get_internal(PATCHER_builtin_new);
LOADCONST_A_BUILTIN(cr);
- BUILTIN(bte, bte->md->paramcount, cr, currentline);
+ BUILTIN(bte, true, cr, currentline);
}
s_count++;
- OP(ICMD_CHECKEXCEPTION);
break;
case JAVA_CHECKCAST:
if (cr->name->text[0] == '[') {
/* array type cast-check */
-#if defined(__POWERPC__) || defined(__X86_64__) || defined(__I386__)
if (c) {
bte = builtintable_get_internal(BUILTIN_arraycheckcast);
OP2AT(ICMD_ARRAYCHECKCAST, 1, bte, c->vftbl, currentline);
OP2AT(ICMD_ARRAYCHECKCAST, 0, bte, cr, currentline);
}
inline_env->method->isleafmethod = false;
-#else
- if (c) {
- bte = builtintable_get_internal(BUILTIN_arraycheckcast);
- LOADCONST_A_BUILTIN(c->vftbl);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
-
- } else {
- bte = builtintable_get_internal(PATCHER_builtin_arraycheckcast);
- LOADCONST_A_BUILTIN(cr);
- BUILTIN(bte, bte->md->paramcount, cr, currentline);
- }
- s_count++;
- inline_env->method->isleafmethod = false;
-#endif
} else {
/* object type cast-check */
if (c) {
bte = builtintable_get_internal(BUILTIN_arrayinstanceof);
LOADCONST_A_BUILTIN(c->vftbl);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else {
bte = builtintable_get_internal(PATCHER_builtin_arrayinstanceof);
LOADCONST_A_BUILTIN(cr);
- BUILTIN(bte, bte->md->paramcount, cr, currentline);
+ BUILTIN(bte, false, cr, currentline);
}
s_count++;
if (checksync) {
OP(ICMD_CHECKNULL);
bte = builtintable_get_internal(BUILTIN_monitorenter);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else
#endif
{
#if defined(USE_THREADS)
if (checksync) {
bte = builtintable_get_internal(BUILTIN_monitorexit);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else
#endif
{
OP(opcode);
#else
bte = builtintable_get_internal(BUILTIN_frem);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
#endif
break;
OP(opcode);
#else
bte = builtintable_get_internal(BUILTIN_drem);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
#endif
break;
#if defined(__ALPHA__)
if (!opt_noieee) {
bte = builtintable_get_internal(BUILTIN_f2i);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else
#endif
{
#if defined(__ALPHA__)
if (!opt_noieee) {
bte = builtintable_get_internal(BUILTIN_f2l);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else
#endif
{
#if defined(__ALPHA__)
if (!opt_noieee) {
bte = builtintable_get_internal(BUILTIN_d2i);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else
#endif
{
#if defined(__ALPHA__)
if (!opt_noieee) {
bte = builtintable_get_internal(BUILTIN_d2l);
- BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+ BUILTIN(bte, false, NULL, currentline);
} else
#endif
{