| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The crickets at http://www.scala-lang.org/node/11901 were in
unanimous agreement that I should proceed as suggested.
- No arguments to @specialize gets you 10/10, not 9/10
- Fixed bugs in AnyRef specialization revealed by trying to use it
- Specialized Function1 on AnyRef.
- Changed AnyRef specialization to use OBJECT_TAG, not TVAR_TAG.
- Deprecated SpecializableCompanion in favor of Specializable,
which has the virtue of being public so it can be referenced
from outside the library.
- Cooked up mechanism to group specializable types so we don't
have to repeat ourselves quite so much, and create a few groups
for illustrative purposes. I'm not too serious about those names
but I used up all my name-thinking-up brain for the day.
- Updated genprod and friends since I had to regenerate Function1.
- Put tests for a bunch of remaining specialization bugs in pending.
Closes SI-4740, SI-4770, SI-5267.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now it copies in the current versions of BoxesRunTime and ScalaRunTime
and applies patches to them, and the whole build is automated.
# This is the only thing I actually typed, the rest is fancy echo.
$ test/instrumented/mkinstrumented.sh build
% rm -rf /scratch/trunk1/test/instrumented/classes
% cp /scratch/trunk1/test/instrumented/../../src/library/scala/runtime/BoxesRunTime.java /scratch/trunk1/test/instrumented/../../src/library/scala/runtime/ScalaRunTime.scala /scratch/trunk1/test/instrumented/library/scala/runtime
% patch BoxesRunTime.java /scratch/trunk1/test/instrumented/boxes.patch
patching file BoxesRunTime.java
% patch ScalaRunTime.scala /scratch/trunk1/test/instrumented/srt.patch
patching file ScalaRunTime.scala
Hunk #3 succeeded at 63 (offset 23 lines).
Hunk #4 succeeded at 78 (offset 23 lines).
Hunk #5 succeeded at 81 (offset 23 lines).
Hunk #6 succeeded at 96 (offset 23 lines).
% /scratch/trunk1/test/instrumented/../../build/pack/bin/scalac -d /scratch/trunk1/test/instrumented/classes /scratch/trunk1/test/instrumented/library/scala/runtime/BoxesRunTime.java /scratch/trunk1/test/instrumented/library/scala/runtime/ScalaRunTime.scala
% javac -cp /scratch/trunk1/test/instrumented/../../build/pack/lib/scala-library.jar -d /scratch/trunk1/test/instrumented/classes /scratch/trunk1/test/instrumented/library/scala/runtime/BoxesRunTime.java
% cd /scratch/trunk1/test/instrumented/classes
% jar cf instrumented.jar .
% mv -f instrumented.jar /scratch/trunk1/test/instrumented/../../test/files/speclib
/scratch/trunk1/test/files/speclib/instrumented.jar has been created.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Annotations are now supported by the reifier:
* AnnotationInfos from symbols get transformed back into mods.
* AnnotatedTypes are retained and are reified along with AnnotationInfos.
Reification is no magic, and reification of annotations especially:
* Annotations cannot refer to symbols defined inside the quasiquote.
This restriction is due to the fact that we need to erase locally defined
symbols before reifying to make subsequent reflective compilations succeed.
However, while doing that, we also need to make sure that we don't make
resulting ASTs non-compilable by removing essential information.
This is tricky, and it more or less works for TypeTrees, but
not for annotations that can contain arbitrary ASTs.
For more details look into the comments to Reifiers.scala.
* Classfile annotations that contain array arguments and are applied to types,
i.e. the ones that generate AnnotatedTypes, cannot be reified.
This is because of limitations of manifest infrastructure.
Typechecking "Array(mirror.LiteralAnnotArg(...))" would require the compiler
to produce a manifest for a path-dependent type, which cannot be done now.
Review by @odersky.
|
|
|
|
|
|
|
|
| |
This is a logical next step after deprecating and removing LiftCode:
https://github.com/scala/scala/commit/ffc2389840852a120fecd772206d55db9a79f30e
Now when Paul has uploaded a starr that doesn't need Code, Code$ and Code.lift
we can finally remove the last remaining pieces of the old reification logic.
|
| |
|
|\ \
| | |
| | |
| | | |
'greedy/auto-fetch-jars', 'scalamacros/pullrequest/assorted' and 'VladUreche/feature/scaladoc-nofail' into develop
|
| |\| |
|
| | |
| | |
| | |
| | | |
This reverts commit e34098b7f6e37420198fa5c7c2820d0443b46cc4.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In the pursuit of simplicity and consistency.
- Method names like getType, getClass, and getValue are far too ambiguous,
both internally and especially with java reflection names. Methods which
accept or return scala symbols should not refer to them as "classes" in
the reflection library. (We can live with the FooClass convention for naming
the well-known symbols, it's names like "getClass" and "classToType" which
are needlessly conflationary.)
- Meaningless names like "subst" have to be expanded.
- We should hew closely to the terms which are used by scala programmers
wherever possible, thus using "thisType" to mean "C.this" can only beget confusion,
given that "thisType" doesn't mean "this.type" but what is normally called
the "self type."
- It's either "enclosing" or "encl", not both, and similar consistency issues.
- Eliminated getAnnotations.
- Removed what I could get away with from the API; would like to push
those which are presently justified as being "required for LiftCode" out of the core.
- Changed a number of AnyRefs to Any both on general principles and because
before long it may actually matter.
- There are !!!s scattered all over this commit, mostly where I think
the name could be better.
- I think we should standardize on method names like "vmSignature, vmClass" etc.
when we are talking about jvm (and ostensibly other vm) things.
There are a bunch more places to make this distinction clear (e.g.
Symbol's javaBinaryName, etc.)
- There is a lot more I want to do on this and I don't know where the
time will come from to do it.
Review by @odersky, @scalamacros.
|
| | |
| | |
| | |
| | |
| | | |
Couldn't live with a scala.Enumeration being a permanent
fixture in the reflection library. Rolled it by hand.
|
| | |\ \
| | | | |
| | | | |
| | | | | |
'scalamacros/pullrequest/5334', 'scalamacros/pullrequest/5272' and 'VladUreche/issue/5287-cleanup' into develop
|
| | | |/ |
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Major cleanup of reification:
* LiftCode phase has been removed
* Code has been deprecated and will be removed as we roll a new starr
* Logic related to type-directed lifting has been purged
scala.reflect.macro.Context#reify now provides the same services
as LiftCode provided (except that it returns Tree, not Code).
For testing purposes, I've retained the oh-so-convenient automagic lift.
test/files/codelib/code.jar now hosts Code.lift reimplemented in a macro,
so that the tests can continue working as if nothing has happened.
|
| | |
| | |
| | |
| | | |
Changed parameters in some tests to speed them up.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change resolves some issues with ParCtrie splitters and their
`remaining` method, which currently evaluates the size of the Ctrie.
Since this is still not done lazily, nor in parallel, it has a certain cost,
which is unacceptable.
Change #1: The `shouldSplitFurther` method is by default implemented by
calling the `remaining` method. This method now forwards the call to the
same method in the splitter which is by default implemented in the same
way as before, but can be overridden by custom collections such as the
ParCtrie.
Change #2: ParCtrie splitter now has a `level` member which just counts
how many times the method has been split. This information is used to
override the default `shouldSplitFurther` implementation.
Change #3: The tasks and splitters rely heavily on the `remaining` method
in the splitter for most operations. There is an additional method called
`isRemainingCheap` which returns true by default, but can be overridden
by custom collections such as the `Ctrie`.
|
| | | |
|
| | |
| | |
| | |
| | | |
Implemented Ctrie serialization. Improved hashcode computation.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ctrie is a scalable concurrent map implementation that supports
constant time lock-free lazy snapshots.
Due to the well-known private volatile field problem, atomic
reference updaters cannot be used efficiently in Scala yet.
For this reason, 4 java files had to be included as well.
None of these pollute the namespace, as most of the classes
are private.
Unit tests and a scalacheck check is also included.
|
| | |
| | |
| | |
| | |
| | | |
This unclutters the namespace and makes defining custom parallel
collections a lot easier.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Concurrent (thread-safe) collections can implement builders directly
for parallel collections by having themselves as builders, similar
to buffers being builders for themselves in sequential collections.
Combining 2 shared combiners can be expensive (more than logn), but
is never done, since `combine` is always called with `this` (receiver)
combiner, so `combine` just returns `this`.
This commit adds support for implementing a parallel collection by
having itself as combiner (parallel builder). To do this, clients
must now merely implement their combiners by overriding the method
`canBeShared` and having it return `true`.
The support is implemented by refining the abstraction which creates
combiners in tasks - this abstraction is provided by the
protected `combinerFactory` method, previously `cbfactory`.
The essential difference is that if the combiner can be shared, this
method returns a combiner factory which always returns the same combiner.
Otherwise, it always creates a new combiner.
Span and takeWhile had to be modified for shared combiners to make this
work, but for all other collections they work as before.
Several other tasks had to be modified slightly, as well.
|
| |/
|/|
| |
| |
| | |
added reference equality checks to updated0 and removed0 to prevent creation of a new map when updating an entry with the same value or
removing an entry that was not present to begin with.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
determine match strategy by typing `__match`
factored out the interface to generate code in this monad, cleaned up codegen a bit
no longer solving a context bound to determine the match strategy and the monad's type constructor
it's too expensive
don't consider implicits looking for __match
implicit search causes HUGE slowdowns -- now the overhead is about 4% compared to just assuming there's no __match in scope
to support virtualization&staging, we use the type of `__match.one` as the prototype for how to wrap "pure" types and types "in the monad"
pure types T are wrapped as P[T], and T goes into the monad as M[T], if one is defined as:
def one[T](x: P[T]): M[T]
for staging, P will typically be the Rep type constructor, and type M[T] = Rep[Option[T]]
furthermore, naive codegen no longer supplies type information -- type inference will have to work it out
optimized codegen still does, of course, and that's enough since we only bootstrap that way
TODO: improve the test (currently the condition is not represented)
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
More specifically:
* Importers now preserve wasEmpty and original
* ToolBoxes no longer auto-evaluate nullary functions returned by runExpr
* All local symbols from previous typechecks are now correctly erased by ResetAttrs
* Originals are now reified
|
| |
| |
| |
| | |
Not to use the deprecated Enumeration constructor.
|
| | | |
| \ | |
|\ \ \
| | |/
| |/|
| | | |
'scalamacros/pullrequest/5427' and 'scalamacros/pullrequest/5423' into develop
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Default getter for annotations doesn't perform initialization, hence
we've faced the following bug: https://issues.scala-lang.org/browse/SI-5423.
One of the approaches to fixing it would be to auto-complete on getter,
but according to Martin we'd better not do that because of cycles.
That's why I'm just introducing a new, eager, variation of `annotations'
and redirecting public API to it.
Review by @odersky.
|
|/
|
|
|
| |
Negative "to" index should be normalized to 0 before using it
in a difference operation.
|
|\ \
| | |
| | |
| | | |
'hubertp/ticket/4336' into develop
|
| |\| |
|
| | | |
|
|\ \ \
| |_|/
|/| | |
AvlTree performance improvements
|
| | |
| | |
| | |
| | | |
Use a specialized iterator.
|
| | |
| | |
| | |
| | | |
recursion is not necessary here.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is part of an effort to make the immutable collections
(more) thread safe. The `::` still has non-final member fields
for head and tail, but there is not much that can be done right
now about that, since these fields are used by list buffers.
Tried writing a test with unsafe initialization, but could not
invent a scenario which actually fails, at least on the JDK6.
|
| | | | |
| \ \ | |
|\ \ \ \
| | |_|/
| |/| |
| | | | |
into develop
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Changed CompositeThrowable to inherit Exception instead of Throwable.
A few minor fixes for the jdk1.5 parallel collection tasks.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is done by structurally serializing list nodes, but prepending a special
`ListSerializationStart` symbol ahead of the list. If this symbol is not
in the object input stream, the deserialization reverts to the old mode.
Note there is not much to be done for list buffers - their serialization was
broken before, so legacy serialized list buffers are no longer deserializable.
However, their serialVersionUID was changed to reflect this, so deserializing
a legacy list buffer should fail fast.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
src/compiler/scala/reflect/internal/Symbols.scala
src/compiler/scala/reflect/internal/Types.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/library/scala/reflect/api/Trees.scala
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
The idea is that all operations that need to be synchronized are overriden in classes reflect.runtime.Synchronized*. Sometimes this applies to operations defined in SymbolTable, which can be directly overridden. Sometimes it is more convenient to generate SynchronizedClazz subclasses of SymbolTable classes Clazz. In the latter case, all instance creation must go over factory methods that can be overridden in the Synchronized traits.
|
| | | | | |
|
| | | | | |
|
| | | | | | |
| \ \ \ \ | |
| \ \ \ \ | |
| \ \ \ \ | |
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | | |
'scalamacros/topic/antbuildexception', 'leifwickland/SI-5405' and 'axel22/issue/5377' into develop
|
| | | | |_|/ /
| | | |/| | |
| | | | | | |
| | | | | | | |
Converting the buffer to another arraybuffer instead of to a list.
|
| | |/ / / / |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
given moment (instead of throwing type errors). This avoids previous problems where we were creating fake error trees in some incorrect places like in type completers in Namers etc. Implicits relied heavily on type errors being thrown but performance should stay the same due to some explicit checks/returns.
Some of the problems involved how ambiguous error messages were collected/reported because it was very random (similarly for divergent implicits). This should be more explicit now. Reduced the number of unnecessary cyclic references being thrown (apart from those in Symbols/Types which don't have a context and need to stay for now as is).
Review by @paulp, @odersky.
|
|/ / / /
| | | |
| | | |
| | | | |
Plus a big unit test I had lying around.
|