-/* vm/jit/loop/analyze.c - bound check removal functions
+/* src/vm/jit/loop/analyze.c - bound check removal functions
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
Authors: Christopher Kruegel
+ Changes: Christian Thalinger
+
Contains the functions which perform the bound check removals. With
the loops identified, these functions scan the code for array
accesses that take place in loops and try to guarantee that their
bounds are never violated. The function to call is
optimize_loops().
- $Id: analyze.c 1735 2004-12-07 14:33:27Z twisti $
+ $Id: analyze.c 2495 2005-05-22 19:49:53Z twisti $
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
LOAD_ARRAYLENGTH(ld->c_rightside->var); \
break; \
default: \
- panic("C_ERROR: illegal trace on rightside of loop-header"); \
+ log_text("C_ERROR: illegal trace on rightside of loop-header"); \
+ assert(0); \
} \
}
-/* vm/jit/loop/graph.c - control flow graph
+/* src/vm/jit/loop/graph.c - control flow graph
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
Contains the functions which build a list, that represents the
control flow graph of the procedure, that is being analyzed.
- $Id: graph.c 1735 2004-12-07 14:33:27Z twisti $
+ $Id: graph.c 2495 2005-05-22 19:49:53Z twisti $
*/
+#include <assert.h>
+
#include "mm/memory.h"
+#include "toolbox/logging.h"
#include "vm/jit/jit.h"
#include "vm/jit/loop/graph.h"
#include "vm/jit/loop/loop.h"
#ifdef C_DEBUG
if (blockIndex > m->basicblockcount) {
- panic("DepthFirst: BlockIndex exceeded\n");
+ log_text("DepthFirst: BlockIndex exceeded\n");
+ assert(0);
}
#endif
#ifdef C_DEBUG
if (blockIndex > m->basicblockcount) {
- panic("DepthFirst: BlockIndex exceeded");
+ log_text("DepthFirst: BlockIndex exceeded");
+ assert(0);
}
#endif
-/* vm/jit/loop/loop.c - array bound removal
+/* src/vm/jit/loop/loop.c - array bound removal
Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
Contact: cacao@complang.tuwien.ac.at
- Authors: Christopher Kruegel EMAIL: cacao@complang.tuwien.ac.at
+ Authors: Christopher Kruegel
+
+ Changes: Christian Thalinger
The loop detection is performed according to Lengauer-Tarjan
algorithm that uses dominator trees (found eg. in modern compiler
implementation by a.w. appel)
- $Id: loop.c 1735 2004-12-07 14:33:27Z twisti $
+ $Id: loop.c 2495 2005-05-22 19:49:53Z twisti $
*/
+#include <assert.h>
/* #include <stdio.h> */
/* #include <stdlib.h> */
void c_mem_error()
{
- panic("C_ERROR: Not enough memeory");
+ log_text("C_ERROR: Not enough memeory");
+ assert(0);
}