diff options
Diffstat (limited to 'libjava/classpath/vm/reference')
4 files changed, 39 insertions, 3 deletions
diff --git a/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMFrame.java b/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMFrame.java index eec7b63d67b..767a902ff1c 100644 --- a/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMFrame.java +++ b/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMFrame.java @@ -73,12 +73,15 @@ public class VMFrame * @param thr a Thread, the thread this frame is in * @param frame_id a long, the jframeID of this frame * @param frame_loc a Location, the location of this frame + * @param frame_obj the "this" object of this frame */ - public VMFrame(Thread thr, long frame_id, Location frame_loc) + public VMFrame(Thread thr, long frame_id, Location frame_loc, + Object frame_obj) { thread = thr; id = frame_id; loc = frame_loc; + obj = frame_obj; } /** diff --git a/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMMethod.java b/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMMethod.java index d345bc1b515..6a2b04ecf97 100644 --- a/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMMethod.java +++ b/libjava/classpath/vm/reference/gnu/classpath/jdwp/VMMethod.java @@ -1,5 +1,5 @@ /* VMMethod.java -- a method in a virtual machine - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -175,4 +175,15 @@ public class VMMethod { return VMVirtualMachine.getClassMethod(klass, bb.getLong()); } + + public boolean equals(Object obj) + { + if (obj instanceof VMMethod) + { + VMMethod m = (VMMethod) obj; + return (getId() == m.getId()); + } + + return false; + } } diff --git a/libjava/classpath/vm/reference/java/lang/VMFloat.java b/libjava/classpath/vm/reference/java/lang/VMFloat.java index 2e7f439a443..15348130f10 100644 --- a/libjava/classpath/vm/reference/java/lang/VMFloat.java +++ b/libjava/classpath/vm/reference/java/lang/VMFloat.java @@ -108,4 +108,26 @@ final class VMFloat */ static native float intBitsToFloat(int bits); + /** + * @param f the <code>float</code> to convert + * @return the <code>String</code> representing the <code>float</code> + */ + static String toString(float f) + { + return VMDouble.toString(f, true); + } + + /** + * @param str the <code>String</code> to convert + * @return the <code>float</code> value of <code>s</code> + * @throws NumberFormatException if <code>str</code> cannot be parsed as a + * <code>float</code> + * @throws NullPointerException if <code>str</code> is null + */ + static float parseFloat(String str) + { + // XXX Rounding parseDouble() causes some errors greater than 1 ulp from + // the infinitely precise decimal. + return (float) Double.parseDouble(str); + } } // class VMFloat diff --git a/libjava/classpath/vm/reference/sun/misc/Unsafe.java b/libjava/classpath/vm/reference/sun/misc/Unsafe.java index fa199f83e0a..5dee8cfefd7 100644 --- a/libjava/classpath/vm/reference/sun/misc/Unsafe.java +++ b/libjava/classpath/vm/reference/sun/misc/Unsafe.java @@ -305,7 +305,7 @@ public class Unsafe * * @param thread the thread to unblock. */ - public native void unpark(Thread thread); + public native void unpark(Object thread); /** * Blocks the thread until a matching |