aboutsummaryrefslogtreecommitdiff
path: root/libjava/link.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/link.cc')
-rw-r--r--libjava/link.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/libjava/link.cc b/libjava/link.cc
index 1d873acf288..d6fd2ddafbd 100644
--- a/libjava/link.cc
+++ b/libjava/link.cc
@@ -1,6 +1,7 @@
// link.cc - Code for linking and resolving classes and pool entries.
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation
This file is part of libgcj.
@@ -33,8 +34,10 @@ details. */
#include <limits.h>
#include <java-cpool.h>
#include <execution.h>
+#ifdef INTERPRETER
#include <jvmti.h>
#include "jvmti-int.h"
+#endif
#include <java/lang/Class.h>
#include <java/lang/String.h>
#include <java/lang/StringBuffer.h>
@@ -660,10 +663,11 @@ _Jv_Linker::prepare_constant_time_tables (jclass klass)
// interfaces or primitive types.
jclass klass0 = klass;
- jboolean has_interfaces = 0;
+ jboolean has_interfaces = false;
while (klass0 != &java::lang::Object::class$)
{
- has_interfaces += klass0->interface_count;
+ if (klass0->interface_count)
+ has_interfaces = true;
klass0 = klass0->superclass;
klass->depth++;
}
@@ -853,7 +857,7 @@ _Jv_ThrowNoSuchMethodError ()
throw new java::lang::NoSuchMethodError;
}
-#if defined USE_LIBFFI && FFI_CLOSURES
+#if defined USE_LIBFFI && FFI_CLOSURES && defined(INTERPRETER)
// A function whose invocation is prepared using libffi. It gets called
// whenever a static method of a missing class is invoked. The data argument
// holds a reference to a String denoting the missing class.
@@ -1039,7 +1043,7 @@ _Jv_Linker::find_iindex (jclass *ifaces, jshort *offsets, jshort num)
return i;
}
-#if defined USE_LIBFFI && FFI_CLOSURES
+#if defined USE_LIBFFI && FFI_CLOSURES && defined(INTERPRETER)
// We use a structure of this type to store the closure that
// represents a missing method.
struct method_closure
@@ -2069,6 +2073,7 @@ _Jv_Linker::wait_for_state (jclass klass, int state)
throw new java::lang::LinkageError;
}
+#ifdef INTERPRETER
if (__builtin_expect (klass->state == JV_STATE_LINKED, false)
&& state >= JV_STATE_LINKED
&& JVMTI_REQUESTED_EVENT (ClassPrepare))
@@ -2077,4 +2082,5 @@ _Jv_Linker::wait_for_state (jclass klass, int state)
_Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_PREPARE, self, jni_env,
klass);
}
+#endif
}