diff options
-rw-r--r-- | libjava/ChangeLog | 14 | ||||
-rw-r--r-- | libjava/gcj/array.h | 4 | ||||
-rw-r--r-- | libjava/java/lang/natObject.cc | 3 | ||||
-rw-r--r-- | libjava/java/util/StringTokenizer.java | 2 | ||||
-rw-r--r-- | libjava/java/util/Vector.java | 2 |
5 files changed, 21 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5c3c429a8ed..b5f3f9b29e4 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,17 @@ +2000-04-08 Anthony Green <green@cygnus.com> + + * java/lang/natObject.cc (_Jv_MonitorEnter): Only perform null + check when we have to. + + * gcj/array.h: Mark elements(JArray<T>& x) and elements(JArray<T>* + x) as `inline'. + + * java/util/StringTokenizer.java: Minor optimization. Eliminates + one method call. + + * java/util/Vector.java (VectorEnumeration.nextElement): Manually + inline hasMoreElements. + 2000-04-05 Tom Tromey <tromey@cygnus.com> * configure: Rebuilt. diff --git a/libjava/gcj/array.h b/libjava/gcj/array.h index bbea902d5f5..8b0a416d758 100644 --- a/libjava/gcj/array.h +++ b/libjava/gcj/array.h @@ -36,9 +36,9 @@ public: }; template<class T> -T* elements(JArray<T>& x) { return x.data; } +inline T* elements(JArray<T>& x) { return x.data; } template<class T> -T* elements(JArray<T>* x) { return x->data; } +inline T* elements(JArray<T>* x) { return x->data; } }; // end extern "Java" diff --git a/libjava/java/lang/natObject.cc b/libjava/java/lang/natObject.cc index 25b29660ae0..99e7ac518ba 100644 --- a/libjava/java/lang/natObject.cc +++ b/libjava/java/lang/natObject.cc @@ -18,6 +18,7 @@ details. */ #include <jvm.h> #include <java/lang/Object.h> #include <java-threads.h> +#include <java-signal.h> #include <java/lang/CloneNotSupportedException.h> #include <java/lang/IllegalArgumentException.h> #include <java/lang/IllegalMonitorStateException.h> @@ -224,8 +225,10 @@ _Jv_InitializeSyncMutex (void) jint _Jv_MonitorEnter (jobject obj) { +#ifndef HANDLE_SEGV if (! obj) JvThrow (new java::lang::NullPointerException); +#endif if (INIT_NEEDED (obj)) obj->sync_init (); _Jv_SyncInfo *si = (_Jv_SyncInfo *) obj->sync_info; diff --git a/libjava/java/util/StringTokenizer.java b/libjava/java/util/StringTokenizer.java index b55c8f7714c..1686a0399e8 100644 --- a/libjava/java/util/StringTokenizer.java +++ b/libjava/java/util/StringTokenizer.java @@ -180,6 +180,6 @@ public class StringTokenizer implements Enumeration // more readable this way, so we'll take the hit on efficiency. private boolean isDelimiter(char ch) { - return delimiters.indexOf(ch) >= 0; + return delimiters.indexOf(ch, 0) >= 0; } } diff --git a/libjava/java/util/Vector.java b/libjava/java/util/Vector.java index 737c5b498f6..d98068082ad 100644 --- a/libjava/java/util/Vector.java +++ b/libjava/java/util/Vector.java @@ -38,7 +38,7 @@ class VectorEnumeration implements Enumeration public Object nextElement() { - if (!hasMoreElements()) + if (! (enumIndex < enumVec.size())) throw new NoSuchElementException(); return enumVec.elementData[enumIndex++]; |