| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-6035: Specialization and separate compilation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix an issue when specialization wouldn't work properly
in a setting where separate compilation was involved.
E.g. if you inherit from a class that is specialized and
has been compiled separately you might not get proper
forwarders generated. A test-case that this commit
adds covers that scenario.
The root cause of this issue was the fact that
SPECIALIZED flag was not pickled. Thanks to recent
Flags reorganization (see a9b85db) all that needs
to be done is to set the flag before pickling.
We choose to that in superaccessors phase because
it's a phase that runs before pickling and after
type checking (so we can check if given symbol
has an annotation).
Removed old logic from uncurry that was responsible
for setting flags that is not needed anymore because
we set them in superaccessors.
Review by @axel22 and @paulp.
|
|\ \
| | |
| | | |
SI-6028 Avoid needless symbol renaming in lambdalift
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Preserve names of all referenced free vars. Only the proxy symbols
have the fresh names.
The resulting natural beauty is evident in the diff of t6028.check.
This subsumes the treatment in 0e170e4b that ensured named parameter
calls cannot see mangled names; pos/t6028 confirms as much.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
No doubt there are plenty of additional variations that could be
added to exercise more code paths.
This is the unflattering "before" photo; the next commit will
make over the name mangling and reveal the simple beauty of
unmangled names.
References SI-6028
|
|\ \
| | |
| | | |
Partest: add `instrumented` test category.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
---
(taken from README)
Tests in `instrumented/` directory are executed the same way as in `run/` but
they have additional byte-code instrumentation performed for profiling. You
should put your tests in `instrumented/` directory if you are interested in
method call counts. Examples include tests for specialization (you want to
count boxing and unboxing method calls) or high-level tests for optimizer
where you are interested if methods are successfuly inlined (so they should
not be called at runtime) or closures are eliminated (so no constructors
of closures are called).
Check `scala.tools.partest.instrumented.Instrumentation` to learn how to
use the instrumentation infrastructure.
The instrumentation itself is achieved by attaching a Java agent to the
forked VM process that injects calls to profiler. Check
`scala.tools.partest.javaagent.ProfilingAgent` for details.
---
A few notes on low-level details of this change:
* Partest now depends on asm library for byte-code instrumentation
(`build.xml`)
* Build additional jar called `scala-partest-javaagent.jar` that is
used with `-javaagent:` option. (`build.xml`)
* Set `-javaagent:` option for all tests in `instrumented/` directory.
(`RunnerManger.scala`)
* Introduce a new category of tests called `instrumented`.
* Add one instrumented test to demonstrate usage and test new
infrastructure itself. (`InstrumentationTest.scala`)
Review by @phaller.
|
|\ \
| | |
| | | |
SI-6011 switches: unreachability, guard-free form
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A complete overhaul. The original implementation in SI-5830 (#821) was pretty buggy.
[from the doc comment of `collapseGuardedCases`:]
Collapse guarded cases that switch on the same constant (the last case may be unguarded).
Cases with patterns A and B switch on the same constant iff for all values x that match A also match B and vice versa.
(This roughly corresponds to equality on trees modulo alpha renaming and reordering of alternatives.)
The rewrite only applies if some of the cases are guarded (this must be checked before invoking this method).
The rewrite goes through the switch top-down and merges each case with the subsequent cases it is implied by
(i.e. it matches if they match, not taking guards into account)
If there are no unreachable cases, all cases can be uniquely assigned to a partition of such 'overlapping' cases,
save for the default case (thus we jump to it rather than copying it several times).
(The cases in a partition are implied by the principal element of the partition.)
The overlapping cases are merged into one case with their guards pushed into the body as follows
(with P the principal element of the overlapping patterns Pi):
`{case Pi if(G_i) => B_i }*` is rewritten to `case P => {if(G_i) B_i}*`
The rewrite fails (and returns Nil) when:
(1) there is a subsequence of overlapping cases that has an unguarded case in the middle;
only the last case of each subsequence of overlapping cases may be unguarded (this is implied by unreachability)
(2) there are overlapping cases that differ (tested by `caseImpliedBy`)
cases with patterns A and B are overlapping if for SOME value x, A matches x implies B matches y OR vice versa <-- note the difference with case equality defined above
for example `case 'a' | 'b' =>` and `case 'b' =>` are different and overlapping (overlapping and equality disregard guards)
Improved by @retronym's feedback in the following ways:
- fix patternEquals (it's now quadratic, but correct)
- update neg/t6011 to test the improved patternEquals
- remove side-effect-in-condition ugliness
- introduce isGuardedCase
- docs & various code clarity
Also closes SI-6048 (duplicate).
|
|\ \
| |/
|/| |
SI-5956 trigger copy generation with correct namer
|
| |
| |
| |
| |
| |
| | |
the call to `addCopyMethod` passes `templateNamer`, which is supposed to be the
namer of the case class template. with two classes of the same name, `addCopyMethod`
was triggered in the wrong template.
|
|\ \
| | |
| | | |
Implicits to encourage more Name-dropping.
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This creates implicits in cakes across the land from:
String => TermName
String => TypeName
And also from:
Name => NameOps[Name] // lower priority
TermName => NameOps[TermName]
TypeName => NameOps[TypeName]
What this is all about, using "drop" as a motivating example,
is that these should all work:
"abc" drop 1 // "bc": String
("abc": TermName) drop 1 // "bc": TermName
("abc": TypeName) drop 1 // "bc": TypeName
(("abc": TypeName): Name) drop 1 // "bc": Name
But this should not:
("bc": Name) // ambiguity error
This requires drop not being directly on Name; peer implicits
from String => TermName and String => TypeName; implicit
classes to install drop on TermName and TypeName; and a lower
priority implicit class to allow ops on Names.
Review by @xeno.by .
|
| |_|/
|/| |
| | |
| | | |
by weakening an assertion. explained in the source comment.
|
|\ \ \
| | | |
| | | | |
SI-6022 model type-test-implication better
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
we use subtyping as a model for implication between instanceof tests
i.e., when S <:< T we assume x.isInstanceOf[S] implies x.isInstanceOf[T]
unfortunately this is not true in general.
SI-6022 expects instanceOfTpImplies(ProductClass.tpe, AnyRefClass.tpe), but
ProductClass.tpe <:< AnyRefClass.tpe does not hold because Product extends Any
however, if x.isInstanceOf[Product] holds, so does x.isInstanceOf[AnyRef],
and that's all we care about when modeling type tests
|
|\ \ \ \
| | |_|/
| |/| |
| | | |
| | | | |
Conflicts:
src/reflect/scala/reflect/internal/Flags.scala
|
| | | | | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| |\ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
'refs/pull/828/head'; commit 'refs/pull/850/head'; commit 'refs/pull/858/head' into 2.10.x
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
- Display the type of the typed qualifier (qual1), to avoid the
message "Illegal type selection from volatile type null".
- Show the upper bound, which is used to calculate the volatility.
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Removes the two global hash maps in Namers, and the one in NamesDefaults. Also fixes SI-5975.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
* Removed unneeded .flags.
* Renamed a few methods in `InteractiveTest`.
* Force the presentation compiler to shut down after each test.
* -sourcepath in the .flags file is now relative to the test's base directory.
* Use `InteractiveReporter` in Presentation Compiler tests.
By using the `InteractiveReporter`, compilation errors are collected in the
compilation unit. This was necessary for testing SI-5975.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit adds test files
neg: checks the error messages generated by the compiler
run: checks the macro implementation features
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit provides the new sha1 codes of the new STARR.
Moreover, it replaces the implementation of StringContext.f
to `macro ???`. The implementation is magically hardwired into
`scala.tools.reflect.MacroImplementations.macro_StringInterpolation_f`
by the new STARR.
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Cleaned up and optimized code that maps between raw and pickled flags. Avoids mystery constants. Makes a whole bunch of new flags be pickled which were not pickled before (more precisely: Everything in InitialFlags with value greater than 1 << 31 which is not in FlagsNotPickled now gets pickled whereas before it wasn't. Among these: VARARGS, IMPLCLASS, SPECIALZED, DEFAULTINIT, SYNCHRONIZED. I am curious how many tickets will get fixed by this change.
The first one I noted is t5504, which previously enforced the buggy behavior through a neg check!
There are also some build manager check file changes that have to do with the fact that flags now print in a different order for performance reasons.
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|/ / /
|/| | | | | | | |
Collection of updates to SIP-14 (scala.concurrent)
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Developed by Viktor Klang and Havoc Pennington
- add Promise.isCompleted
- add Future.successful and Future.failed
- add ExecutionContextExecutor and ExecutionContextExecutorService for Java interop
- remove defaultExecutionContext as default parameter value from promise and future
- add ExecutionContext.Implicits.global which must be explicitly imported, rather
than the previous always-available value for the implicit EC
- remove currentExecutionContext, since it could create bugs by being
out of sync with the implicit ExecutionContext
- remove Future task batching (_taskStack) and Future.releaseStack
This optimization should instead be implemented either in
a specific thread pool or in a specific ExecutionContext.
Some pools or ExecutionContexts may not want or need it.
In this patch, the defaultExecutionContext does not
keep the batching optimization. Whether it should
have it should perhaps be determined through benchmarking.
- move internalBlockingCall to BlockContext and remove currentExecutionContext
In this patch, BlockContext must be implemented by Thread.currentThread,
so the thread pool is the only place you can add custom hooks
to be run when blocking.
We implement BlockContext for the default ForkJoinWorkerThread in terms of
ForkJoinPool.ManagedBlocker.
- add public BlockContext.current and BlockContext.withBlockContext
These allow an ExecutionContext or other code to override
the BlockContext for the current thread. With this
API, the BlockContext is customizable without
creating a new pool of threads.
BlockContext.current is needed to obtain the previous
BlockContext before you push, so you can "chain up" to
it if desired.
BlockContext.withBlockContext is used to override the context
for a given piece of code.
- move isFutureThrowable into impl.Future
- add implicitNotFound to ExecutionContext
- remove default global EC from future {} and promise {}
- add ExecutionContext.global for explicit use of the global default EC,
replaces defaultExecutionContext
- add a timeout to scala-concurrent-tck tests that block on SyncVar
(so tests time out rather than hang)
- insert blocking{} calls into concurrent tck to fix deadlocking
- add NonFatal.apply and tests for NonFatal
- add OnCompleteRunnable marker trait
This would allow an ExecutionContext to distinguish a Runnable originating
from Future.onComplete (all callbacks on Future end up going through
onComplete).
- rename ListenerRunnable to CallbackRunnable and use for KeptPromise too
Just adds some clarity and consistency.
|
|/ / / / / / / |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6036 yet again makes sense of magic symbols
|
| |/ / / / / / |
|
|\ \ \ \ \ \ \
| |_|_|_|/ / /
|/| | | | | | |
SI-2442 sealedness for java enums non-experimental
|
| |/ / / / / |
|
| |_|_|_|/
|/| | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fix SI-3836 not-really-ambiguous import detection.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Normalize types before declaring that two imports are ambiguous,
because they might be the same thing. Review by @moors.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
SI-5981, SI-5979, SI-5973, SI-5890 Closed. Maintenance to Try.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[SI-4691, SI-6008] improve patmat analyses: irrefutable user-defined extractors, no-op type tests
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
augment the equality axioms to take into account that
a type test against the static type of a variable succeeds unless the variable is null
for exhaustivity we disregard null, so the type test always succeeds
during unreachability we model this knowledge as the obvious implication
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
overhauls treeMakersToConds in the process -- was getting a bit unwieldy
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5907, SI-5009 case-class copy defaults only for first param list
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | | |
`copy` no longer returns anonymous functions if there are multiple parameter lists, reverts most of 40e7cab7a2.
Cleaned up the special type completer for copy methods.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
SI-5959 type equality now accounts for mirrors
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
TypeRef(ThisType(<package1>), sym, args) should always be equal to
TypeRef(ThisType(<package2>), sym, args) regardless of whether
package1 and package2 actually represent the same symbols of not.
This goes for subtyping (<:<) and type equality (=:=).
However regular equality (==) and hashconsing is unaffected
as per http://groups.google.com/group/scala-internals/browse_thread/thread/4bef4e6987bb68fe
This is done to account for the fact that mirrors share normal symbols,
but never share package symbols. Therefore at times it will occur that
the same types loaded by different mirrors appear different because of
the package symbols. More details: https://issues.scala-lang.org/browse/SI-5959.
|
| |_|/ /
|/| | | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-5830 switches: support guards, unreachability
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
turn switches with guards into guard-free switches by collecting all cases
that are (possibly) guarded by different guards but that switch on the same constant,
and pushing the implied if-then-else into the collapsed case body
```
case C if G1 => B1
case C if Gi => Bi
case C if GN => BN
```
becomes
```
case C => if (G1) B1
else if (Gi) Bi
else if (GN) BN
else default() // not necessary if GN == EmptyTree
```
default() is a jump to the default case; to enable this, we wrap a default() { } labeldef
around the last case's body (the user-defined default or the synthetic case that throws the matcherror)
so we can jump to the default case after the last guard is checked
(assuming unreachability is checked, once we ended up in a non-default case,
one of the guards either matches or we go to the default case)
the unreachability analysis is minimal -- we simply check (after rewriting to guard-free form)
that:
- there are no duplicate cases
- the default case comes last
misc notes:
- can't jump in exception handlers (TODO: a more fine-grained analysis on when we need to jump)
- work around SI-6015 (test file run/t5830.scala crashed the inliner)
- propagate type of case body to label def of default case
(needed for existentials, see e.g., t2683)
- the default(){} LabelDef breaks SelectiveANFTransform -- workaround: don't write guarded switches in CPS code
(do the above transformation manually)
|
|\ \ \ \
| | | | |
| | | | | |
SI-2796 Warn if early definitions are used with a trait.
|