summaryrefslogtreecommitdiff
path: root/test/instrumented
diff options
context:
space:
mode:
authorSébastien Doeraene <sjrdoeraene@gmail.com>2016-04-13 11:07:01 +0200
committerSébastien Doeraene <sjrdoeraene@gmail.com>2016-04-13 11:07:01 +0200
commit00050c6bd06928b045e583c7f15f1223faf6fbee (patch)
tree3e308ba580a1e95599c278533d82b28025a197e8 /test/instrumented
parentd6f66ec0f38e42c19f79cbe9d32d29c65dee1e05 (diff)
downloadscala-00050c6bd06928b045e583c7f15f1223faf6fbee.tar.gz
scala-00050c6bd06928b045e583c7f15f1223faf6fbee.tar.bz2
scala-00050c6bd06928b045e583c7f15f1223faf6fbee.zip
Inline ArrayRuntime methods in ScalaRunTime.array_clone().
Support for Array[T].clone() was introduced in 36ef60e68c03bc1c7fd2e910ae7d70d4ec32d3bf. At the time, all calls to array.clone() were redirected to ScalaRunTime.array_clone(), which meant that array_clone() itself could not be implemented in terms of `x.clone()`. A Java binding was necessary. Now, the rewriting to `array_clone()` is only done for unbounded generic arrays. Since all the calls within `array_clone()` are monomorphic arrays, the rewriting is not applied, and the Java binding is unnecessary.
Diffstat (limited to 'test/instrumented')
-rw-r--r--test/instrumented/library/scala/runtime/ScalaRunTime.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/instrumented/library/scala/runtime/ScalaRunTime.scala b/test/instrumented/library/scala/runtime/ScalaRunTime.scala
index 6b45a4e9f3..ca59fc1509 100644
--- a/test/instrumented/library/scala/runtime/ScalaRunTime.scala
+++ b/test/instrumented/library/scala/runtime/ScalaRunTime.scala
@@ -122,15 +122,15 @@ object ScalaRunTime {
}
def array_clone(xs: AnyRef): AnyRef = xs match {
- case x: Array[AnyRef] => ArrayRuntime.cloneArray(x)
- case x: Array[Int] => ArrayRuntime.cloneArray(x)
- case x: Array[Double] => ArrayRuntime.cloneArray(x)
- case x: Array[Long] => ArrayRuntime.cloneArray(x)
- case x: Array[Float] => ArrayRuntime.cloneArray(x)
- case x: Array[Char] => ArrayRuntime.cloneArray(x)
- case x: Array[Byte] => ArrayRuntime.cloneArray(x)
- case x: Array[Short] => ArrayRuntime.cloneArray(x)
- case x: Array[Boolean] => ArrayRuntime.cloneArray(x)
+ case x: Array[AnyRef] => x.clone()
+ case x: Array[Int] => x.clone()
+ case x: Array[Double] => x.clone()
+ case x: Array[Long] => x.clone()
+ case x: Array[Float] => x.clone()
+ case x: Array[Char] => x.clone()
+ case x: Array[Byte] => x.clone()
+ case x: Array[Short] => x.clone()
+ case x: Array[Boolean] => x.clone()
case x: Array[Unit] => x
case null => throw new NullPointerException
}