8000 Made speclib less of a maintenance headache. · scala/scala@9416668 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9416668

Browse files
committed
Made speclib less of a maintenance headache.
Now it copies in the current versions of BoxesRunTime and ScalaRunTime and applies patches to them, and the whole build is automated. # This is the only thing I actually typed, the rest is fancy echo. $ test/instrumented/mkinstrumented.sh build % rm -rf /scratch/trunk1/test/instrumented/classes % cp /scratch/trunk1/test/instrumented/../../src/library/scala/runtime/BoxesRunTime.java /scratch/trunk1/test/instrumented/../../src/library/scala/runtime/ScalaRunTime.scala /scratch/trunk1/test/instrumented/library/scala/runtime % patch BoxesRunTime.java /scratch/trunk1/test/instrumented/boxes.patch patching file BoxesRunTime.java % patch ScalaRunTime.scala /scratch/trunk1/test/instrumented/srt.patch patching file ScalaRunTime.scala Hunk #3 succeeded at 63 (offset 23 lines). Hunk #4 succeeded at 78 (offset 23 lines). Hunk #5 succeeded at 81 (offset 23 lines). Hunk #6 succeeded at 96 (offset 23 lines). % /scratch/trunk1/test/instrumented/../../build/pack/bin/scalac -d /scratch/trunk1/test/instrumented/classes /scratch/trunk1/test/instrumented/library/scala/runtime/BoxesRunTime.java /scratch/trunk1/test/instrumented/library/scala/runtime/ScalaRunTime.scala % javac -cp /scratch/trunk1/test/instrumented/../../build/pack/lib/scala-library.jar -d /scratch/trunk1/test/instrumented/classes /scratch/trunk1/test/instrumented/library/scala/runtime/BoxesRunTime.java % cd /scratch/trunk1/test/instrumented/classes % jar cf instrumented.jar . % mv -f instrumented.jar /scratch/trunk1/test/instrumented/../../test/files/speclib /scratch/trunk1/test/files/speclib/instrumented.jar has been created.
1 parent a2ce52f commit 9416668

File tree

9 files changed

+337
-197
lines changed

9 files changed

+337
-197
lines changed

instrumented.jar.desired.sha1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6785cf706a8448f8600f06b4c25d1816800422ce ?instrumented.jar

src/library/scala/runtime/ScalaRunTime.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ object ScalaRunTime {
3636
case _: Byte | _: Short | _: Char | _: Int | _: Long | _: Float | _: Double | _: Boolean | _: Unit => true
3737
case _ => false
3838
}
39-
private val tupleNames = 1 to 22 map ("scala.Tuple" + _) toSet
39+
// Avoiding boxing which messes up the specialized tests. Don't ask.
40+
private val tupleNames = {
41+
var i = 22
42+
var names: List[String] = Nil
43+
while (i >= 1) {
44+
names ::= ("scala.Tuple" + String.valueOf(i))
45+
i -= 1
46+
}
47+
names.toSet
48+
}
4049

4150
/** Return the class object representing an unboxed value type,
4251
* e.g. classOf[int], not classOf[java.lang.Integer]. The compiler
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2546f965f6718b000c4e6ef73559c11084177bd8 ?instrumented.jar
1+
23b6a7aa89b0a8a210ae9b206dfd0998338798c7 ?instrumented.jar

test/instrumented/boxes.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
9a10,11
2+
> /* INSTRUMENTED VERSION */
3+
>
4+
50a53,61
5+
> public static int booleanBoxCount = 0;
6+
> public static int characterBoxCount = 0;
7+
> public static int byteBoxCount = 0;
8+
> public static int shortBoxCount = 0;
9+
> public static int integerBoxCount = 0;
10+
> 9D95 public static int longBoxCount = 0;
11+
> public static int floatBoxCount = 0;
12+
> public static int doubleBoxCount = 0;
13+
>
14+
51a63
15+
> booleanBoxCount++;
16+
55a68
17+
> characterBoxCount++;
18+
59a73
19+
> byteBoxCount++;
20+
63a78
21+
> shortBoxCount++;
22+
67a83
23+
> integerBoxCount++;
24+
71a88
25+
> longBoxCount++;
26+
75a93
27+
> floatBoxCount++;
28+
79a98
29+
> doubleBoxCount++;

0 commit comments

Comments
 (0)
0