summaryrefslogtreecommitdiff
path: root/test/instrumented
Commit message (Collapse)AuthorAgeFilesLines
* Remove plain old dead code in ScalaRunTime.Sébastien Doeraene2016-04-131-40/+0
|
* Inline ScalaRunTime.arrayElementClass at call sites.Sébastien Doeraene2016-04-131-9/+0
| | | | | | | | | | This method was awful. Not only it was using run-time type tests to essentially encode compile-time overloading. But it also did 2 slightly different things for the Class case and ClassTag case. All in all, it is much more readable to inline the appropriate implementation at every call site.
* Move ScalaRunTime.isAnyVal to reify.phases.Reify.Sébastien Doeraene2016-04-131-5/+0
| | | | Because that is the only call site of that method.
* Hide ScalaRunTime.isTuple inside stringOf.Sébastien Doeraene2016-04-131-2/+3
| | | | Because it is otherwise unused.
* Remove dead-code runtime hash() methods.Sébastien Doeraene2016-04-132-44/+1
| | | | | | | | | | | | | ScalaRunTime had a bunch of overloads of the `hash()` method, but only the `Any` version is ever used by the codegen. Worse, their implementation was not in sync with the actual implementations in BoxesRunTime, called by the `Any` version. For example, hash(0x80000000L) != hash(0x80000000L: Any) This commit simply removes all of this dead code. Similarly, we remove BoxesRunTime.hashFromObject(), which was never called either.
* Inline ArrayRuntime methods in ScalaRunTime.array_clone().Sébastien Doeraene2016-04-131-9/+9
| | | | | | | | | | | | | | 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.
* Fix many typos in docs and commentsmpociecha2014-12-141-1/+1
| | | | | | | | | | | | | This commit corrects many typos found in scaladocs, comments and documentation. It should reduce a bit number of PRs which fix one typo. There are no changes in the 'real' code except one corrected name of a JUnit test method and some error messages in exceptions. In the case of typos in other method or field names etc., I just skipped them. Obviously this commit doesn't fix all existing typos. I just generated in IntelliJ the list of potential typos and looked through it quickly.
* SI-7814 Updates the instrumented version of ScalaRuntime.Jason Zaugg2013-09-054-132/+42
| | | | | | | | | | | | | | | | | | | | 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.
* removes array tagsEugene Burmako2012-06-082-16/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 2.10 we had a notion of ClassManifest that could be used to retain erasures of abstract types (type parameters, abstract type members) for being used at runtime. With the advent of ClassManifest (and its subtype Manifest) it became possible to write: def mkGenericArray[T: Manifest] = Array[T]() When compiling array instantiation, scalac would use a ClassManifest implicit parameter from scope (in this case, provided by a context bound) to remember Ts that have been passed to invoke mkGenericArray and use that information to instantiate arrays at runtime (via Java reflection). When redesigning manifests into what is now known as type tags, we decided to explore a notion of ArrayTags that would stand for abstract and pure array creators. Sure, ClassManifests were perfectly fine for this job, but they did too much - technically speaking, one doesn't necessarily need a java.lang.Class to create an array. Depending on a platform, e.g. within JavaScript runtime, one would want to use a different mechanism. As tempting as this idea was, it has also proven to be problematic. First, it created an extra abstraction inside the compiler. Along with class tags and type tags, we had a third flavor of tags - array tags. This has threaded the additional complexity though implicits and typers. Second, consequently, when redesigning tags multiple times over the course of Scala 2.10.0 development, we had to carry this extra abstraction with us, which exacerbated the overall feeling towards array tags. Finally, array tags didn't fit into the naming scheme we had for tags. Both class tags and type tags sound logical, because, they are descriptors for the things they are supposed to tag, according to their names. However array tags are the odd ones, because they don't actually tag any arrays. As funny as it might sound, the naming problem was the last straw that made us do away with the array tags. Hence this commit.
* repairs the tests after the refactoring spreeEugene Burmako2012-06-082-17/+25
|
* rethinks tagsEugene Burmako2012-04-234-286/+248
| | | | | * introduces ArrayTag and ErasureTag * all type tags now feature erasure
* Made speclib less of a maintenance headache.Paul Phillips2012-02-146-195/+325
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Begone t1737...Hubert Plociniczak2011-11-022-77/+77
|
* Added a test case for anyref specialization.Aleksandar Pokopec2011-02-092-0/+329
|
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Adapted specialization tests to track number of...Aleksandar Pokopec2011-01-171-0/+14
| | | | | | | Adapted specialization tests to track number of boxings. Review by dragos
* Added 'specialized' tests.Aleksandar Pokopec2011-01-172-0/+906
Added a new test group - specialized. Modified partest to add a jar with instrumented classes to classpath when compiling and running tests. Added a primary version of the instrumented BoxesRuntime, and a script to produce a jar for it. Added the 'speclib' folder to partest files, which contains the jar with the instrumented classes. Review by dragos.