Christian Thalinger
Christian Ullrich
- $Id: stack.c 5221 2006-08-08 13:25:33Z twisti $
+ $Id: stack.c 5251 2006-08-18 13:01:00Z twisti $
*/
#if defined(SPECIALMEMUSE)
# if defined(__DARWIN__)
- if (rd->memuse < (i + INT_ARG_CNT + LA_WORD_SIZE))
- rd->memuse = i + LA_WORD_SIZE + INT_ARG_CNT;
+ if (rd->memuse < (i + INT_ARG_CNT + LA_SIZE_IN_POINTERS))
+ rd->memuse = i + LA_SIZE_IN_POINTERS + INT_ARG_CNT;
# else
- if (rd->memuse < (i + LA_WORD_SIZE + 3))
- rd->memuse = i + LA_WORD_SIZE + 3;
+ if (rd->memuse < (i + LA_SIZE_IN_POINTERS + 3))
+ rd->memuse = i + LA_SIZE_IN_POINTERS + 3;
# endif
#else
# if defined(__I386__)
copy->flags |= INMEMORY;
#if defined(SPECIALMEMUSE)
# if defined(__DARWIN__)
- copy->regoff = i + LA_WORD_SIZE + INT_ARG_CNT;
+ copy->regoff = i + LA_SIZE_IN_POINTERS + INT_ARG_CNT;
# else
- copy->regoff = i + LA_WORD_SIZE + 3;
+ copy->regoff = i + LA_SIZE_IN_POINTERS + 3;
# endif
#else
# if defined(__I386__)
cd = jd->cd;
rd = jd->rd;
-#if defined(ENABLE_LSRA)
- m->maxlifetimes = 0;
-#endif
-
last_store = DMNEW(s4 , cd->maxlocals * 5);
new = m->stack;
while (--len >= 0) {
opcode = iptr->opc;
+ /* check if ICMD opcode could throw an exception */
+ /* and if so remember the instruction index in last_pei */
+
+ if (op_data[opcode][PEI])
+ last_pei = bptr->icount - len - 1;
+
#if defined(USEBUILTINTABLE)
# if defined(ENABLE_INTRP)
if (!opt_intrp) {
# endif
+ /* check for opcodes to replace */
+
bte = builtintable_get_automatic(opcode);
if (bte && bte->opcode == opcode) {
# endif
#endif /* defined(USEBUILTINTABLE) */
+ /* Check for functions to replace with builtin
+ functions. */
+
+ if (builtintable_replace_function(iptr))
+ goto builtin;
+
/* this is the main switch */
switch (opcode) {
/* pop many push any */
case ICMD_BUILTIN:
-#if defined(USEBUILTINTABLE)
builtin:
-#endif
bte = (builtintable_entry *) iptr->val.a;
md = bte->md;
goto _callhandling;
_callhandling:
- last_pei = bptr->icount - len - 1;
+/* last_pei = bptr->icount - len - 1; */
i = md->paramcount;
REQUIRE(i);
#if defined(SPECIALMEMUSE)
# if defined(__DARWIN__)
- if (rd->memuse < (i + INT_ARG_CNT + LA_WORD_SIZE))
- rd->memuse = i + LA_WORD_SIZE + INT_ARG_CNT;
+ if (rd->memuse < (i + INT_ARG_CNT + LA_SIZE_IN_POINTERS))
+ rd->memuse = i + LA_SIZE_IN_POINTERS + INT_ARG_CNT;
# else
- if (rd->memuse < (i + LA_WORD_SIZE + 3))
- rd->memuse = i + LA_WORD_SIZE + 3;
+ if (rd->memuse < (i + LA_SIZE_IN_POINTERS + 3))
+ rd->memuse = i + LA_SIZE_IN_POINTERS + 3;
# endif
#else
# if defined(__I386__)
copy->flags |= INMEMORY;
#if defined(SPECIALMEMUSE)
# if defined(__DARWIN__)
- copy->regoff = i + LA_WORD_SIZE + INT_ARG_CNT;
+ copy->regoff = i + LA_SIZE_IN_POINTERS + INT_ARG_CNT;
# else
- copy->regoff = i + LA_WORD_SIZE + 3;
+ copy->regoff = i + LA_SIZE_IN_POINTERS + 3;
# endif
#else
# if defined(__I386__)
return false;
throw_stack_depth_error:
- exceptions_throw_verifyerror(m,"Stack depth mismatch");
+ exceptions_throw_verifyerror(m, "Stack depth mismatch");
return false;
throw_stack_type_error: