| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-7247, deprecate NotNull.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Removed NotNull from tests and the parentage of AnyVal.
Removed the tests which were actually testing anything to
do with NotNull; massaged the others to forget NotNull and/or
not to name local things NotNull.
|
|\ \
| |/
|/| |
Analyze constants to remove unnecessary branches
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit cleans up constant optimization from the review of
https://github.com/scala/scala/pull/2214 .
* drops are done using the instruction's consumed count rather than a
numeric literal
* drops are moved into one common method in the main instruction
interpreter
* One instance of x.length > y.length is replaced with
x.lengthCompare(y.length) > 0
* NaN is dealt with by treating it as an UNKNOWN
* A test is added to make sure NaN semantics aren't broken.
* The constant-optmization test is improved with tests for switch
statements
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds analysis and optimization of constants to remove
unnecessary branches. It uses abstract interpretation to determine
what constant(s) a particular stack slot or variable might or might not
hold at a given spot and uses that knowledge to eliminate branches that
cannot be taken. Its primary goal is null check removal, but it also
works for other constants.
Several tests are modified to include the new optimization phase.
Two new tests are added. One verifies that branching still works as
expected. The other verifies that branches are removed.
|
|\ \
| | |
| | | |
Merge 2.10.x into master
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
ExtensionMethods marks private constructors of value classes as
notPRIVATE before pickling. When the pickler reads the flags of this
symbol, the anti-shift mechanism folds this into the regular PRIVATE
flag, so the class is pickled as though it was public all along. A
seprately compiled client can then call this constructor.
To remedy this, we must:
- pickle `rawFlags`, rather than `flags`. This is symmetric with
unpickling, which sets `rawFlags` with the value it reads.
- Add `notPRIVATE` to the flagset `PickledFlags`.
We cannot make this change in a minor version, as the pickler
and unpickler must agree on `PickledFlags`.
I believe that this won't change the size of pickled flags
for the majority of symbols (ie, those without the notPRIVATE flag)
due to the variable length encoding in `writeLongNat`.
This also improves the situation for SI-6608. Reflection and
scalap (and, by extension, IntelliJ), no longer will see
as public methods that have had their access widened in
SuperAccessors (which is done selectively to support inlining
under separate compilation.)
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|