| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Factors out error raising code and introduces a special exception class
for Scala reflection errors.
Also adds membership sanity checks to reflectXXX. Previously
reflectField, reflectMethod, reflectClass and reflectModule
in InstanceMirror didn't check that the symbols being passed to them
actually correspond to some member of the related class.
|
|
|
|
|
|
|
| |
reflectField now accepts getters and setters along with the field symbols,
it also checks whether a field has a reasonable binary representation
(this is necessary, because ctor parameters that are unused outside of their
declaring constructors don't get compiled down to Java fields/methods).
|
|\
| |
| | |
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
|
|\ \
| | |
| | | |
updated intellij project files
|
| | | |
|
|\ \ \
| | | |
| | | | |
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.
|
|\ \ \ \
| |_|/ /
|/| | | |
With -Yno-generic-signatures, exit GenASM.getGenericSignature early
|
| | | |
| | | |
| | | |
| | | | |
This allows using -Yno-generic-signatures as a workaround for SI-4365.
|
| | |/
| |/| |
|
|\ \ \
| |/ /
|/| | |
Implicits to encourage more Name-dropping.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This brought to light that Name extends (Int => Char), and
that small convenience was not paying for itself. I updated
the places taking advantage of it to use Name#charAt.
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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 .
|
|\ \ \ \
| | | | |
| | | | | |
critical enhancements to SIP-14
|
| | | | |
| | | | |
| | | | |
| | | | | |
for the global execution context
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | | |
to DelayedLazyVal, removing currentExecutionContext, removing impl.Future.isFutureThrowable, implementing asExecutionContext, giving a decent fallback if ForkJoinPool cannot be created
|
|\ \ \ \
| | | | |
| | | | | |
fix Right,Left and Either scaladoc links
|
| | |_|/
| |/| | |
|
|\ \ \ \
| | | | |
| | | | | |
faster partest
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Why hand out big blocks of tests to workers. Just put them
all in a queue and let the threads consume them when they can.
This speeds up partest a fair bit in those not uncommon
situations where one worker would end up lagging well behind
the others, and drops another 150ish lines of code.
Test suite time on my 8-core machine goes from 28:21 to 22:34.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The actors in partest were offering nothing but unnecessary
complication and an extra dependency.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
SI-5957 enable direct parsing of nested java class classfile
|
|/ / / /
| | | |
| | | |
| | | | |
by weakening an assertion. explained in the source comment.
|
|\ \ \ \
| | | | |
| | | | | |
Fix doc about specialized subclasses of c.i.HashMap/HashSet.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The documentation was wrong and judging from the “TODO: add HashMap2,
HashMap3, ...” in the source file I refrained from mentioning any
specific number, so overall it has gotten a bit less precise, but
hopefully more correct.
Review: @heathermiller
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
After some more early exclusion of uninteresting arguments,
asSeenFrom is now over twice as fast. Compiling the collections,
three runs:
-- Without these two commits:
8108775ms, 8132052ms, 8257527ms in asSeenFrom
Wall clock: 0m54.202s, 0m54.877s, 0m55.925s
-- With these two commits:
3568719ms, 3542860ms, 3570892ms in asSeenFrom
Wall clock: 0m50.730s, 0m51.213s, 0m50.850s
(Rebase of https://github.com/scala/scala/pull/835)
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Eliminated about half the allocations of AsSeenFromMap by examining the
arguments more closely. The impact is not what one might conclude from
that statistic, because those were the cheap asSeenFrom calls - but now
they are cheaper. Also,
- worked in some eager vals rather than lazy ones.
- changed hot-spot comparison to use eq
- simplified annotationArgRewriter
- elimnated separate tracking of capturedPre
Statistics from compiling scala/collection/**.scala:
- 4209382 calls to asSeenFrom
- 1025945 maps created (instantiations of AsSeenFromMap)
- 1525649 maps avoided (these were instantiations before this patch)
Review by most honorable performance-san @gkossakowski .
(Rebase of https://github.com/scala/scala/pull/835)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6032 Enhance TaskSupport documentation.
|
| | |/ / /
| |/| | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6015 assertion (in Type-flow analysis) that wasn't, valid counterexample found
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
found
|
|\ \ \ \ \
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
polymorphic value classes
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
dropping boxing code, which turned out to be a dead end.
|
| | | | | | | |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
major fixes to how flags are pickled
|
| | | | | | | | |
|
| |\ \ \ \ \ \ \
| | | |_|_|_|_|/
| | |/| | | | |
| | | | | | | |
| | | | | | | | |
Conflicts:
src/reflect/scala/reflect/internal/Flags.scala
|