diff --git a/src/compile.cpp b/src/compile.cpp index afd590fc8f..a759a93d68 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -8033,8 +8033,7 @@ class ArgumentList { case 'J': case 'D': - addLong(cast(objectArrayBody(t, arguments, index++), - BytesPerWord)); + addLong(cast(objectArrayBody(t, arguments, index++), 8)); break; default: diff --git a/src/interpret.cpp b/src/interpret.cpp index b5810a434e..bf32553452 100644 --- a/src/interpret.cpp +++ b/src/interpret.cpp @@ -2772,8 +2772,7 @@ pushArguments(Thread* t, object this_, const char* spec, object a) case 'J': case 'D': - pushLong(t, cast(objectArrayBody(t, a, index++), - BytesPerWord)); + pushLong(t, cast(objectArrayBody(t, a, index++), 8)); break; default: diff --git a/test/Floats.java b/test/Floats.java index 38ae3121b1..0c513244b9 100644 --- a/test/Floats.java +++ b/test/Floats.java @@ -83,7 +83,25 @@ public class Floats { } } - public static void main(String[] args) { + public static class Rectangle { + public double x; + public double y; + public double width; + public double height; + + public void setX(double x) { + this.x = x; + } + } + + public static void main(String[] args) throws Exception { + expect(new Double(42.0) == 42.0); + + { Rectangle r = new Rectangle(); + Rectangle.class.getMethod("setX", double.class).invoke(r, 42.0); + expect(r.x == 42.0); + } + { double input[] = new double[8]; double left[] = new double[8]; double right[] = new double[8]; diff --git a/test/Longs.java b/test/Longs.java index 26f1e170b1..434ee908c9 100644 --- a/test/Longs.java +++ b/test/Longs.java @@ -65,9 +65,25 @@ public class Longs { return x >>> 32; } + public static class Rectangle { + public long x; + public long y; + public long width; + public long height; + + public void setX(long x) { + this.x = x; + } + } + public static void main(String[] args) throws Exception { expect(volatileLong == getConstant()); + { Rectangle r = new Rectangle(); + Rectangle.class.getMethod("setX", long.class).invoke(r, 42L); + expect(r.x == 42L); + } + { long a = 0x1FFFFFFFFL; long b = -1; expect(a != b);