summaryrefslogtreecommitdiff
path: root/test/junit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Run computeMaxLocalsMaxStack less oftenLukas Rytz2015-09-176-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a cache to remember which methods have maxLocals and maxStack already computed. Before we were computing these values on every run of eliminateUnreachableCode. Also update the implementation of eliminateUnreachableCode to keep correct max values.
| * | | Cleanups and performance fixes in Nullness analysisLukas Rytz2015-09-171-39/+58
| | | |
| * | | Avoid re-computing argInfos after inlining and closure optimizationLukas Rytz2015-09-171-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call graph holds an argInfos field for every callsite, which contains additional information about the argument passed to the callee. For example, an argInfo specifies if the argument is a function literal or a parameter of the callsite method. Computing the argInfo requires running an ASM analyzer, which is not cheap. This change assembles the argInfos for callsites that are created or changed by the inliner / closure optimizer from the available information instead of just running the analyzer again.
| * | | In the call graph, rename higherOrderParams to samParamTypesLukas Rytz2015-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | Because that's what the field holds: the parameter types that are SAM types.
| * | | Reduce component nesting in backendLukas Rytz2015-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | Make InlinerHeuristics a backend component like the others, instead of nested within the Inliner component.
| * | | Store information about function literals in call graphLukas Rytz2015-09-172-9/+59
| | | | | | | | | | | | | | | | | | | | Remember in the call graph if a function literal is passed as an argument to a higher-order function.
| * | | Include information about higher-order methods in the call graphLukas Rytz2015-08-281-1/+2
| | | | | | | | | | | | | | | | | | | | For higher order methods, the call graph contains a map from parameter positions to SAM types.
| * | | Inline post-inlining requestsLukas Rytz2015-08-281-34/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inline requests have a list of post-inline requests: callsites within the inlined method that should be inlined into the initial callee. This commit changes the inliner to actually perform post-inline requests.
| * | | Fix maxStack after inliningLukas Rytz2015-08-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The computed value was too large previously: inlining stores receiver and argument values of the inlined method into locals. A too large value doesn't cause any bugs, but data flow analyses would allocate too large frames. The test (InlinerTest.maxLocalsMaxStackAfterInline) didn't catch the bug because it tested the methods of the wrong ClassNode. The CodeGenTools.compileClasses method returns a ClassNode that is created from the classfile byte array emitted by the compiler. This ClassNode is a new object and unrelated to the ClassNode used in the compiler backend. The test now takes the correct ClassNode from the hash map in the backend's byteCodeRepository.
| * | | Store SAM information in ClassBTypesLukas Rytz2015-08-271-4/+50
| | | | | | | | | | | | | | | | | | | | If a class (trait) is a SAM type, store the name and descriptor of the SAM in the ClassBType's InlineInfo.
| * | | Separate hash maps in the code repo for classes being compiled or notLukas Rytz2015-08-185-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store classes being compiled in a separate hash map. This allows efficiently traversing all classes being compiled. It also simplifies limiting the size of the cache of class nodes parsed from classfiles. Also change the cache of class nodes parsed from classfiles to LRU instead of FIFO.
| * | | Group call graph by methodLukas Rytz2015-08-172-52/+38
| | | | | | | | | | | | | | | | | | | | | | | | Change the hash maps in the call graph to index callsites and closure instantiations by the containing method. This is beneficial for implementing inliner heuristics and the closure optimizer.
* | | | Merge pull request #4749 from retronym/ticket/9473Lukas Rytz2015-09-222-1/+54
|\ \ \ \ | | | | | | | | | | SI-9473 Cleaner references to statically owned symbols
| * | | | SI-9473 Cleaner references to statically owned symbolsJason Zaugg2015-09-222-1/+54
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ever wonder why `identity("")` typechecks to `scala.this.Predef.identity("")`? It turns out that `mkAttributedRef` was importing `q"$scalaPackageClass.this.Predef._"` for all these years, rather than `q"$scalaModule.Predef._"`. This commit makes `mkAttributedRef` special case static owners by referring the the corresponding module, instead.
* | | | Merge pull request #4719 from Ichoran/issue/8647Lukas Rytz2015-09-181-0/+7
|\ \ \ \ | | | | | | | | | | SI-8647 Used immutable scheme for mutable.BitSet to resolve canBuildFrom
| * | | | SI-8647 Used immutable scheme for mutable.BitSet to resolve canBuildFromRex Kerr2015-08-301-0/+7
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | mutable.BitSet had a conflict between its own implicit canBuildFrom and the one inherited from SortedSetFactory in mutable.SortedSet. The immutable hierarchy already had a workaround; this just copies it on the mutable side. Test written to verify compilation.
* | | | Merge pull request #4689 from retronym/topic/trait-default-specializationLukas Rytz2015-09-182-0/+60
|\ \ \ \ | |_|/ / |/| | | Preparation for using default methods in traits
| * | | Allow BCode to emit default interface methodsJason Zaugg2015-08-112-0/+60
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | A DefDef owned by a trait may now have have a method body. Such a method must be emitted without ACC_ABSTRACT, and with the code attribute. Tested by intercepting the compile pipeline and adding the DEFAULTMETHOD flag and a method body before running the backend.
* | | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-09-082-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | only trivial merge conflicts here. not dealing with PR #4333 in this merge because there is a substantial conflict there -- so that's why I stopped at 63daba33ae99471175e9d7b20792324615f5999b for now
* | | Merge pull request #4718 from Ichoran/issue/9379Seth Tisue2015-09-021-0/+16
|\ \ \ | | | | | | | | SI-9379 Added toString to .zipped to allow Stream etc to short-circuit
| * | | SI-9379 Added toString to .zipped to allow Stream etc to short-circuitRex Kerr2015-08-301-0/+16
| |/ / | | | | | | | | | | | | | | | Tuple2Zipped and Tuple3Zipped would try to compute a hash code when .toString was called on them. This overrides toString to print (collection1, collection2).zipped instead, using the collection's own toString method. This allows collections that have a toString but not a hashCode (such as Iterator.from(0) and s = 1 #:: s) to print out as they usually do. JUnit test to verify the deferral to collections' .toString.
* | | Merge pull request #4691 from ↵Adriaan Moors2015-08-311-0/+57
|\ \ \ | |/ / |/| | | | | | | | nicolasstucki/2.12.x-ScalaRunntime-fix-for-Scala.js Remove unnecessary dependency on parallel collections in ScalaRunTime.
| * | Remove unnecessary dependency on parallel collections in ScalaRunTime.Nicolas Stucki2015-08-201-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In method `ScalaRuntime.stringOf(arg: Any, maxElements: Int)` there are `case x: Iterable[_]` and `case x: ParIterable[_]` which have the excat same code that only uses the `GenIterable[_]` API on `x`. Therfore they can be replaced by a single `case x: GenIterable[_]`. The `case x: ParIterable[_]` was added because prevoiusly parallel colections would only match `case x = x.toSting()` which ignores the `maxElements` parameter. This was still the case for other `GenIterable[_]`. Using `case x: GenIterable[_]` will cover those cases as well. This change is required for Scala.js compatibility as it does not support parallel collections.
* | | SI-6938 Use mutable red-black tree in TreeSetRui Gonçalves2015-07-281-2/+4
|/ / | | | | | | | | | | | | | | The previous implementation of `mutable.TreeSet` uses a mutable reference to an immutable red-black tree as its underlying data structure. That leads to unnecessary objects being created, which can be a problem in systems with limited resources. It also has reduced performance when compared with common mutable implementations. In this commit `mutable.TreeSet` is changed so that it uses the recently created `mutable.RedBlackTree` as its underlying data structure. Specialized red-black tree methods were created for working with keys for efficiency reasons. The new implementation is source-compatible with the previous one, although its serialized representation obviously changes. Closes [SI-6938](https://issues.scala-lang.org/browse/SI-6938).
* | Merge pull request #4638 from lrytz/t9393Jason Zaugg2015-07-241-0/+96
|\ \ | | | | | | SI-9393 fix modifiers of ClassBTypes for Java annotations
| * | Query methods in api.Symbols for Java flagsLukas Rytz2015-07-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds query methods to the public reflection API for querying the JAVA_ENUM and JAVA_ANNOTATION flags. Didn't include JAVA_DEFAULTMETHOD because it does not correspond to a real java classfile flag (just a non-abstract method in an interface), and we want to clean the usage of this flag before adding it to a public API. The flags themselfs are not added to the reflection API. A comment in api/FlagSets.scala says: Q: I have a pretty flag. Can I put it here? A: Only if there's a tree that cannot be built without it. If you want to put a flag here so that it can be tested against, introduce an `isXXX` method in one of the api.Symbols classes instead.
| * | SI-9393 fix modifiers of ClassBTypes for Java annotationsLukas Rytz2015-07-221-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Scala classfile and java source parsers make Java annotation classes (which are actually interfaces at the classfile level) look like Scala annotation classes: - the INTERFACE / ABSTRACT flags are not added - scala.annotation.Annotation is added as superclass - scala.annotation.ClassfileAnnotation is added as interface This makes type-checking @Annot uniform, whether it is defined in Java or Scala. This is a hack that leads to various bugs (SI-9393, SI-9400). Instead the type-checking should be special-cased for Java annotations. This commit fixes SI-9393 and a part of SI-9400, but it's still easy to generate invalid classfiles. Restores the assertions that were disabled in #4621. I'd like to leave these assertions in: they are valuable and helped uncovering the issue being fixed here. A new flag JAVA_ANNOTATION is introduced for Java annotation ClassSymbols, similar to the existing ENUM flag. When building ClassBTypes for Java annotations, the flags, superclass and interfaces are recovered to represent the situation in the classfile. Cleans up and documents the flags space in the area of "late" and "anti" flags. The test for SI-9393 is extended to test both the classfile and the java source parser.
* | | Merge pull request #4647 from Ichoran/issue/8911Lukas Rytz2015-07-231-0/+29
|\ \ \ | | | | | | | | SI-8911 allow serializing Scala Maps wrapped as Java ones
| * | | SI-8911 scala.collection.convert.Wrappers$MapWrapper not serializableRex Kerr2015-07-191-0/+29
| |/ / | | | | | | | | | | | | | | | | | | | | | Added `with Serializable` to `MapWrapper` and `SetWrapper`. Test verifies that serialization works in the simplest case. Also updated tests in t8549 to check that serialization works and doesn't change.
* | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-07-231-1/+1
|\ \ \ | |/ / |/| / | |/ merge/2.11.x-to-2.12.x-20152307
| * Improve some names (t-v)Janek Bogucki2015-07-151-1/+1
| |
* | Merge pull request #4611 from SethTisue/issue/8627Lukas Rytz2015-07-161-1/+3
|\ \ | | | | | | add test coverage for SI-8627 (Stream.filterNot)
| * | add test coverage for SI-8627 (Stream.filterNot)Seth Tisue2015-07-081-1/+3
| | |
* | | Merge pull request #4622 from retronym/merge/2.11.x-to-2.12.x-20150713Adriaan Moors2015-07-132-2/+2
|\ \ \ | | | | | | | | Merge 2.11.x to 2.12.x [ci: last-only]
| * \ \ Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-07-132-2/+2
| |\ \ \ | | |/ / | |/| / | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150713 Conflicts: src/eclipse/partest/.classpath src/eclipse/repl/.classpath test/files/run/nothingTypeNoFramesNoDce.scala test/files/run/repl-javap-app.check Also fixup two .classpath files with updated partest, xml and parser combinators JARs.
| | * Fix 23 typos (m-o)Janek Bogucki2015-06-282-2/+2
| | |
* | | Merge pull request #4609 from retronym/topic/indylambda-testLukas Rytz2015-07-092-1/+58
|\ \ \ | | | | | | | | [indylambda] Improve test coverage
| * | | Address review feedbackJason Zaugg2015-07-092-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | - Add requisite boilerplate for test cleanup to IndyLambdaTest - ... and to the spot where I copy/pasted the wrong code from - Fix comment.
| * | | [indylambda] Improve test coverageJason Zaugg2015-07-081-0/+54
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding tests for the selective use of boxing bridge methods and to show that specialization is not subverted by indylambda. Other aspects of indylambda are tested by tests like: - run/lambda-serialization.scala - run/indylambda-boxing When those tests were written, they only tested the old backend. However, now that we have Java 8 and the new backend avaialble by default to partest, they provide the intended coverage.
* | | Merge pull request #4607 from lrytz/inlineIndyAdriaan Moors2015-07-081-0/+37
|\ \ \ | | | | | | | | Accessibility checks for methods with an InvokeDynamic instruction
| * | | Accessibility checks for methods with an InvokeDynamic instructionLukas Rytz2015-07-071-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements the necessary tests to check if a method with an InvokeDynamic instruction can be inlined into a destination class. Only InvokeDynamic instructions with LambdaMetaFactory as bootstrap methods can be inlined. The accessibility checks cannot be implemented generically, because it depends on what the bootstrap method is doing. In particular, the bootstrap method receives a Lookup object as argument which can be used to access private methods of the class where the InvokeDynamic method is located. A comment in the inliner explains the details.
* | | | Merge pull request #4602 from lrytz/yoptInScalaAdriaan Moors2015-07-083-1/+117
|\| | | | |/ / |/| | Fix optimizer bugs and enable -Yopt:l:classpath when building scala
| * | Set -Xsource to 2.12 by defaultLukas Rytz2015-07-031-1/+1
| | |
| * | Prevent infinite recursion in ProdConsAnalyzerLukas Rytz2015-07-031-0/+42
| | | | | | | | | | | | | | | | | | When an instruction is its own producer or consumer, the `initialProducer` / `ultimateConsumer` methods would loop. While loops or @tailrec annotated methods can generate such bytecode.
| * | SI-9376 don't crash when inlining a closure body that throws.Lukas Rytz2015-07-031-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | If the closure body method has return type Nothing$, add an `ATHROW` instruction after the callsite. This is required for computing stack map frames, as explained in a comment in BCodeBodyBuilder.adapt. Similar for closure bodies with return type Null$.
* | | Merge pull request #4561 from jdevelop/io-source-fromclasspath-2.12Adriaan Moors2015-07-071-0/+4
|\ \ \ | |/ / |/| | SI-7514 Introduce Source.fromResource(...) method
| * | [ SI-7514 ] Introduce Source.fromClassPath(resource) methodEugene Dzhurinsky2015-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creates Source from named classpath resource. Simplifies val src = io.Source.fromInputStream(classOf[ClassInst].getResourceAsStream("/name")) to val src = io.Source.fromClassPath("/name")
* | | SI-9377 Update ScalaVersion error textSom Snytt2015-07-022-1/+5
| | | | | | | | | | | | Simplify and sweeten the message.
* | | SI-9377 ScalaVersion init no longer fails if versionlessSom Snytt2015-07-021-0/+5
|/ / | | | | | | | | | | If the version string was empty, ScalaVersion would indignantly refuse to initialize. Now it takes a missing property as "none".
* | Include sources for scala-java8-compat instead of jarLukas Rytz2015-07-011-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e1895d64f87dc3c699a3ccbc8a3143b18d3b5bb1, titled "Add scala-java8-compat to scala-library.jar". Move SAM functions and `LambdaDeserializer` (from scala/scala-java8-compat@9253ed9) into `scala.runtime.java8` package under `src/library`. (The package name is the only diff -- they were in `scala.compat.java8` before). The original LambdaDeserializer: https://github.com/scala/scala-java8-compat/blob/c0732e6/src/main/java/scala/compat/java8/runtime/LambdaDeserializer.scala