| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
relax time constraint in duration-tck.scala (for Windows)
|
| | |
|
|\ \
| | |
| | | |
SI-7181 Eliminate unnecessary duplicates of finally blocks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The main body of a try and each exception handler were getting a copy of
the finally block for the "normal" flow case (i.e. where they don't
throw an uncaught exception or use "return" to exit early). But that's
not necessary.
With this commit the try body and each exception handler can all jump
to the same copy of the finally block on a normal exit.
A byte code test is included to ensure we're getting fewer copies of
the finally block.
inline-ex-handlers.check is updated because the icode is a bit different
without the extra finally block copies.
|
| |/
| |
| |
| |
| |
| |
| | |
As a first step towards fixing 7181, this commit improves the
comments and variable names around generating try/catch/finally blocks
in GenICode and adds a test verifying the current functionality of
try/catch/finally blocks
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With proper reachability analysis, the code for finding the final
destination of jump-only blocks was more complicated than needed. This
commit simplifies and speeds up that process using a standard
Tortoise and Hare algorithm on a Map from jump-only blocks to their
immediate destinations.
Test t7006 is increased a bit to make sure we don't get stuck on
infinite loops and to make sure we're deleting all but the essential
jump.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
GenASM was doing a bunch of stuff to eliminate unreachable exception
handlers, but it was still leaving behind other unreachable blocks, for
instance a finally block associated with an exception handler that got
removed would still be left lying around. ASM would in turn turn those
into a big pile of NOPs, which just take up space uselessly.
This commit replaces all the logic for eliding exception handlers with
a single unreachable block remover that catches unused exception
handlers and a whole lot more.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During ASM code emission we would recognize a block that consisted of
ICode-only artifacts (ENTER_SCOPE, EXIT_SCOPE, and LOAD_EXCEPTION)
followed by a jump. But we weren't using the same logic to recognize
all jump-only blocks. So jump-elision wasn't removing them. And that
in fact was why the ASM code emission had to do its special case.
This commit makes all jump-only block recognition use the same logic:
a jump-only block is one that has 0 or more ICode-only instructions
followed by a JUMP. It does't necessarily have to start with a JUMP.
There's now a debugWarning if the old NOP emitting code is triggered and
test t6102 is enhanced to error if that warning occurs.
|
|\
| |
| | |
fixes the test for SI-7112
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Freshly released Java 1.6.0_41 for OSX fails with "IllegalAccessError:
tried to access class JavaSimpleEnumeration_1 from class sun.proxy.$Proxy6",
and rightfully so, because that class isn't public.
I think I will avoid the usual "how could this even work before" in this
commit message.
|
|\ \
| | |
| | | |
SI-7120 Erasure must honor typeref prefixes
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Erasure was discarding these, which led to unnecessarily
wide types in quite particular circumstances. This showed
up as a double definition error in the reported bug when the
bridge method clashed with the erased signature.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* origin/2.10.x:
SI-7171 Consider prefix when assessing type finality.
please ant with filenames, add comments
Fixed error in reflection API docs about linearization order on method baseClasses
Shadowed Implict typo (fixes no issue)
remove unused imports
Conflicts:
src/reflect/scala/reflect/internal/Types.scala
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`Type#isFinalType` determines if a type could have a
non-bottom subtype. This property is exploited by
the pattern matcher to flag impossible patterns.
This check was ignoring the type's prefix, and
incorrectly deemed that `T#A` in `trait T { final class A }`
was a final type. But it could have been subtyped by
`U#A` where `U` <:< `T`, or, more simply, by `T.this.A`.
Now, type finality requires that the prefix is stable.
The existing test cases in neg/patmat-type-check.scala
still correctly flag incompatiblities.
`isFinalType` is also used by some code that massages
pattern matches post specialization. That is actually
either broken or obsolete under virtpatmat, I've opened
SI-7172 to invesigate that.
It is also used by GenICode to determine whether to emit
the appropriate equality checks that are correct in the
face of boxing. It is possible that this change will force
the slow path in some rare cases, but it won't affect
correctness.
|
|\ \ \ \
| |_|_|/
|/| | | |
SI-7015 Removes redundant aconst_null; pop; aconst_null creation
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Based on feedback on https://github.com/scala/scala/pull/2147
* Assertion in GenICode#adaptNullRef reports the erroneous type
* Test makes the Null type explicit for greater clarity
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In an effort to adapt methods and field accesses of type Null to
other types, we were always emitting
aconst_null
pop
aconst_null
The problem is we were doing that even when the JVM was in a position
to know it had null value, e.g. when the user had written a null
constant. This commit fixes that and includes a test to show that the
resulting byte code still works even without repeating ourselves and/or
repeating ourselves.
This commit also makes the scala.runtim.Null$ constructor private. It
was a sealed abstract class which prevented subclassing in Scala, but
it didn't prevent subclassing in Java. A private constructor takes care
of that hole so now the only value of type Null$ should be null.
Along the way I found some other questionable things in adapt and I've
added TODO's and issue https://issues.scala-lang.org/browse/SI-7159 to
track.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
viktorklang/wip-SI7164-nonfatal-notimplementederror
SI-7164 - Removing NotImplementedError as Fatal from s.u.c.NonFatal
|
| |/ / / |
|
|\ \ \ \
| | | | |
| | | | | |
Merge 2.10.x into master
|
| |\ \ \ \
| | |/ / /
| |/| / /
| | |/ /
| | | |
| | | |
| | | |
| | | | |
Conflicts:
build.number
src/compiler/scala/tools/nsc/doc/base/MemberLookupBase.scala
src/compiler/scala/tools/nsc/typechecker/Macros.scala
test/files/presentation/doc/doc.scala
|
| | |\ \
| | | | |
| | | | | |
Fix typing idempotency bug with Annotated trees
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This was inspired by the regression that Mark encountered
when upgrading SBT from 2.10.0 to 2.10.1-RC1.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
typedAnnotated transforms an Annotated tree into a Typed tree. The
original field of the result is set to the Annotated tree.
The bug was that typedAnnotated was using the untyped Annotated tree
as original, but also set its type. When re-typing later on the same
Annotated tree, the typer would consider it as alreadyTyped. This
is incorrect, the typer needs to convert Annotated trees to Typed.
Also, the Annotated tree only had its type field set, but its children
were still untyped. This crashed the compiler lateron, non-typed trees
would get out of the typing phase.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7134: don't require doc.Settings in base api of scaladoc.
|
| | | | | | |
|
| | |\ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
huitseeker/issue/value-protected-in-inherited-1000567
SI-5013 / #1000567 : added presentation test for fixed bug
|
| | | | | | | |
|
| | |\ \ \ \ \
| | | |/ / / /
| | |/| | | | |
Removing disabled, unneeded futures tests
|
| | | | | | | |
|
| | | |/ / /
| | |/| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The macro def <-> macro impl correspondence check compares names of the
corresponding parameters in def and impl and reports an error if they
don't match. This was originally designed to avoid confusion w.r.t named
arguments (which ended up being never implemented as described in SI-5920).
Sometimes parameter names are generated by the compiler, which puts the
user in a tough position. Luckily, there's an escape hatch built it, which
omits the name correspondence check if one of the parameters is SYNTHETIC.
Everything went well until we realized that evidences generated by
context bounds aren't SYNTHETIC, which led to the bug at hand.
Marking auto-generated evidence parameters SYNTHETIC was only the first
step, as the correspondence checker uses parameter symbols, not parameter
trees. Why's that a problem? Because SYNTHETIC doesn't get propagated from def
trees to their underlying symbols (see ValueParameterFlags).
Unfortunately one cannot just change ValueParameterFlags, because that
would break printouts generated in TypeDiagnostics, which is designed to not
print synthetic symbols. Thus we modify methodTypeErrorString in
TypeDiagnostics to always print synthetic symbols.
Therefore now we propagate all paramSym.flags when doing correspondent sweeps
to keep them in sync between def trees and their underlying symbols. This
fixes the problem.
|
| | |\ \ \ \
| | | |_|/ /
| | |/| | | |
SI-7091 Don't try to put a protected accessor in a package.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This shows up when a protected[pack] class has a constructor
with a default argument.
Regressed in f708b87 / SI-2296.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix and optimization in overriding logic.
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Given:
trait Foo { def f: Int = 5 }
trait Bar extends Foo { def f: Int }
I noticed allOverriddenSymbols for the abstract f defined in Bar
was returning the method from Foo, even though an abstract method
cannot override a concrete one. There were other bits of code
which accidentally depended on this outcome. Now allOverriddenSymbols
for Bar is empty.
The optimization is that whether or not a symbol overrides
any other symbols is known at creation time and does not change.
We now spend a lot less time looking for overridden symbols in
base classes by storing that value, "isOverridingSymbol".
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
Boxing cleanup: erasure, post-erasure, value classes.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Introduces extractors for value class trees. Puts them to
work to make the value class tree manipulations believable.
Eliminated some boxing code in erasure which had been
marked "maybe subsumed by posterasure?" after deciding
that it had been subsumed by posterasure.
Added some same-bytecode tests involving value class boxing
(actually the lack thereof.)
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There was no reason to have mutable.TreeSet use AVLTree while
immutable.TreeSet and immutable.HashSet used RedBlackTree. In
particular that would have meant duplicating the iteratorFrom logic
unnecessarily. So this commit refactors mutable.TreeSet to use
RedBlackTree for everything, including iteratorFrom. It also adds
a test to make sure TreeSet works as expected.
AVLTree should be dead code since it's private[scala.collection.mutable]
and only used by mutable.TreeSet, but to be safe it's only deprecated
in this commit.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Adds the ability to efficiently create an iterator that starts at a
given key or element of a sorted set or map. Similar work is done for
key and value only iterators on maps.
The bulk of the work is in RedBlackTree. Most of the rest is pushing
the new api methods throughout the appropriate spots in the collection
API.
This commit leaves undone some similar work possible on mutable TreeSets
|
|\| | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Implicits.scala
|
| |\ \ \
| | | | |
| | | | | |
silences t6323a
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Tag materialization notices enabled with -Xlog-implicits are now echoes
not printlns. Therefore, they go into stderr, not stdout, getting logged
by partest and not spamming stdout of partest.
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-6514 Avoid spurious dead code warnings
|
| | | |/ /
| | |/| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`deadCode.expr` stores the method symbol most recently encountered
in `handleMonomorphicCall`, and uses this to avoid warnings
for arguments to label jumps and `Object#synchronized` (which
sneakily acts by-name without advertising the fact in its type.)
But this scheme was insufficient if the argument itself contains
another method call, such as `matchEnd(throw e(""))`.
This commit changes the single slot to a stack, and also
grants exemption to `LabelDef` trees. They were incorrectly
flagged in the enclosed test case after I made the the first change.
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-6225 Fix import of inherited package object implicits
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The prefix in the ImplicitInfo must be com.acme.`package`.type,
rather than com.acme.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6935 Added readResolve in BoxedUnit
|
| | |/ / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When deserializing Unit, it would return an instance of Object, but not a Scala Unit.
By adding readResolve, the deserialization of Unit will work.
|
| |\ \ \ \ \
| | |_|_|/ /
| |/| | | | |
SI-6370 changed ListMap apply0 method to produce correct error message
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
a key is not found
Current implementation of apply0 relies on tail method to iterate over all keys.
When the list gets to its end, tail produces an 'empty map' message in its exception, which is thrown by ListMap.
This change checks if the collection is empty before calling tail and provides a more appropriate key not found message.
Signed-off-by: Vinicius Miana <vinicius@miana.com.br>
|