diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-05 16:00:40 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-05 16:13:49 +0200 |
commit | a19babc952c1e30d9b92452505e85752ff2d5460 (patch) | |
tree | 3ad37a4ea04469222a5f0e30a0d4921fd74e286f /test/instrumented/library/scala/runtime/BoxesRunTime.java | |
parent | fb43ec8dc28625c929beaf28767a955388700d0d (diff) | |
download | scala-a19babc952c1e30d9b92452505e85752ff2d5460.tar.gz scala-a19babc952c1e30d9b92452505e85752ff2d5460.tar.bz2 scala-a19babc952c1e30d9b92452505e85752ff2d5460.zip |
SI-7814 Updates the instrumented version of ScalaRuntime.
Some tests for specialization use a modified version of
the standard library that count boxing, array lookups etc.
These sources are updated manually with the script:
% test/instrumented/mkinstrumented.sh build
Looks that that wasn't done for a while, though.
This commit brings it up to date, and adjusts a few braces in
ScalaRuntime.scala so the patch srt.scala (used by that script)
is shorter.
We should really avoid checking in the products of that script and
run it as part of the build, or, better, use the bytecode
instrumentation framework instead of a modified standard library.
But I have to leave that for another day.
Diffstat (limited to 'test/instrumented/library/scala/runtime/BoxesRunTime.java')
-rw-r--r-- | test/instrumented/library/scala/runtime/BoxesRunTime.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/instrumented/library/scala/runtime/BoxesRunTime.java b/test/instrumented/library/scala/runtime/BoxesRunTime.java index 172ed8ee14..57799bd9b1 100644 --- a/test/instrumented/library/scala/runtime/BoxesRunTime.java +++ b/test/instrumented/library/scala/runtime/BoxesRunTime.java @@ -1,6 +1,6 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2006-2011, LAMP/EPFL ** +** / __/ __// _ | / / / _ | (c) 2006-2013, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** @@ -244,7 +244,7 @@ public final class BoxesRunTime * as yet have not. * * Note: Among primitives, Float.NaN != Float.NaN, but the boxed - * verisons are equal. This still needs reconciliation. + * versions are equal. This still needs reconciliation. */ public static int hashFromLong(java.lang.Long n) { int iv = n.intValue(); @@ -258,6 +258,9 @@ public final class BoxesRunTime long lv = n.longValue(); if (lv == dv) return java.lang.Long.valueOf(lv).hashCode(); + + float fv = n.floatValue(); + if (fv == dv) return java.lang.Float.valueOf(fv).hashCode(); else return n.hashCode(); } public static int hashFromFloat(java.lang.Float n) { |