1 /* i386/methodtable.c **********************************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 Contains the codegenerator for an i386 processor.
8 This module generates i386 machine code for a sequence of
9 pseudo commands (ICMDs).
11 Authors: Christian Thalinger EMAIL: cacao@complang.tuwien.ac.at
13 Last Change: $Id: methodtable.c 525 2003-10-22 21:14:23Z twisti $
15 *******************************************************************************/
17 #include "methodtable.h"
19 static mtentry *mtroot = NULL;
23 void addmethod(u1 *start, u1 *end)
25 /* boehm makes problems with jvm98 db */
27 mtentry *mte = GCNEW(mtentry, 1);
29 mtentry *mte = NEW(mtentry);
32 /* fprintf(stderr, "start=%lx end=%lx\n", start, end); */
36 mtentry *tmp = GCNEW(mtentry, 1);
38 mtentry *tmp = NEW(mtentry);
40 tmp->start = (u1 *) asm_calljavamethod;
41 tmp->end = (u1 *) asm_calljavafunction; /* little hack, but should work */
46 tmp = GCNEW(mtentry, 1);
50 tmp->start = (u1 *) asm_calljavafunction;
51 tmp->end = (u1 *) asm_call_jit_compiler; /* little hack, but should work */
64 u1 *findmethod(u1 *pos)
66 mtentry *mte = mtroot;
68 /* printf("findmethod: start\n"); */
71 /* printf("%p <= %p <= %p\n", mte->start, pos, mte->end); */
73 if (mte->start <= pos && pos <= mte->end) {
88 printf("val=%x\n", x);