Christian Thalinger
Edwin Steiner
- $Id: VMClassLoader.c 3962 2005-12-20 23:28:13Z twisti $
+ $Id: VMClassLoader.c 4000 2005-12-22 14:05:01Z twisti $
*/
c = class_create_classinfo(utfname);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* measure time */
if (getloadingtime)
FREE(cb, classbuffer);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* measure time */
if (getloadingtime)
memory. All functions writing values into the data area return the offset
relative the begin of the code area (start of procedure).
- $Id: codegen.inc 3981 2005-12-21 16:43:21Z anton $
+ $Id: codegen.inc 4000 2005-12-22 14:05:01Z twisti $
*/
+#include "config.h"
+
#include <assert.h>
#include <string.h>
-#include "config.h"
#include "vm/types.h"
#include "mm/memory.h"
extralen = 0;
#endif
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat) {
count_code_len += mcodelen;
count_data_len += cd->dseglen;
m->entrypoint = createnativestub(f, m, cd, rd, nmd);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_nstub_len += m->mcodelength;
#endif
}
-/* reg_of_var:
- This function determines a register, to which the result of an operation
- should go, when it is ultimatively intended to store the result in
- pseudoregister v.
- If v is assigned to an actual register, this register will be returned.
- Otherwise (when v is spilled) this function returns tempregnum.
- If not already done, regoff and flags are set in the stack location.
-*/
-/* On ARM we have to check if a long/double variable is splitted
- across reg/stack (HIGH_REG == REG_SPLIT). We return the actual register
- of v for LOW_REG and the tempregnum for HIGH_REG in such cases.
- (michi 2005/07/24)
-*/
+/* reg_of_var ******************************************************************
+
+ This function determines a register, to which the result of an
+ operation should go, when it is ultimatively intended to store the
+ result in pseudoregister v. If v is assigned to an actual
+ register, this register will be returned. Otherwise (when v is
+ spilled) this function returns tempregnum. If not already done,
+ regoff and flags are set in the stack location.
+
+ On ARM we have to check if a long/double variable is splitted
+ across reg/stack (HIGH_REG == REG_SPLIT). We return the actual
+ register of v for LOW_REG and the tempregnum for HIGH_REG in such
+ cases. (michi 2005/07/24)
+
+*******************************************************************************/
static int reg_of_var(registerdata *rd, stackptr v, int tempregnum)
{
}
break;
}
-#ifdef STATISTICS
+
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_spills_read++;
#endif
+
v->flags |= INMEMORY;
+
return tempregnum;
}
Authors: Dieter Thuernbeck
- $Id: inline.c 3829 2005-12-01 19:47:56Z twisti $
+ Changes: Christian Thalinger
+
+ $Id: inline.c 4000 2005-12-22 14:05:01Z twisti $
*/
inline_env->inlining_stack = NULL;
inline_env->inlining_rootinfo = NULL;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (in_stats1) {
int ii;
for (ii=0; ii<512; ii++) count_in_not[ii]=0;
((opcode != JAVA_INVOKEVIRTUAL) ||
(opcode != JAVA_INVOKEINTERFACE)) ) &&
(inlineexceptions || (imi->exceptiontablelength == 0))) {
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in++;
if (inlinevirtuals) {
if (opcode == JAVA_INVOKEVIRTUAL) {
if (imi->flags & ACC_NATIVE) return can;
if (imi->flags & ACC_ABSTRACT) return can;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_rejected++;
#endif
if (opt_verbose)
if (!(inlineoutsiders) && (m->class->name != imr->classref->name)) {
/*** if ((!mult) && (whycannot > 0)) mult = true; *** First time not needed ***/
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_outsiders++;
#endif
whycannot = whycannot | IN_OUTSIDERS; /* outsider */
}
if (inline_env->cummethods >= INLINING_MAXMETHODS) {
if ((!mult) && (whycannot > 0)) mult = true;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_maxDepth++;
#endif
whycannot = whycannot | IN_MAXDEPTH;
if (uniqueVirt ) {
/* so know why (and that) a unique virtual was rejected for another reason */
if (opcode == JAVA_INVOKEVIRTUAL) {
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_uniqueVirt_not_inlined++;
#endif
whycannot = whycannot | IN_UNIQUEVIRT;
}
else {
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_uniqueInterface_not_inlined++;
#endif
whycannot = whycannot | IN_UNIQUE_INTERFACE;
if (inlineoutsiders && (m->class->name != imr->classref->name)) {
whycannot = whycannot | IN_OUTSIDERS; /* outsider */
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_outsiders++;
#endif
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (mult)
count_in_rejected_mult++;
#endif
log_text("Inline Whynot is too large???");
assert(0);
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_not[whycannot]++;
#endif
}
if (opt_stat) {
if ((!isnotrootlevel) && !maxdepthHit) {
maxdepthHit = true;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_in_maxDepth++;
#endif
}
Changes: Christian Thalinger
- $Id: parseRT.c 3829 2005-12-01 19:47:56Z twisti $
+ $Id: parseRT.c 4000 2005-12-22 14:05:01Z twisti $
*/
if (meth->methodUsed == USED) return;
if (!(meth->flags & ACC_ABSTRACT)) {
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_methods_marked_used++;
#endif
METHINFOt(meth,info,RTA_DEBUGopcodes)
Authors: Carolyn Oates
- $Id: parseRTstats.c 3829 2005-12-01 19:47:56Z twisti $
+ Changes: Christian Thalinger
+
+ $Id: parseRTstats.c 4000 2005-12-22 14:05:01Z twisti $
*/
rtaNode *rta;
methodinfo *rt_meth;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
printf("-*-*-*-*- RTA Callgraph Worklist:<%i>\n",count_methods_marked_used);
#endif
Changes: Christian Thalinger
- $Id: parseXTA.c 3829 2005-12-01 19:47:56Z twisti $
+ $Id: parseXTA.c 4000 2005-12-22 14:05:01Z twisti $
*/
if (m->xta != NULL)
return m->xta; /* already initialized */
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
count_methods_marked_used++;
#endif
methodinfo *xta_meth;
printf("\n%s\n",txt);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
printf("-*-*-*-*- XTA Callgraph Worklist:<%i>\n",count_methods_marked_used);
#endif
Changes: Christian Thalinger
Anton Ertl
- $Id: codegen.c 3979 2005-12-21 16:39:52Z anton $
+ $Id: codegen.c 4000 2005-12-22 14:05:01Z twisti $
*/
vm_block_insert(cd->mcodeptr);
#endif
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_cstub_len += COMPILERSTUB_SIZE;
#endif
bounds are never violated. The function to call is
optimize_loops().
- $Id: analyze.c 3028 2005-07-13 11:41:53Z twisti $
+ $Id: analyze.c 4000 2005-12-22 14:05:01Z twisti $
*/
+#include "config.h"
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "vm/types.h"
+
#include "mm/memory.h"
#include "toolbox/logging.h"
#include "vm/jit/jit.h"
#endif
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
void show_loop_statistics(loopdata *ld)
{
}
if ((count > 1) && (flag == 0)){/* if all successors part of the loop, exit */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_or++;
#endif
return 0;
/* if array index variables are modified there, return 0 */
if (quick_scan(m, ld, m->basicblockindex[cd->exceptiontable[i].handlerpc]) > 0) {
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_exception++;
#endif
/* printf("C_INFO: loopVar modified in exception\n"); */
switch (index->type) { /* check index type */
case TRACE_IVAR: /* it is a variable */
if (index->neg < 0) { /* if it's a negated var, return */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_no_opt++;
#endif
return OPT_NONE;
/* return the best possible optimization */
if ((high > 0) && (low > 0)) {
/* printf("fully optimzed\n"); */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_full_opt++;
#endif
return OPT_FULL;
}
else if (high > 0) {
/* printf("upper optimzed\n"); */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_upper_opt++;
#endif
return OPT_UPPER;
}
else if (low > 0) {
/* printf("lower optimzed\n"); */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_lower_opt++;
#endif
return OPT_LOWER;
}
else {
/* printf("not optimzed\n"); */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_no_opt++;
#endif
return OPT_NONE;
case TRACE_ICONST: /* if it is a constant, optimization is easy */
if (index->constant < 0) {
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_no_opt++;
#endif
return OPT_NONE; /* negative index -> bad */
}
else {
add_new_constraint(m, cd, ld, TEST_CONST_ALENGTH, arrayRef, 0, index->constant);
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_full_opt++;
#endif
return OPT_FULL; /* else just test constant against array length */
case TRACE_ALENGTH: /* else, no optimizations possible */
case TRACE_UNKNOWN:
case TRACE_AVAR:
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_no_opt++;
#endif
return OPT_NONE;
bptr = NULL;
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
/* show_loop_statistics(l); */
#endif
show_trace(t_index);
*/
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
if (ip->op1 == OPT_UNCHECKED) { /* found new access */
ld->c_stat_array_accesses++;
ip->op1 = OPT_NONE;
switch (t_index->type) { /* now we look at the index */
case TRACE_ICONST: /* it is a constant value or an */
case TRACE_ALENGTH: /* array length */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
switch (ip->op1) { /* take back old optimzation */
case OPT_UNCHECKED:
break;
ip->op1 = OPT_FULL;
break;
case OPT_FULL:
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_full_opt++;
#endif
break;
/* to set the changes back to the time, it is pushed onto */
/* the stack as an index variable. */
t = backtrack_var(m, node, t_index->nr, i-1, t_index->var, tmp[t_index->var]);
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
switch (ip->op1) { /* take back old optimzation */
case OPT_UNCHECKED:
break;
ip->op1 = OPT_FULL;
break;
case OPT_FULL:
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_full_opt++;
#endif
break;
/* else
printf("No array accesses found\n"); */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_num_loops++; /* increase number of loops */
ld->c_stat_sum_accesses += ld->c_stat_array_accesses;
if ((ld->c_constraints = (struct Constraint **) malloc((cd->maxlocals+1) * sizeof(struct Constraint *))) == NULL)
c_mem_error();
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
ld->c_stat_num_loops = 0; /* set statistic vars to zero */
ld->c_stat_array_accesses = ld->c_stat_sum_accesses = 0;
ld->c_stat_full_opt = ld->c_stat_sum_full = 0;
Authors: Christopher Kruegel
- $Id: loop.h 1735 2004-12-07 14:33:27Z twisti $
+ Changes: Christian Thalinger
+
+ $Id: loop.h 4000 2005-12-22 14:05:01Z twisti $
*/
#ifndef _LOOP_H
#define _LOOP_H
+#include "config.h"
+#include "vm/types.h"
+
#include "vm/global.h"
+#include "vm/method.h"
#include "vm/jit/jit.h"
/* declare statistic variables */
-#ifdef STATISTICS
+#ifdef ENABLE_STATISTICS
int c_stat_num_loops; /* number of loops */
};
-/* function prototypes */
+/* function prototypes ********************************************************/
void analyseGraph(methodinfo *m, loopdata *ld);
-void c_mem_error();
+void c_mem_error(void);
#endif /* _LOOP_H */
Authors: Christian Ullrich
- $Id: lsra.inc 3732 2005-11-22 14:36:16Z christian $
+ Changes: Christian Thalinger
+
+ $Id: lsra.inc 4000 2005-12-22 14:05:01Z twisti $
*/
+
+
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include "vm/types.h"
+
#include "mm/memory.h"
#include "vm/options.h"
+#include "vm/statistics.h"
#include "vm/jit/lsra.h"
#include "vm/jit/reg.h"
-#include "vm/statistics.h"
+
void lsra(methodinfo *m, codegendata *cd, registerdata *rd,
t_inlining_globals *id)
{
lsradata *ls;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
int locals_start;
int i,j;
#endif
lsra_setup(m, cd, rd, ls);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* find conflicts between locals for statistics */
if (opt_stat) {
/* local Variable Lifetimes are at the end of the lifetime array and */
Changes: Christian Ullrich
- $Id: reg.h 3219 2005-09-19 13:27:01Z twisti $
+ $Id: reg.h 4000 2005-12-22 14:05:01Z twisti $
*/
int *argadrregs; /* argument address registers */
int *tmpadrregs; /* scratch address registers */
- int *savadrregs; /* saved address registers */
+ int *savadrregs; /* saved address registers */
int *freeargadrregs; /* free argument address registers */
int *freetmpadrregs; /* free scratch address registers */
int *freesavadrregs; /* free saved address registers */
int freetmpadrtop; /* free scratch address register count */
int freesavadrtop; /* free saved address register count */
- int freeargadrtop; /* free argument address register count */
+ int freeargadrtop; /* free argument address register count */
#endif
#if defined(HAS_4BYTE_STACKSLOT)
int tmpfltreguse; /* used scratch float register count */
int savfltreguse; /* used saved float register count */
- int freearginttop; /* free argument integer register count */
- int freeargflttop; /* free argument float register count */
+ int freearginttop; /* free argument integer register count */
+ int freeargflttop; /* free argument float register count */
int freetmpinttop; /* free scratch integer register count */
int freesavinttop; /* free saved integer register count */
int freetmpflttop; /* free scratch float register count */
};
-/* function prototypes */
+/* function prototypes ********************************************************/
-void reg_init();
+void reg_init(void);
void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id);
void reg_free(methodinfo *m, registerdata *rd);
-void reg_close();
+void reg_close(void);
void regalloc(methodinfo *m, codegendata *cd, registerdata *rd);
-#ifdef STATISTICS
+
+#if defined(ENABLE_STATISTICS)
void reg_make_statistics( methodinfo *, codegendata *, registerdata *);
#endif
Christian Ullrich
Michael Starzinger
- $Id: reg.inc 3969 2005-12-21 00:07:23Z twisti $
+ $Id: reg.inc 4000 2005-12-22 14:05:01Z twisti $
*/
+#include "config.h"
+#include "vm/types.h"
+
#include "arch.h"
+
#include "mm/memory.h"
#include "vm/method.h"
#include "vm/resolve.h"
}
-#ifdef STATISTICS
+#if defined(ENABLE_STATISTICS)
void reg_make_statistics( methodinfo *m, codegendata *cd, registerdata *rd) {
int i,type;
s4 len;
count_interface_size += size_interface; /* accummulate the size of the interface (between bb boundaries) */
if (in_register) count_method_in_register++;
}
-#endif
+#endif /* defined(ENABLE_STATISTICS) */
+
+
/*
* These are local overrides for various environment variables in Emacs.
* Please do not remove this and leave it at the end of the file, where
Changes:
- $Id: schedule.c 2056 2005-03-22 11:21:32Z twisti $
+ $Id: schedule.c 4000 2005-12-22 14:05:01Z twisti $
*/
+#include "config.h"
+
#include <stdio.h>
-#include "config.h"
+#include "vm/types.h"
+
#include "disass.h"
#include "mm/memory.h"
}
printf("schedule end ---\n\n");
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat) {
count_schedule_basic_blocks++;
count_schedule_nodes += sd->micount;
Edwin Steiner
Christian Thalinger
- $Id: linker.c 3888 2005-12-05 22:08:45Z twisti $
+ $Id: linker.c 4000 2005-12-22 14:05:01Z twisti $
*/
+#include "config.h"
+
#include <assert.h>
-#include "config.h"
#include "vm/types.h"
#include "mm/memory.h"
return c;
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* measure time */
if (getcompilingtime)
if (!r)
c->state &= ~CLASS_LINKING;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* measure time */
if (getloadingtime)
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_vftbl_len +=
sizeof(vftbl_t) + (sizeof(methodptr) * (vftbllength - 1));
v->interfacevftbllength = MNEW(s4, interfacetablelength);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_vftbl_len += (4 + sizeof(s4)) * v->interfacetablelength;
#endif
v->interfacevftbllength[i] = ic->methodscount;
v->interfacetable[-i] = MNEW(methodptr, ic->methodscount);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_vftbl_len += sizeof(methodptr) *
(ic->methodscount + (ic->methodscount == 0));
Andreas Krall
Christian Thalinger
- $Id: utf8.c 3940 2005-12-11 01:06:16Z twisti $
+ $Id: utf8.c 4000 2005-12-22 14:05:01Z twisti $
*/
hashtable_create(&hashtable_utf, HASHTABLE_UTF_SIZE);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_utf_len += sizeof(utf*) * hashtable_utf.size;
#endif
builtin_monitorenter(lock_hashtable_utf);
#endif
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_utf_new++;
#endif
if (text[i] != u->text[i])
goto nomatch;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_utf_new_found++;
#endif
u = u->hashlink; /* next element in external chain */
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_utf_len += sizeof(utf) + length + 1;
#endif
hashtable_create(&newhash, hashtable_utf.size * 2);
newhash.entries = hashtable_utf.entries;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_utf_len += sizeof(utf*) * hashtable_utf.size;
#endif