| Commit message (Collapse) | Author | Age | Files | Lines |
|\ \
| | |
| | |
| | | |
'ijuma/feature/signum' into develop
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Multiple minor fixes to Martin's implementation of reflection infrastructure.
Dominating theme is allowing for the fact that compilation via reflection
involves numerous exports/imports between various reflection universes.
Fixes SI-5230. Review by @odersky.
|
|/ /
| |
| |
| |
| |
| |
| | |
Rolled damaru-levenshtein algorithm back to my original "pure"
version. Cut max distance to 1. Turned on by default because
now it offers nothing unexpected, and removed short-lived
-Ysuggest-idents option.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Suggest possible alternatives when an identifier is not in scope.
% scala -Ysuggest-idents
scala> import scala.collection.mutable._
import scala.collection.mutable._
scala> new MistBuffer
<console>:11: error: not found: type MistBuffer (similar: ListBuffer, Buffer)
new MistBuffer
^
Too bad, no MistBuffer. We'll settle for ListBuffer.
|
|/
|
|
|
| |
No secondary "reassignment to val" for unknown identifiers
in assignment position.
|
|
|
|
|
|
|
|
|
| |
ScalaDoc."
This reverts commit 086b558f2d025323c86226b2560578c50ee48b84.
It causes two scaladoc tests to fail; the scaladoc tests are almost
completely opaque and I have no time to reverse engineer them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
the requirement of a !# line when using it. This is how some other
languages, such as ruby, are run.
Typical usage:
#!/usr/bin/env scala
println("Hello, "+args(0)+"!")
Contributed by: Daniel C. Sobral
|
|\ \ \
| | | |
| | | |
| | | | |
'remotes/odersky/topic/reify', 'remotes/robinst/master' and 'remotes/szeiger/bitset' into pending
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Mutable and immutable BitSets now extend SortedSet, using a fixed
Ordering.Int and an efficient bit mask based rangeImpl()
- fromArray methods in both implementations are deprecated in favor of
new fromBitMask and fromBitMaskNoCopy methods
- New toBitMask method for converting bit sets back to Array[Long] bit
masks
- immutable.BitSet uses a more efficient Builder, based on
mutable.BitSet (closes SI-4647)
- Delete scala.tools.nsc.util.BitSet (not used anywhere)
Review by @odersky
|
| |/
| |
| |
| | |
emptyValDef has special meaning in the compiler, so reify needs to preserve it by identity and not just by structure.
|
| |
| |
| |
| | |
Turns out that forcing AnnotationInfo on .pos is too eager. Protected by if (forced) now.
|
|/
|
|
| |
Lazy annotation now return positions and one can also set them. Fixes a problem reported by Greg (no ticket created).
|
|
|
|
|
|
|
|
| |
I messed up my trip to the future the first time around; now in the
future 5.f is not an error but an attempt to call method "f" on 5 like
nature intended. (Thank you simon for catching this.) And deprecated
leading 0 for octal. Closes SI-5205.
|
|
|
|
|
|
| |
Added the check against UnitClass in freeLocalsTraverser. Closes
SI-5245. Review by odersky.
|
| |
|
|
|
|
|
|
|
|
|
| |
Small change to get rid of naming awkwardness for macros. Class based
macros now have a parameter section (_this: Tree), module based macrod
have an empty pararameter section () instead. So we can let them have
the same name, because overloading resolution will distinguish them
anyway. Review by burmako.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Yreify-copypaste: the copy/pasteable mode for reification
When experimenting with macros, I've found out that it's helpful to
use the reifier to find out what Scala idioms map to what Tree shapes.
However, stuff emitted by -Yreify-debug is too verbose, that's why I
decided to put up a human-readable dumper.
To use the dumps, you need to first import the following things:
import scala.reflect.api._ import scala.reflect.mirror._ import
scala.reflect.api.Modifier._ import scala.reflect.internal.Flags._
The stuff is really experimental, e.g. the tension between flags and
modifiers needs to be thought out and addressed. Review by odersky.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Reflection toolboxes now respect settings that are provided to them.
Before the fix CompilerCommand lacked the (args, settings, errorFn)
ctor. I added it and provided means to augment passed settings with
custom errorFn.
Closes SI-5239. Review by odersky.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A remedy for an IllegalAccessError where generated bytecode referred to
an inaccessible type. Closes SI-1430.
Bonus materials:
- tore out all the invokedynamic support. The shipped jdk7
implementation shows limited resemblance to the one this was written
against; the code mostly serves to distract. (I think I could get
invokedynamic working pretty quickly, except that it would
mean having a codebase for java7 and one for 5-6, which is not a yak
I wish to shave today.)
- gave NullClass and NothingClass objects of their own, which
allowed a nice polymorphic simplification of isSubClass, plus a
couple other streamlinings.
|
| |
|
|
|
|
|
|
|
| |
Had AnnotationInfo extend Product3 since it's no longer a case class.
Tried to make reflection a little more robust. Closes SI-5223, review by
vogt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removed unnecessary zero that was added to all matches...
providing runOrElse's type args explicitly: speeds up compilation,
removes hacks needed to bootstrap
a bit of clean up to keep a list of list of treemakers, which encodes
the match, until the last possible moment this list of list is going to
be the subject of the analyses coming next
no review
|
| |
|
|
|
|
|
|
|
|
|
| |
Was enjoying watching adriaan go for the record for redundant
implementations of repackExistential, but eventually everyone has to
join Club Code Reuse. Trimmed 2/3 of the implementations and put the
remaining third somewhere it can be enjoyed by all. Continued by tearing
apart and reassembling TypeVar. Review by moors.
|
|
|
|
|
|
|
|
|
|
| |
Another case where I tried to get into the performance party but ended
up playing dungeons and dragons next door. However I did come away with
an attractive tablecloth, which I draped over Implicits.scala before
waving my magic wand.
TRANSLATION: it's probably not faster but it's still better.
|
|
|
|
|
|
|
|
| |
Keep seeing what might be our single use of Tuple3#zipped so high in
the profiling output. I don't think it's zipped3's fault, more that it
figures prominently in a major consumer of compile time, but it's not
going to hurt to send it on its merry way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AnnotationInfo inertia takes me into continuations.
And kept carrying me until I was carried away. The changes are mostly of
the janitorial variety, just doing my part to make the interesting logic
visible without being buried in low level compiler plumbing.
Added at least one seriously convenient convenience method:
tree modifyType fn
// equivalent to if (tree.tpe == null) tree else tree setType fn(tree.tpe)
This is the analogue to the recently added:
symbol modifyInfo fn
// same idea
It's like having our carpets steam cleaned when we can keep pushing
until machinery stays in the machine and the relevant logic stands
gloriously on top. You'll eventually exclaim, "I didn't even know these
carpets were that color!"
|
| |
|
|
|
|
|
| |
Closes SI-3566. Review by moors.
|
| |
|
|
|
|
|
|
| |
Preparations for new version of AbstractPartialFunctions that also does
isDefinedAt correctly. Should be a new starr. Review by extempore.
|
|
|
|
|
|
|
|
| |
Took a more ambitious swing based on input from martin. Eliminated
the external map and gave annotations a more useful inheritance
hierarchy. Eliminated AnnotationInfoBase and made LazyAnnotationInfo an
AnnotationInfo (just like LazyType is a Type.) Review by odersky.
|
|
|
|
|
| |
type test optimization now takes GADT hack into account
|
| |
|
| |
|
|
|
|
|
|
| |
optimized combining substitutions
why we substitute in EqualityTestTreeMaker
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
If use cases are present, the original member disappears from the list.
References SI-5054, but needs more work on the html part. If use cases
are present along with links, scaladoc doesn't crash anymore. Closes
SI-4898.
Review by kzys.
|
|
|
|
|
|
|
| |
"According to the spec this code should not be legal. Disabling for
now." Need to come back and either make it work or (more likely) make
nsc reject the test)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed a long time ago that calls to def annotations in Symbols
figured way, way too high in profiling output, but my earlier efforts to
modify it failed because I didn't understand the "accidental" service
it was supplying. Here is the key piece of the former implementation of
annotations:
- val annots1 = initialize.rawannots map {
- case x: LazyAnnotationInfo => x.annot()
- case x: AnnotationInfo => x
- } filterNot (_.atp.isError)
The first thing you might notice is that because it calls initialize,
any call to either annotations or (more frequently) a method like
"hasAnnotation" causes a symbol to be initialized. The upshot is that
taking away tens of thousands of calls to initialize means a certain
amount of "free lunch" is over.
The second thing is that this implementation lead to the allocation of
a new list on every call to annotations. 99.999% of the time it's the
same elements in the list. The fact that rawannots is typed as a list of
"AnnotationInfoBase" which may as well be AnyRef means you can't even
use mapConserve, but even mapConserve would be an abuse of the garbage
collector given how infrequently there is any change.
So here's what we have now:
1) Annotations are delivered from trees to symbols by way of an
externally positioned map, not a field on the symbol. It's done once.
The only overhead on a call to annotations now is a null check.
2) I added a small sprinkling of calls to initialize in sensible
locations.
3) The profiler impact is hard to believe, but this is reproducible.
For whatever reason the non-profiler wall clock time impact is not as
impressive.
My profiling target was the compilation of these 15 files:
src/library/scala/collection/generic/G*.scala
Before this patch, heap usage peaked at 60MB. After, 35MB. 40% drop in
profiler measured time elapsed. (Again, it's not like that outside the
profiler.) About a 55% drop in number of allocations. About a 40% drop
in total size of allocations.
+----------------------+------------------+-----------------+-----------------+
| Name | Time Diff (ms) | Old Time (ms) | New Time (ms) |
+----------------------+------------------+-----------------+-----------------+
| +---<All threads> | -19,569 | 52,496 | 32,926 |
+----------------------+------------------+-----------------+-----------------+
+----------------------------+--------------------+-----------------------+
| Packages and Classes | Objects (+/-) | Size (+/-) |
+----------------------------+--------------------+-----------------------+
| +---<Objects by classes> | -877,387 -56 % | -26,425,512 -37 % |
| | | | |
| +---char[] | -43,308 -2 % | -2,756,744 -3 % |
| | | | |
| +---java | -67,064 -3 % | -2,027,264 -2 % |
| | | | |
| +---scala | -745,099 -48 % | -19,021,760 -26 % |
+----------------------------+--------------------+-----------------------+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you run a jar directly, like
scala foo.jar
Then if a Class-Path attribute is present in the jar manifest, the
classpath will be constructed from that instead of the arguments. Some
things remain to be determined, like whether it's supposed to replace
a classpath given on the command line or supplement it, and whether
the master jar should be on the classpath or only and exactly the jars
listed in the manifest.
There's a really nice test case, which won't be run of course, but I
can't stand going any further without tests for these hard to test on
all platforms things. The faux .check file shows what I see.
Closes SI-4355, review by harrah.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix for what have been rather uncommon common owners.
The complete histogram of results for "commonOwner" until this patch,
when building quick.lib and quick.comp:
Calculated common owner Occurrences
----------------------- -----------
NoSymbol 299,242
Everything Else 0
Since I'm always paranoid somebody will think I'm the one who broke
such things in the first place, I got in the gitmobile and fingered the
responsible party.
Looks OK when it was checked in: r3930, Feb 4 2005. And it was smooth
sailing until... r4026, Mar 22 2005. So 6 1/2 weeks of goodness for poor
commonOwnerMap, to be followed by 6 1/2 years of endless NoSymboldom. In
2005 I was still making a living grifting strangers in seedy gambling
halls, so I think I'm in the clear. Here's the exact spot.
https://github.com/scala/scala/commit/ae0da87d1aaeded9eb7f9c9ecbed8a31
3667757d#L12L991
I found this while trying to figure out why we are generating so many
refinements. This doesn't fix any of that, but maybe takes us a notch
closer. Review by odersky.
|
|
|
|
|
|
|
|
|
|
|
|
| |
providing a richer TreeMakers interface in hopes of performing analyses
and optimizations on TreeMakers rather than the trees they generate
not sure yet, though: on the one hand, working on raw trees removes
the unsoundness potential due to the extra indirection layer on the
other hand, indirection is nice, and recovering the meaning lost in
translation from richer treemakers to raw trees is such a drag
no review
|
|
|
|
|
|
|
| |
Partial cleanup and generalization of tree printing. You can now print
a tree in direct case class form with `showRaw(tree)`. Should make
NodePrinters redundant.
|
|
|
|
|
|
|
|
|
|
|
|
| |
farewell ProtoTreeMaker, we hardly knew ye
needed one more repeatedToSeq for pos/annotDepMethType when compiling
under -Xexperimental and -Yvirtpatmat... I wonder why this hadn't failed
before outer check for extractor type test: definitely need it for case
classes, and probably makes sense for user-defined extractors as well
no review
|
|
|
|
|
|
|
|
|
| |
There's every hint that it's a requirement that a TypeApply have
non-empty typeArgs, but testing for and handling the empty condition
is done irregularly. Made a mkTypeApply which handles the isEmpty case
(returning "fun" unchanged.) Also unified most of the variations of
casts under one umbrella. Review by moors.
|