1 /* jit/i386/methodtable.c - builds a table of all methods
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 Institut f. Computersprachen, TU Wien
5 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, M. Probst,
6 S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich,
9 This file is part of CACAO.
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2, or (at
14 your option) any later version.
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 Contact: cacao@complang.tuwien.ac.at
28 Authores: Christian Thalinger
30 $Id: methodtable.c 688 2003-12-04 23:50:25Z jowenn $
36 #include "methodtable.h"
39 #include "toolbox/memory.h"
42 static mtentry *mtroot = NULL;
45 void addmethod(u1 *start, u1 *end)
47 /* boehm makes problems with jvm98 db */
49 mtentry *mte = GCNEW(mtentry, 1);
51 mtentry *mte = NEW(mtentry);
56 mtentry *tmp = GCNEW(mtentry, 1);
58 mtentry *tmp = NEW(mtentry);
60 tmp->start = (u1 *) asm_calljavamethod;
61 tmp->end = (u1 *) asm_calljavafunction; /* little hack, but should work */
66 tmp = GCNEW(mtentry, 1);
70 tmp->start = (u1 *) asm_calljavafunction;
71 tmp->end = (u1 *) asm_calljavafunction2; /* little hack, but should work */
76 tmp = GCNEW(mtentry, 1);
80 tmp->start = (u1 *) asm_calljavafunction2;
81 tmp->end = (u1 *) asm_call_jit_compiler; /* little hack, but should work */
93 u1 *findmethod(u1 *pos)
95 mtentry *mte = mtroot;
98 if (mte->start <= pos && pos <= mte->end) {
106 printf("can't find method with eip=%p\n", pos);
112 * These are local overrides for various environment variables in Emacs.
113 * Please do not remove this and leave it at the end of the file, where
114 * Emacs will automagically detect them.
115 * ---------------------------------------------------------------------
118 * indent-tabs-mode: t