/* src/vm/linker.c - class linker functions
- Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
- R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
- C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
- Institut f. Computersprachen - TU Wien
+ Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+ C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+ E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+ J. Wenninger, Institut f. Computersprachen - TU Wien
This file is part of CACAO.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
- Contact: cacao@complang.tuwien.ac.at
+ Contact: cacao@cacaojvm.org
Authors: Reinhard Grafl
Edwin Steiner
Christian Thalinger
- $Id: linker.c 3888 2005-12-05 22:08:45Z twisti $
+ $Id: linker.c 4357 2006-01-22 23:33:38Z twisti $
*/
+#include "config.h"
+
#include <assert.h>
-#include "config.h"
#include "vm/types.h"
#include "mm/memory.h"
#include "vm/resolve.h"
#include "vm/statistics.h"
#include "vm/stringlocal.h"
-#include "vm/jit/codegen.inc.h"
/* global variables ***********************************************************/
classinfo *r;
if (!c) {
- *exceptionptr = new_nullpointerexception();
+ exceptions_throw_nullpointerexception();
return NULL;
}
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));
/* Methods in ABSTRACT classes from interfaces maybe already have a */
/* stubroutine. */
- if (!m->stubroutine)
- m->stubroutine = createcompilerstub(m);
+ if (!m->stubroutine) {
+#if defined(ENABLE_JIT)
+# if defined(ENABLE_INTRP)
+ if (opt_intrp)
+ m->stubroutine = intrp_createcompilerstub(m);
+ else
+#endif
+ m->stubroutine = createcompilerstub(m);
+#else
+ m->stubroutine = intrp_createcompilerstub(m);
+#endif
+ }
if (!(m->flags & ACC_STATIC))
v->table[m->vftblindex] = (methodptr) (ptrint) m->stubroutine;
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));