| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GenBCode used to generate more bytecode for branching instructions than
GenASM. A simple method
def f(x: Int, b: Boolean) = if (b) 1 else 2
would generate
ILOAD 2
IFNE L1
GOTO L2
L1
ICONST_1
GOTO L3
L2
ICONST_2
L3
IRETURN
If the conditional branch is negated (IFEQ) the GOTO is unnecessary.
While -Yopt:l:method would clean this up, it's also not too hard to
generate the leaner bytecode in the first place.
|
|\
| |
| | |
SI-9571 Avoid boxing primitives in string concatenation
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Provide simpler commented example for Future.map
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adding connection between map and for
As described by SethTisue.
Removing parentheses
Fixing scaladoc
|
|\ \ \
| | | |
| | | | |
Use invokedynamic for structural calls, symbol literals, lambda ser.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The previous encodings created static fields in the enclosing class
to host caches. However, this isn't an option once emit code in default
methods of interfaces, as Java interfaces don't allow private static
fields.
We could continue to emit fields, and make them public when added to
traits.
Or, as chosen in this commit, we can emulate a call-site specific
static field by using invokedynamic: when the call site is linked,
our bootstrap methid can perform one-time computation, and we can
capture the result in the CallSite.
To implement this, I've allowed encoding of arbitrary invokedynamic
calls in ApplyDynamic.
The encoding is:
ApplyDynamic(
NoSymbol.newTermSymbol(TermName("methodName")).setInfo(invokedType)
Literal(Constant(bootstrapMethodSymbol)) :: (
Literal(Constant(staticArg0)) :: Literal(Constant(staticArgN)) :: Nil
) :::
(dynArg0 :: dynArgN :: Nil)
)
So far, static args may be `MethodType`, numeric or string literals, or
method symbols, all of which can be converted to constant pool entries.
`MethodTypes` are transformed to the erased JVM type and are converted
to descriptors as String constants.
I've taken advantage of this for symbol literal caching and
for the structural call site cache.
I've also included a test case that shows how a macro could target this
(albeit using private APIs) to cache compiled regexes.
I haven't managed to use this for LambdaMetafactory yet, not sure
if the facility is general enough.
|
|\ \ \ \
| | | | |
| | | | | |
Merge 2.11.x to 2.12.x [ci:last-only]
|
| |\ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`scala -deprecation` (without a trailing script argument)
wasn't allowed. Now it is.
I also supported trailing whitespace on all commands.
Also fixed: a bug with completion of `scalac ./san<TAB>`.
It was completing as though the `./` had not been typed,
which threw the suggestion off by a few characters.
|
| |\| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
src/library/scala/collection/Iterator.scala
|
`-- trivial conflicts only. Parens were added to the
next() calls in 2.12.x, while in the meantime
`{Concat,Join}Iterator` were optimized in 2.11.x
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SBT build improvements
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Also refactor the partest parser to use the improved tab
completion for test paths.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Even though our build can't be imported into IntelliJ
automatically, we don't need to live in the dark ages
of red squigglies when editing build.sbt.
This commit hand-crafts the module defintion for the
project, which has SBT and its dependendencies on the
classpath.
A screenshot of the code assist is worth the thousand
expletives I uttered while writing the pictured code
without this facility:
https://www.dropbox.com/s/6mxv0iwxkhvnor7/Screenshot%202016-02-07%2022.09.12.png?dl=0
To download the sources for the SBT JARs that are referenced
herein, run
sbt> reload plugins
sbt> updateClassifiers
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
We can complete partest options (I've excluded some that
aren't relevant in SBT), as well as test file names.
If `--srcpath scaladoc` is included, completion of test
paths will be based on `test/scaladoc` rather than
the default `test/files`. Note that the `--srcpath` option
is currently broken via scala partest interface, this
change to scala-partest is needed to make it work:
https://github.com/scala/scala-partest/pull/49
I've also hijacked the `--grep` option with logic
in the SBT command itself, rather than passing this
to `partest`. Just like `./bin/partest-ack`, this looks
for either test file names or regex matches within
the contents of test, check, or flag files.
I tried for some time to make the tab completion of
thousands of filenames more user friendly, but wasn't
able to get something working. Ideally, it should
only suggest to `test/files/{pos, neg, ...}` on the
first <TAB>, and then offer files on another TAB.
Files should also be offered if a full directory
has been entered. Hopefully a SBT parser guru will
step in and add some polish here.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The idea here is to avoid the need for switching
between the SBT shell and Bash.
- Add aliases for partest, scala{,c,p,doc}
- Change working directory for these forked processes
to the root project base directory, rather than the
subprojects base directory. This lets us use relative
paths to files in a more familar way.
- Don't log the output of forked processes with the
`[info] ` prefix, rather pass it through directly
to stdout.
Demo:
```
> partest --terse test/files/pos/t6231.scala
[info] Packaging /Users/jason/code/scala2/build-sbt/pack/lib/scala-partest-javaagent.jar ...
[info] Done packaging.
Selected 1 tests drawn from specified tests
.
[info] Passed: Total 1, Failed 0, Errors 0, Passed 1
[success] Total time: 3 s, completed 05/02/2016 12:44:19 PM
> scala sandbox/test.scala
[info] Running scala.tools.nsc.MainGenericRunner -usejavacp sandbox/test.scala
Hello, World!
[success] Total time: 4 s, completed 05/02/2016 12:45:08 PM
> scalac sandbox/test.scala
[info] Running scala.tools.nsc.Main -usejavacp sandbox/test.scala
[success] Total time: 3 s, completed 05/02/2016 12:45:15 PM
> scala Test
[info] Running scala.tools.nsc.MainGenericRunner -usejavacp Test
Hello, World!
[success] Total time: 1 s, completed 05/02/2016 12:45:20 PM
> scala
[info] Running scala.tools.nsc.MainGenericRunner -usejavacp
Welcome to Scala 2.11.8-20160204-090931-42525ec (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_71).
Type in expressions for evaluation. Or try :help.
scala> 1.to
to toBinaryString toByte toChar toDegrees toDouble toFloat toHexString toInt toLong toOctalString toRadians toShort toString
scala> 1.toString
res0: String = 1
scala> :quit
[success] Total time: 8 s, completed 05/02/2016 12:45:48 PM
>
```
|
| | |\ \ \ \ \
| | | |/ / / /
| | |/| | | | |
SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIterator
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
These iterator implementations are used to concatenate two (JoinIterator)
or more (ConcatIterator) other iterators with `++`. They used to perform
many unnecessary calls to the child iterators’ `hasNext` methods.
This improved state machine-based implementation reduces that number to
the bare minimum, i.e. iterating over concatenated iterators with
`foreach` calls the children's `hasNext` methods a total of (number of
children) + (number of elements) times, the same as when iterating over
all children separately.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
bump copyright year to 2016
|
| | |/ / / / / |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-9650 Refchecks on case apply transform
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Apply checks for unsavoriness when transforming
a case apply.
|
|\ \ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | | |
SI-9452: Extend BigDecimal with Ordered for java interop
|
| |\ \ \ \ \ \ \
| | | |_|_|_|_|/
| | |/| | | | | |
|
| | | | | | | | |
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-9349 Fix use of patmat binder as prefix for new x.Inner
|
| | |_|_|_|_|/ /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
When substituting in references to the synthetic values
representing pattern binders, we were replacing:
Select(Ident(o).setType(o.type), TypeName("Inner"))
with:
Select(Ident(x2).setType(typeOf[Outer]), TypeName("Inner"))
The post transform in uncurry would then run:
else if (tree.isType)
TypeTree(tree.tpe) setPos tree.pos
Which would loses track of the outer term `o` and crashes the
compiler in ExplicitOuter.
This commit generates stable references to the binders.
I made this change in the substitutions for all `TreeMakers`,
however only one of seems like it triggers a crash in the
test variations I tried.
Here's how the trees for the first pattern in the test case
change after this patch:
```
@@ -1,30 +1,30 @@
[[syntax trees at end of patmat]] // test.scala
package <empty>{<empty>.type} {
object Test extends scala.AnyRef {
def <init>(): Test.type = {
Test.super{Test.type}.<init>{()Object}(){Object};
(){Unit}
}{Unit};
def main(args: Array[String]): Unit = {
val o1: Outer = Outer.apply{(i: Int)Outer}(5{Int(5)}){Outer};
{
case <synthetic> val x1: Outer = o1{Outer};
case5(){
if (x1.ne{(x$1: AnyRef)Boolean}(null{Null(null)}){Boolean})
matchEnd4{(x: Unit)Unit}({
- val i: Outer#Inner = new x1.Inner{Outer#Inner}{()Outer#Inner}(){Outer#Inner};
+ val i: x1.Inner = new x1.Inner{x1.Inner}{()x1.Inner}(){x1.Inner};
(){Unit}
}{Unit}){Unit}
else
case6{()Unit}(){Unit}{Unit}
}{Unit};
case6(){
matchEnd4{(x: Unit)Unit}(throw new MatchError{MatchError}{(obj: Any)MatchError}(x1{Outer}){MatchError}{Nothing}){Unit}
}{Unit};
matchEnd4(x: Unit){
x{Unit}
}{Unit}
}{Unit}
}{Unit}
}
```
|
|\ \ \ \ \ \ \ \
| |_|_|_|/ / / /
|/| | | | | | | |
SI-9542 Fix regression in value classes (served two ways)
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The new unit test shows failures in transitivity of subtyping
and type equivalence, which boil down the the inconsistent
handling of the semantically equivalent:
ThisType(pre, ModuleClass)
ModuleTypeRef(pre, ModuleClass)
SingleType(pre, Module)
This commit:
- adds a case to `normalizePlus` to unwrap a `ThisType` to
a `ModuleTypeRef`
- Use `normalizePlus` more widely during subtype comparison
- refactor `fourthTry` (part of `isSubType`) to remove code
that becomes obviated by the use of `normalizePlus`.
This fixes the regression in the extension methods phase which
was triggered by https://github.com/scala/scala/pull/4749.
We can also fix that regression by tweaking the extension methods
phase itself to emit the `ThisType` representation of the owner
of the value class, as before.
I plan to demonstrate the two approaches to fixing the regression
on separate branches, and the propose that the merged result of these
two is useds.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
In SI-9473 / e2653736, I changed `mkAttributedRef` to avoid prefixing
references to statically owned symbols with a `ThisType`.
Turns out there was one place that depended on the old behaviour.
```
object Outer {
trait T
class C(val value: Any) extends AnyVal {
def foo(t: T) = expr
}
}
```
Is translated to:
```
object Outer {
trait T
class C(val value: Any) extends AnyVal {
def foo(t: T) = Outer.this.C.foo$extension(C.this, t)
}
object C {
def foo$extension($this: C, t: T) = expr
}
}
```
After the change, the forwarder was instead:
```
def foo(t: T) = Outer.C.foo$extension(C.this, t)
```
Note: this change is not actually necessary after the following
commit that makes subtyping unify the different module class
reference, that alone is enough to make the enclosed test
pass.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
felixmulder/topic/scaladoc-hideImplicitConversions-tag
SI-9620: add doc annotation to hide specific conversions
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This commit will introduce the doc annotation `@hideImplicitConversion`.
By specifying which conversions to hide, the user can "toggle" which
conversions are kept in the parsed entity.
This implementation is a better workaround than hardcoding which ones to
ignore when running scaladoc.
Review: @VladUreche
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-9574 Prevent illegal overrides of members with module types
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Commit f32a32b1b33c9d7ccd62467e3e10cb69930023c8 introduced the ability
to override objects with other objects. The exception that allows
these overrides (where the usual subtyping check fails) was applied to
all members whose type is a module class. This is too broad, however,
because it not only applies to members of the form `object foo` but
also `def foo: bar.type` (where `bar` is an `object`).
The fix is to restrict the exception to those cases where both
definitions actually are objects.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Scaladoc: fix duplicate implicits in Array
|
|/ / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Scaladoc: add pan & zoom feature to Type Inheritance graphs
|
|/ / / / / / / / / |
|
|\ \ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
Scaladoc: fix stray number in codeblocks for firefox
|
|/ / / / / / / / |
|
|\ \ \ \ \ \ \ \
| |_|_|_|/ / / /
|/| | | | | | | |
Merge/2.11.x to 2.12.x 20160203 [ci: last-only]
|
| |\ \ \ \ \ \ \
| |/ / / / / / /
|/| | | | | | |
| | | | | | | | |
merge/2.11.x-to-2.12.x-20160203
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Update partest to 1.0.12, test case for reporting invalid flags
|
| | |_|_|/ / / /
| |/| | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
restore / rewrite various tests
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Rewrite tests for new optimizer
- SI-6941
- SI-2171
- t3430
- t3252
- t4840
- t2171
- t3430
- t3252
- t6157
- t6547
- t8062
- t8306
- t8359
- t9123
- trait-force-info
- private-inline
test cases for bugs fixed in the new optimizer
- SI-9160, the unnecessary boxing mentioned in the ticket is optimzied
since push-pop elimination (#4858).
- SI-8796
- SI-8524
- SI-7807
fix flags file for t3420
remove an empty flags file
remove unnecessary partest filters
explicit inliner warnings in test t7582
Restore the lisp test. Removing the flags file - our build runs with the
(new) optimizer enabled anyway.
The test spent the past few years as an optimizer test in pos/
see https://issues.scala-lang.org/browse/SI-4512. The attempt may fail,
but why not give it a try.
$ git lg -S"lisp"
...
| * | | | f785785 - SI-4579 Yoke the power of lisp.scala as a stress for the optimizer. (3 years, 8 months ago) <Jason Zaugg>
...
* | | | | | | 622cc99 - Revert the lisp test. (3 years, 10 months ago) <Paul Phillips>
...
* | | | | | | 97f0324 - Revived the lisp test. (3 years, 10 months ago) <Paul Phillips>
...
* | 1e0f7dc - Imprison the lisp test, no review. (4 years, 4 months ago) <Paul Phillips>
...
* | 6b09630 - "Freed the lisp test." Tweaked partest defaults... (4 years, 6 months ago) <Paul Phillips>
...
* | fec42c1 - Lisp test wins again, no review. (4 years, 8 months ago) <Paul Phillips>
...
* | 1c2d44d - Restored the lisp.scala test. (4 years, 8 months ago) <Paul Phillips>
...
* | 15ed892 - Temporarily sending lisp.scala to be interprete... (4 years, 8 months ago) <Paul Phillips>
...
|
| | | | | | | | | |
|
| | | | | | | | | |
|