| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| | |
Conflicts:
src/compiler/scala/reflect/reify/Errors.scala
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
|
| |\
| | |
| | | |
SI-5710 has fixed itself
|
| | |
| | |
| | |
| | | |
My job here is only to submit tests.
|
| |\ \
| | | |
| | | | |
reifier is now aware of SI-7235
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
SI-7235 is caused by a long-standing todo in typedRefinement, which leads
to originals of compound type trees swallowing their stats.
I'm not sure how exactly to fix SI-7235, but what I am sure about is that
we shouldn't silently discard stats during reification. This patch
introduces a new implementation restrictions, which now reports that
reify of compound type trees with non-empty stats isn't going to work.
|
| |\ \
| | | |
| | | | |
SI-7214 outer check based on dealiased pattern type.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This change is not externally visible. It moves the scaladoc
sources into src/scaladoc and adds an ant target for building
them. The compilation products are still packaged into
scala-compiler.jar as before, but with a small change to
build.xml a separate jar can be created instead.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The unreachable test was missing the cases when Random.nextInt returned
a negative number. This commit fixes that.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7231 Fix assertion when adapting Null type to Array type
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
GenICode was doing a sanity check when adapting an expression of type
Null to something else. It was just doing the wrong one. Instead of
checking whether the result expression type was a reference type it
was checking to see if it was an class reference type. This commit fixes
that and adds a test to make sure both forms of adaptation work as
expected.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
SI-7006 Prevent unreachable blocks in GenICode
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit makes GenICode prevent the generation of
most unreachable blocks. The new unreachable block prevention code can
be disabled with a compiler flag.
Because full unreachable analysis is no longer necessary for
normal code it makes the unreachable block analysis run only under
-optimise.
A test is included to make sure unreachable code doesn't cause issues
in code gen.
A concrete example will help.
def foo(): X = {
try
return something()
catch {
case e: Throwable =>
println(e)
throw e
}
unreachableCode()
]
Here unreachableCode() is unreachable but GenICode would create ICode
for it and then ASM would turn it into a pile of NOPS.
A previous commit added a reachability analysis step to eliminate
that unreachable code but that added a bit of time to the
compilation process even when optimization was turned off.
This commit avoids generating most unreachable
ICode in the first place so that full reachability analysis is
only needed after doing other optimization work.
The new code works by extending a mechanism that was already in place.
When GenICode encountered a THROW or RETURN it would put the
current block into "ignore" mode so that no further instructions
would be written into the block. However, that ignore mode flag
was itself ignored when it came to figuring out if follow on blocks
should be written. So this commit goes through places like try/catch
and if/else and uses the ignore mode of the current block to decide
whether to create follow on blocks, or if it already has, to kill by
putting them into ignore mode and closing them where they'll be
removed from the method's list of active blocks.
It's not quite as good as full reachability analysis. In particular
because a label def can be emitted before anything that jumps to it,
this simple logic is forced to leave label defs alone and that means
some of them may be unreachable without being removed. However, in
practice it gets close the the benefit of reachability analysis at
very nearly no cost.
|
|\ \ \ \ \
| | |/ / /
| |/| | |
| | | | |
| | | | | |
Conflicts:
src/library/scala/collection/mutable/ArrayOps.scala
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-7215 Fix transpose of an empty Array[Array[T]].
|
| | | | | | |
|
| |\ \ \ \ \
| | |_|_|_|/
| |/| | | | |
SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
|
| | | | | | | |
| \ \ \ \ \ | |
| \ \ \ \ \ | |
| \ \ \ \ \ | |
| \ \ \ \ \ | |
| \ \ \ \ \ | |
|\ \ \ \ \ \ \ \ \
| | |_|_|/ / / / /
| |/| | | / / / /
| | | |_|/ / / /
| | |/| | | / /
| |_|_|_|_|/ /
|/| | | | | /
| | | | | |/
| | | | |/| |
Fix check file for run/t7185.
|
| | | | |/
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
A Typed Pattern (_: T) is more than `.isInstanceOf`: if `T` is a
path dependent type, the scrutinee's $outer reference is also
compared against the prefix of `T`.
The code that synthesises this is split into two places.
`needsOuterCheck` determines whether to add this check, based on
the type `T`, and the type of the scrutinee. If it gives the
go-ahead, `treeCondStrategy.outerCheck` synthesizes the check.
The new test case demonstrates the problems caused by the failure
to dealias in `needsOuterCheck`: it could either wrongly lead to
synthesis of an outer test (which would crash), or wrongly omit
the outer test (meaning overly liberal matching.)
A simple `dealias` remedies this. `dealiasWiden` is *not*
appropriate here; we need to keep hold of singleton types.
I'll also note that there is already a little slack between these
methods, as commented:
> ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix`
> by `Select(q, > outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix`
> if there's an outer accessor, otherwise the condition becomes `true`
> TODO: can we improve needsOuterTest so there's always an outerAccessor?
So this is probably a fragile area that warrants a careful review
with a view to design improvements.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We got there typechecking code with a redundant
layer of Block.
We can't express that in source code, so we test
this with manual tree construction and with XML
literals, which as reported produce such trees.
|
| |\ \ \ \
| | | | | |
| | | | | | |
Revert SI-6240 synchronization for runtime reflection
|
| | | |_|/
| | |/| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit reverts #2083:
- 387b2590db runtime reflection: death from thousand threads
- 73d079fb38 removes the assertion in missingHook
- f4dd56ca5d synchronizes names
- dd148de5a8 synchronizes pendingVolatiles
- 4cbb9357c5 synchronizes toolboxes
- 07bcb6176a SI-7045 reflection now auto-initializes selfType
- bebd62d566 optimizes Scala reflection GIL
- 735634f1d6 initializes lazy vals and inner objects in advance
- 5b37cfb19a introduces GIL to Scala reflection
- 981da8edfc cleans up initialization of runtime reflection
- b2c2493b22 reflection no longer uses atPhase and friends
- a9dca512d8 synchronizes symbols
- 0262941b3c removes the crazy extraneous log
- 21d5d3820b moves Symbol#SymbolKind to Symbols
|
| |\ \ \ \
| | |/ / /
| |/| | | |
Merge 2.10.1 into 2.10.x
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-6240 synchronization for runtime reflection
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
not anymore
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
selfType joins the happy family of flags, annotations and privateWithin,
which automatically trigger initialization, when used within runtime
reflection.
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Integrate range positions.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This is a stepping stone to having range positions all the
time, as well as to modularizing the presentation compiler.
It does not enable range positions by default, only places
them smoewhere where they can be.
|
|/ / / / / / |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Merge 2.10.1 into master
|
| |\ \ \ \ \ \
| | | |_|/ / /
| | |/| | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/ast/Trees.scala
src/library/scala/concurrent/impl/ExecutionContextImpl.scala
|
| | |\ \ \ \ \
| | | |/ / / /
| | |/| | | /
| | | | |_|/
| | | |/| | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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-7163 backport of annotated retyping to 2.10.1
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
| | | |/ / / |
|
| | | |/ /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This reverts commit 54a84a36d5b435a787d93ca48d45399136c7e162.
This is necessary to maintain binary compatibility with 2.10.0.
run/t6989.check had to be updated as it also (indirectly) tested SI-6548
Conflicts:
test/files/lib/javac-artifacts.jar.desired.sha1
test/files/run/t6548.check
test/files/run/t6548/Test_2.scala
|
| | |\ \ \
| | | | | |
| | | | | | |
resetAttrs now always erases This.tpe
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The symbol of This, if it points to a package class, isn't touched, just
as usual, so that our Select(Select(Select(...))) => This(...) optimization
works fine with attr reset.
However the tpe is now erased, so that subsequent reflective compilation
doesn't spuriously fail when seeing that some subtrees of a tree being
compiled are typed.
Erasing the tpe doesn't pose even a tiniest problem, because, as it can
be seen in typedThis, type is trivially reconstructed from the symbol.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-7074 Fix xml attribute sorting
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Sorting the attributes of an xml element could drop some of the
attributes. It was caused by the incorrect use of MetaData#copy() to
concatenate "smaller" with the rest of the attributes. The
MetaData#copy() method is similar to the following hypothetical method
on a List:
def copy(other: List): List = head :: other
The fix prepends all elements of "smaller" to the rest of the attributes
in the proper order.
|
| | |\ \ \ \ \
| | | |_|_|_|/
| | |/| | | | |
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-7159 Distinguish between assignability and subtyping in TypeKinds
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In preparation for dealing with a problem in TypeKinds, this commit
does some cleanup of code related to doing coercions.
* Comments are added to clarify.
* A println when converting between BOOL and anything else is removed
and the code is allowed to flow through to an assertion.
* Assertions are refactored to use string interpolation.
* A few pattern matches were reformulated to equivalent variants
In addition, a test is created for SI-107, the bug that necessitated
the special case in GenICode#adapt for LONG coercion
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
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
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|