summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | Move some code from s.t.n.io to s.t.n.interactiveSimon Ochsenreither2013-06-276-7/+7
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only usages of scala.tools.nsc.io.{Lexer,Pickler,PrettyWriter, Replayer} can be found in scala.tools.nsc.interactive. Let's move those files closer to their dependencies.
* | | | | | Merge pull request #2660 from retronym/ticket/7582Adriaan Moors2013-07-032-4/+13
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-7582 Only inline accessible calls to package-private Java code
| * | | | | SI-7582 Only inline accessible calls to package-private Java codeJason Zaugg2013-06-191-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two problems here. The inliner was using `isPrivate` / `isProtected` to determine access. The fallthrough considered things to be (bytecode) public. This is okay in practice for Scala code, which never emits package private code. Secondly, we must check accessibility of the called symbol *and* its owner. This case is tested in `run/t7582b`. This commit tightens the check for Java defined symbols: a) check the owner, and b) don't assume that `! isPrivate` is accessible.
| * | | | | SI-7582 ClassfileParser: populate privateWithin of Java module classJason Zaugg2013-06-161-1/+1
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `privateWithin` attribute of Java companion module classes was correctly set under joint compilation (ie, when using JavaParser), but not under separate compilation. This commit remedies this. The test covers variety of Java symbols.
* | | | | Merge pull request #2663 from soc/SI-7592Adriaan Moors2013-07-013-84/+20
|\ \ \ \ \ | | | | | | | | | | | | SI-7592 Replace s.t.n.u.TreeSet with s.c.m.TreeSet
| * | | | | SI-7592 Replace s.t.n.u.TreeSet with s.c.m.TreeSetSimon Ochsenreither2013-06-193-84/+20
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means - migrating usages from the compiler-specific implementation to the one in the standard library - removing the now unused compiler-specific implementation
* | | | | Merge pull request #2693 from lexspoon/semmle-lintAdriaan Moors2013-07-0115-29/+63
|\ \ \ \ \ | | | | | | | | | | | | Lint-like fixes found by Semmle
| * | | | | Adds equals and hashCode to three classes that implement Ordered.Lex Spoon2013-06-262-0/+20
| | | | | |
| * | | | | Adds a hashCode method to the Settings class for Ant.Lex Spoon2013-06-261-0/+14
| | | | | |
| * | | | | Seals some case class hierarchies.Lex Spoon2013-06-2611-28/+28
| | | | | |
| * | | | | Unseal a uselessly sealed case class.Lex Spoon2013-06-261-1/+1
| | | | | |
* | | | | | Merge pull request #2694 from adriaanm/masterGrzegorz Kossakowski2013-07-017-145/+93
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ \ \ Merge 2.10.x into masterAdriaan Moors2013-06-282-5/+15
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Namers.scala src/partest/scala/tools/partest/PartestTask.scala
| | * \ \ \ \ \ Merge pull request #2680 from retronym/ticket/7603Adriaan Moors2013-06-271-3/+12
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7603 Speculative fix for annotation binding error
| | | * | | | | | SI-7603 Speculative fix for annotation binding errorJason Zaugg2013-06-241-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reports of: error: trait Test is abstract; cannot be instantiated 11:09:50 [ant:scalac] @Test def testClientRequestNum = { 11:09:50 [ant:scalac] ^ Suggest that the deferred processing of a LazyAnnotationInfo is binding the identifier `Test` to the wrong symbol. Inspection of the code shows that the closure also defers capture of the (mutable) field `Namer#typer.context`. This commit captures the context eagerly, and adds logging to let us know if that eagerly captured context ever differs from the its value at the point when the annotation info is forced. I spent a few hours trying to craft a test to back this up, but to no avail. Here's what the log output will look like: [log typer] The var `typer.context` in scala.tools.nsc.typechecker.Namers$NormalNamer@1f5ebb08 was mutated before the annotation new a() was forced. current value = Context(C@Import unit=<console> scope=123861466 errors=false, reportErrors=true, throwErrors=false) original value = Context(C@Import unit=<console> scope=123861466 errors=false, reportErrors=true, throwErrors=false) This confirms the hypothesis for the cause of SI-7603. If you see this message, please comment on that ticket.
| | * | | | | | | Merge pull request #2686 from retronym/topic/partest-task-no-stack-traceAdriaan Moors2013-06-271-2/+3
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Less noise on a partest failure.
| | | * | | | | | | Less noise on a partest failure.Jason Zaugg2013-06-271-2/+3
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Throwing a BuildException is the polite way to fail the Ant build. Before: BUILD FAILED /Users/jason/code/scala2/build.xml:1522: java.lang.RuntimeException: Test suite finished with 1 case failing: /Users/jason/code/scala2/test/files/pos/lub-dealias-widen.scala [FAILED] at scala.sys.package$.error(package.scala:27) [20 lines elided] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Total time: 2 minutes 35 seconds After: BUILD FAILED /Users/jason/code/scala2/build.xml:1522: Test suite finished with 1 case failing: /Users/jason/code/scala2/test/files/pos/lub-dealias-widen.scala [FAILED] Total time: 2 minutes 34 seconds
| | * | | | | | | Merge pull request #2655 from VladUreche/issue/7344Adriaan Moors2013-06-261-24/+94
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7344 Specialize methods in private scopes
| | | * | | | | | | SI-7344 Specialize methods in private scopesVlad Ureche2013-06-251-24/+94
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic: - we use normalizeMember to create the specialized symbols - we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation The solution is limited by SI-7579: since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example. Review by @dragos, @paulp or @axel22.
| * | | | | | | | Merge 2.10.x into masterAdriaan Moors2013-06-285-140/+78
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Duplicators.scala src/library/scala/concurrent/Future.scala test/files/jvm/scala-concurrent-tck.scala
| | * | | | | | | Merge pull request #2648 from retronym/ticket/7571Grzegorz Kossakowski2013-06-251-2/+2
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7571 Allow nesting of anonymous classes in value classes
| | | * | | | | | | SI-7571 Allow nesting of anonymous classes in value classesJason Zaugg2013-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5d9cde105e added deep prohibition of nested classes within a value class. This has the undesirable side effect of prohibiting partial functions literals in method bodies of a value class. The intention of that prohibition was to avoid problems in code using Type Tests, such as: class C(val inner: A) extends AnyVal { class D } def foo(a: Any, other: C) = a match { case _ : other.D } Here, the pattern usually checks that `a.$outer == other`. But that is incongruent with the way that `other` is erased to `A`. However, not all nested classes could lead us into this trap. This commit slightly relaxes the restriction to allow anonymous classes, which can't appear in a type test. The test shows that the translation generates working code.
| | * | | | | | | | Merge pull request #2511 from ↵Adriaan Moors2013-06-241-137/+44
| | |\ \ \ \ \ \ \ \ | | | |_|/ / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | viktorklang/wip-cleaner-Future-method-implementations-2.10-√ General SIP-14 Future method implementation cleanup
| | | * | | | | | | Cleaning up method implementations in FutureViktor Klang2013-06-191-137/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizations: 1) Avoiding isDefinedAt + apply and using applyOrElse to allow for optimizations later 2) Reducing method sizes to be more JIT + inliner friendly 3) Reusing core combinators to reuse inliner/JIT optimizations and be more code-cache friendly
| | * | | | | | | | Merge pull request #2651 from VladUreche/issue/7343-2Adriaan Moors2013-06-182-20/+33
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7343 Fixed phase ordering in specialization
| | | * | | | | | | | SI-7343 Fixed phase ordering in specializationVlad Ureche2013-06-122-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specialization rewires class parents during info transformation, and the new info then guides the tree changes. But if a symbol is created during duplication, which runs after specialization, its info is not visited and thus the corresponding tree is not specialized. One manifestation is the following: ``` object Test { class Parent[@specialized(Int) T] def spec_method[@specialized(Int) T](t: T, expectedXSuper: String) = { class X extends Parent[T]() // even in the specialized variant, the local X class // doesn't extend Parent$mcI$sp, since its symbol has // been created after specialization and was not seen // by specialzation's info transformer. ... } } ``` We can fix this by forcing duplication to take place before specialization. Review by @dragos, @paulp or @axel22.
| | | * | | | | | | | Removed redundant `retypedMethod` in `Duplicators`Vlad Ureche2013-06-121-18/+2
| | | | |/ / / / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was never used since its introduction in 3ee6b3653 by @dragos. Review by @dragos or @axel22 or @paulp.
* | | | | | | | | | Merge pull request #2692 from soc/SI-7591Adriaan Moors2013-07-0110-266/+96
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7591 Migrate command-line parsing to s.t.cmd
| * | | | | | | | | | SI-7591 Make s.t.p.n.ConsoleRunner use s.t.c.CommandLineSimon Ochsenreither2013-07-016-167/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change s.t.n.u.CommandLine was used instead. Remove command-line options --ansi, --buildmanager, --show-log which don't have any effect and don't seem to be used anywhere.
| * | | | | | | | | | SI-7591 Minor cleanupsSimon Ochsenreither2013-07-013-14/+3
| | | | | | | | | | |
| * | | | | | | | | | SI-7591 Move command-line spec usage demo to testsSimon Ochsenreither2013-07-011-85/+0
| | |_|_|_|_|_|_|/ / | |/| | | | | | | |
* | | | | | | | | | Merge pull request #2620 from magarciaEPFL/backendish33Adriaan Moors2013-07-0118-5/+6729
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | new bytecode emitter, GenBCode (11th attempt)
| * | | | | | | | | GenBCode: Eliminate needless OptionsMiguel Garcia2013-06-271-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit brings GenBCode in line with "Eliminate needless Options" as promoted by https://github.com/scala/scala/commit/45d61774eb255416c96e983cdb87960ad6415b74
| * | | | | | | | | more informative name for backend-selection via command-lineMiguel Garcia2013-06-271-5/+5
| | | | | | | | | |
| * | | | | | | | | catching up with a fix in master after this PR was submittedMiguel Garcia2013-06-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7151 Emit final in bytecode for final inner classes was fixed in https://github.com/scala/scala/commit/b49b6cf7f0f42d74da854d96eeb0f863357c04cd
| * | | | | | | | | additional documentation for GenBCodeMiguel Garcia2013-06-263-2/+7
| | | | | | | | | |
| * | | | | | | | | SI-5031 fixed in GenBCodeMiguel Garcia2013-06-062-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GenASM-based fix for SI-5031 is 0527b2549bcada2fda2201daa630369b377d0877
| * | | | | | | | | new bytecode emitter, GenBCode, for now under a flagMiguel Garcia2013-06-0117-5/+6723
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenBCode is a drop-in replacement for GenASM with several advantages: - faster: ICode isn't necessary anymore. Instead, the ASTs delivered by CleanUp (an expression language) are translated directly into a stack-language (ASM Tree nodes) - future-proofing for Java 8 (MethodHandles, invokedynamic). - documentation included, shared mutable state kept to a minimum, all contributing to making GenBCode more maintainable than its counterpart (its counterpart being GenICode + GenASM). A few tests are modified in this commit, for reasons given below. (1) files/neg/case-collision Just like GenASM, GenBCode also detects output classfiles differing only in case. However the error message differs from that of GenASM (collisions may be show in different order). Thus the original test now has a flags file containing -neo:GenASM and a new test (files/neg/case-collision2) has been added for GenBCode. The .check files in each case show expected output. (2) files/pos/t5031_3 Currently the test above doesn't work with GenBCode (try with -neo:GenBCode in the flags file) The root cause lies in the fix to https://issues.scala-lang.org/browse/SI-5031 which weakened an assertion in GenASM (GenBCode keeps the original assertion). Actually that ticket mentions the fix is a "workaround" (3) files/run/t7008-scala-defined This test also passes only under GenASM and not GenBCode, thus the flags file. GenASM turns a bling eye to: An AbstractTypeSymbol (SI-7122) has reached the bytecode emitter, for which no JVM-level internal name can be found: ScalaClassWithCheckedExceptions_1.E1 The error message above (shown by GenBCode) highlights there's no ScalaClassWithCheckedExceptions_1.E1 class, thus shouldn't show up in the emitted bytecode (GenASM emits bytecode that mentions the inexistent class).
| * | | | | | | | | an ICode InvokeStyle can now answer whether it isSuperMiguel Garcia2013-06-011-0/+3
| | | | | | | | | |
* | | | | | | | | | Merge pull request #2681 from soc/SI-7590Adriaan Moors2013-06-282-11/+17
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7590 TreeSet should fail fast if Ordering is null
| * | | | | | | | | | SI-7590 TreeSet should fail fast if Ordering is nullSimon Ochsenreither2013-06-252-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While migrating scala.tools.nsc.util.TreeSet to scala.collection.mutable.TreeSet, I messed up initialization order and realized that TreeSet accepts null as an Ordering and only fails much later. This change makes mutable.TreeSet and immutable.TreeSet fail immediately.
* | | | | | | | | | | Merge pull request #2676 from soc/SI-7511Adriaan Moors2013-06-289-68/+147
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | SI-7511 Remove indirection of numeric methods
| * | | | | | | | | | | SI-7511 Remove indirection of numeric methodsSimon Ochsenreither2013-06-239-68/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Methods on `Rich<AnyVal>`s like `abs`, `doubleValue`, `floatValue`, `longValue`, `intValue`, `byteValue`, `shortValue`, `min`, `max`, `signum` are slow because they go through multiple indirections including typeclasses and boxing. For instance, take `1L.abs`: Instead of just computing and returning the result (like it is done in `RichInt`), this is what happens: - `RichLong` inherits `abs` by extending `ScalaNumberProxy[T]` - `ScalaNumberProxy[T]` has an abstract `protected implicit def num: Numeric[T]` - This method is implemented in `RichLong` and points to `scala.math.Numeric.LongIsIntegral` - The actual method `abs` now calls `num.abs(self)`
* | | | | | | | | | | | Merge pull request #2673 from greenrd/patch-1Adriaan Moors2013-06-281-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / / / |/| | | | | | | | | | | Fix typo in Scaladoc
| * | | | | | | | | | | Fix typo in ScaladocRobin Green2013-06-231-1/+1
| |/ / / / / / / / / /
* | | | | | | | | | / SI-7344 Specialize methods in private scopesVlad Ureche2013-06-281-23/+91
| |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic: - we use normalizeMember to create the specialized symbols - we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation The solution is limited by SI-7579: since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example. Review by @dragos, @paulp or @axel22.
* | | | | | | | | | Merge pull request #2679 from soc/topic/java-rawtype-cleanupAdriaan Moors2013-06-273-5/+6
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Get rid of raw types which cause unnecessary warnings
| * | | | | | | | | | Get rid of raw types which cause unnecessary warningsSimon Ochsenreither2013-06-233-5/+6
| |/ / / / / / / / /
* | | | | | | | | | Merge pull request #2669 from adriaanm/modularize-parsingAdriaan Moors2013-06-279-104/+84
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|/ |/| | | | | | | | | Modularize parsing
| * | | | | | | | | Remove dependency on combinators from CommandLinerParser.Adriaan Moors2013-06-259-104/+84
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tools.cmd.CommandLineParser uses a small hand-rolled parser TODO: replace partest's usage of scala.tools.nsc.util.CommandLine by scala.tools.cmd.CommandLine