| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are too many potential optimizations unavailable to us due to the
lack of bright lines among different kinds of symbols. For instance the
difference between a TypeSymbol which represents a type alias and one
which represents an abstract type is only whether the DEFERRED flag
is set. This creates issues.
1) There are many (many) places where tests are performed on every symbol
which could be done more efficiently and (especially) more verifiably
correctly with polymorphism.
2) TypeRefs based on those symbols are also checking that flag
constantly, in perpetuity. A symbol created as an alias is never (to the
best of my knowledge) going to intentionally morph into one representing
an abstract type, nor vice versa.
3) One has no guarantees, because anyone can set or reset the DEFERRED
flag at any time.
So tackling more than one problem at once herein:
1) I created canonical symbol creation points which take the flags as
an argument, so that there can be a difference between initializing a
symbol's flags and setting/resetting them at arbitrary times.
2) I structured all the symbol creators to take arguments in the
same order, which is:
def newXXX(name: Name, ..., pos: Position = NoPosition, flags: Long = 0L)
(Where "..." is for those symbols which require something
beyond the name to create, such as a TypeSkolem's origin.)
The name is first because it's the only always required argument.
I left but deprecated the variations which take (pos, name).
3) I created subclasses of TypeRef based on the information which
should be stable from creation time onward:
- args or no args?
- abstract type, type alias, or class?
2x3 == 6 and that's how many subclasses of TypeRef there are now. So
now, for example, every TypeRef doesn't have to carry null symInfoCache
and thisInfoCache fields for the benefit of the minority which use them.
I still intend to realize the gain possible once we can evade the fields
for pre and args without losing pattern matcher efficiency.
|
|
|
|
|
|
|
|
|
|
|
| |
These tests are WAY too difficult to work with. I don't have
a clue what these failures are telling me, except they are telling
me to disable them.
Actual output:
[partest] Check failed:
[partest] HTML: SI_5054_q1classSI_5054_q1extendsAnyRefLinearSupertypesAnyRef,AnyOrderingAlphabeticByinheritanceInheritedHideAllShowallSI_5054_q1AnyRefAnyVisibilityPublicAllInstanceConstructorsnewSI_5054_q1()ValueMembersfinaldef!=(arg0:AnyRef):BooleanDefinitionClassesAnyReffinaldef!=(arg0:Any):BooleanDefinitionClassesAnyfinaldef##():IntDefinitionClassesAnyRefAnyfinaldef==(arg0:AnyRef):BooleanDefinitionClassesAnyReffinaldef==(arg0:Any):BooleanDefinitionClassesAnyfinaldefasInstanceOf[T0]:T0DefinitionClassesAnydefclone():AnyRefAttributesprotected[lang]DefinitionClassesAnyRefAnnotations@throws()finaldefeq(arg0:AnyRef):BooleanDefinitionClassesAnyRefdefequals(arg0:Any):BooleanDefinitionClassesAnyRefAnydeffinalize():UnitAttributesprotected[lang]DefinitionClassesAnyRefAnnotations@throws()finaldefgetClass():Class[_]DefinitionClassesAnyRefAnydefhashCode():IntDefinitionClassesAnyRefAnyfinaldefisInstanceOf[T0]:BooleanDefinitionClassesAnyfinaldefne(arg0:AnyRef):BooleanDefinitionClassesAnyReffinaldefnotify():UnitDefinitionClassesAnyReffinaldefnotifyAll():UnitDefinitionClassesAnyReffinaldefsynchronized[T0](arg0:⇒T0):T0DefinitionClassesAnyRefdeftest():Int[usecase]deftoString():StringDefinitionClassesAnyRefAnyfinaldefwait():UnitDefinitionClassesAnyRefAnnotations@throws()finaldefwait(arg0:Long,arg1:Int):UnitDefinitionClassesAnyRefAnnotations@throws()finaldefwait(arg0:Long):UnitDefinitionClassesAnyRefAnnotations@throws()InheritedfromAnyRefInheritedfromAny
|
|
|
|
|
|
| |
Work around optimizer's unwillingness to inline trait methods
by flipping to an abstract class. Also eliminated a couple other
warnings noising up the optimized build.
|
| |
|
|
|
|
| |
So I can get at it from the repl.
|
|
|
|
| |
So it can be used as a mixin.
|
|\ |
|
| |
| |
| |
| | |
inference
|
|/
|
|
|
| |
This reverts commit 51089b34a7a535498dee42e6465d4d577d65b7d5.
A scaladoc test is failing and I have no time to look at it.
|
|
|
|
| |
This is done by the separate scala-nightly-maven-deploy jenkins job, doing it here fails depending on the build machine (/home/linuxsoft/... is not available everywhere).
|
|
|
|
|
|
| |
This reverts commit daeb8f75ec3db065703d225fdb7f0aca34514333.
That didn't go well.
|
|
|
|
| |
Because sbt's generated API code depends on it.
|
|
|
|
|
|
| |
Now notices most things which look like main methods and says
something useful if they aren't usable as entry points.
Closes SI-4749.
|
|\ \ \
| | | |
| | | |
| | | | |
and 'szabolcsberecz/xml-attribute-fix'
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This changes makes PrefixedAttribute work the same way as
UnprefixedAttribute with respect to null values:
<t p:a={ null: String }/> is accepted and results in <t/>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Prior to this patch <t a={ null: String }/> was not equal to <t/> and
it's string representation was "<t ></t>" instead of "<t></t>"
This includes changing MetaData.normalize() so that it doesn't reverse
the chain. On the downside, the iterate function in MetaData.normalize()
is not tail-recursive now.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
takes place.
A major redesign that unifies the various different approaches to boxing of free variables. Free variables are marked with CAPTURED and eliminated by LambdaLift. I also added some hooks in MacroContext that a reifier needs to use.
|
| | | |
| | | |
| | | |
| | | | |
Previously, adaptToNewRun crashed when an object declaration got replaced by a value with the same name, because the module class no longer existed. This caused crashes in the presentation compiler when class files disappeared because of a clean build. The new behavior avoids assertion errors.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The reason why the test case compiled without error is pretty devious: When checking the `Foo.x' implicit, a CyclicReference error occurs which causes the alternative to be discarded. Why a CylicReference? Because the inferencer tries to decide whether the owner of `z` is a subclass of the owner od `x`. To do this, it computed the info of the owner of `z1`, which is not complete because no result type for `f1` was given. Hence a CyclicReference error.
The fix is twofold: (1) We make isNonBottomSubClass smarter so that it always returns false if the symbol in question is not a type; hence the info need not be computed. (2) It's dubious to swallow CyclicReference errors anywhere, but I deemed it too risky to propagate them. But at least the CyclicReference is now logged if -Ylog-implicit is true. This hopefully spares future maintainers the same detective work I had to go through when digging this out.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Was going straight to the field and bypassing the null guard.
Closes SI-5300.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There's no need to blow up when a classfile references other
classes which aren't present. We can struggle onward and maybe
it'll turn out they had no intention of trying to get at the
class that isn't there. I have all kinds of confidence scala
will find a way to fail when the time comes. Closes SI-5343.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Seeing about getting delayedInit working (not to mention the
breakage it is inflicting elsewhere) which led me into Cleanup
and some of its buddies.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Wow, it fails only during strap.comp. That is certainly a first for me,
managing to build quick and pass all the tests only to be unable to
rebuild the compiler from quick. Must be something fascinating taking
place in there. So for now I flipped the switch back down.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I zeroed in on the actual conditions under which the parameter bounds
can be utilized without poisoning the well. Also fixed a bug in
ClassfileParser where it would get confused and set Any as a lower
bound, as well as a bug or at least misbehavior where a TypeBounds with
only Any/Nothing as an upper/lower bound would be treated differently
than one with no bound at all.
Review by @moors.
|
| |_|/
|/| |
| | |
| | | |
Closes SI-3758.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Misters hkarg and hkparam have to work harder to see
things from the same perspective, so they don't end up
in a huff over bounds which were the same all along.
Closes SI-5020, review by @moors.
|
| | |
| | |
| | |
| | |
| | | |
You should really try this out, anonymous commit log reader.
scala -Dscalac.debug.tvar
|
| | |
| | |
| | |
| | |
| | |
| | | |
This sort of thing was crashing. No longer.
trait Fooz[Q <: Array[_]] { def f0(x: Q) = x.length }
|
| | |
| | |
| | |
| | |
| | | |
Well, "fix" is pretty generous, how about "workaround".
It does seem to do the job. Closes SI-4070, review by @moors.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
% scala -Dscalac.debug.tvar
scala> class Foo[CC[X] <: Traversable[X]] { def bar[T](xs: CC[T]) = xs.head }
defined class Foo
scala> new Foo bar List(1,2,3)
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ setInst] Nothing ( In Foo[CC[X] <: Traversable[X]], CC=Nothing )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ create] ?T ( In Foo[CC[X] <: Traversable[X]]#bar[T] )
[ create] ?A ( In List#apply[A] )
[ create] ?A ( In List#apply[A] )
[ setInst] Int ( In List#apply[A], A=Int )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ create] ?T ( In Foo[CC[X] <: Traversable[X]]#bar[T] )
[ create] ?CC ( In Foo[CC[X] <: Traversable[X]] )
[ applyArgs] ?CC ( In Foo[CC[X] <: Traversable[X]], apply args ?T to CC )
[ setInst] List ( In Foo[CC[X] <: Traversable[X]], CC=List )
[ setInst] Int ( In Foo[CC[X] <: Traversable[X]]#bar[T], T=Int )
res0: Int = 1
Also, I gave TypeVar some polymorphism. Review by @moors.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
% scalac files/neg/t5357.scala
files/neg/t5357.scala:5: error: '=>' expected but ':' found.
case A: N => 1
^
one error found
That's uggo! Now it says:
% scalac files/neg/t5357.scala
files/neg/t5357.scala:5: error: Pattern variables must start with a lower-case letter. (SLS 8.1.1.)
case A: N => 1
^
one error found
|
| | |
| | |
| | |
| | |
| | | |
Making -Xcheckinit happy. Then cleaned up the anyval and
phantom type manifests once in the neighborhood.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I think I found an issue underlying more than one bit of sketchy
behavior amongst CC[_] and friends.
Plus, I managed to initialize TypeConstraints with the bounds of the
originating type parameter. I feel like that should cause something
nifty to happen somewhere, but I have seen neither confetti nor lasers
in greater quantities than I usually do. Will keep my remaining eye out.
Closes SI-5359, review by @moors.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Several large helpings of tedium later, fewer strings are being
discarded like so much refuse. Some names now cache a String, but only
"named Names", so it's not very many and they pay for themselves pretty
quickly. Many fewer name-related implicit conversions now taking place.
A number of efficiency related measures.
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Streamlining some of our more common operations.
|
| | | |
| | | |
| | | |
| | | | |
Making the inherited java vararg check cheaper.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Again trying to reduce the load on findMember by supplying
flags to exclude.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Reworked some old code which was far too expensive for the
job it was performing.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Profiled for the most frequent drinkers at the findMember
tavern and gave them bracelets so they don't have to always
be hassling the bartender.
|
|/ / /
| | |
| | |
| | |
| | | |
It's too handy and I can't reach it from key classes whose
calls I want to profile.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't generate invokeinterface instructions when the target is an
interface but the method being called is defined in java.lang.Object.
Android chokes on them, but regardless, invokevirtual will be faster and
more pleasing to all the more discriminating vms.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Sometime during the signature-related chaos before 2.9.1,
genjvm was modified to pin ACC_BRIDGE onto mixed-in methods.
This isn't necessary to suppress the signature (which has
already happened at that point) and has deleterious effects
since many tools ignore bridge methods. Review by @odersky.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Don't assume that just because someone is calling x.toInt
and x <: java.lang.Number, that it's a boxed primitive.
Closes SI-5356.
|
| | |
| | |
| | |
| | | |
Following up to the previous, taking my own advice in SI-5352.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Was not substituting before using fallback lub. I don't think
it was hurting anything because the substitution is wrong anyway,
since it gives up on f-bounds. (This is directly responsible
for the malformed lubs.) But if it must fail, it shouldn't be
letting A and Repr escape into the error message:
scala> List(List(), Stream())
<console>:8: error: type mismatch;
found : List[Nothing]
required: scala.collection.immutable.LinearSeq[Nothing] with .....
scala.collection.LinearSeqOptimized[A,Repr]]]]]
List(List(), Stream())
^
Rather, like this:
found : List[Nothing]
required: scala.collection.immutable.LinearSeq[Nothing] with .....
scala.collection.LinearSeqOptimized[Nothing,scala.collection.immutable.Stream[Nothing]]]]]]
Also, AbstractSeq and other not-public classes were appeaing in the
errors, alerting me to the fact that it would happily infer a lub
containing a type which cannot be referenced.
scala> List(List(), Vector())
res1: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] ...
So I excluded non-public types in lubList:
scala> List(List(), Vector())
res0: List[scala.collection.immutable.Seq[Nothing]] = List(List(), Vector())
Finally, I added logging for recursive bounds.
% scala -Ydebug
scala> List(List(), Stream())
Encountered 2 recursive bounds while lubbing 2 types.
type A in trait LinearSeqOptimized appears in the bounds of type Repr
type Repr >: scala.this.Nothing <: collection.this.LinearSeqOptimized[A,Repr]
type Repr in trait LinearSeqOptimized appears in its own bounds
type Repr >: scala.this.Nothing <: collection.this.LinearSeqOptimized[A,Repr]
Review by @moors.
|
| | |
| | |
| | |
| | |
| | |
| | | |
The reason why the test case compiled without error is pretty devious: When checking the `Foo.x' implicit, a CyclicReference error occurs which causes the alternative to be discarded. Why a CylicReference? Because the inferencer tries to decide whether the owner of `z` is a subclass of the owner od `x`. To do this, it computed the info of the owner of `z1`, which is not complete because no result type for `f1` was given. Hence a CyclicReference error.
The fix is twofold: (1) We make isNonBottomSubClass smarter so that it always returns false if the symbol in question is not a type; hence the info need not be computed. (2) It's dubious to swallow CyclicReference errors anywhere, but I deemed it too risky to propagate them. But at least the CyclicReference is now logged if -Ylog-implicit is true. This hopefully spares future maintainers the same detective work I had to go through when digging this out.
|
| | |
| | |
| | |
| | | |
Another salvo in the war against option2Iterable.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Trying to help icode/jvm get through their business a bit faster, and
also make things more robust. Less null, more distinguished objects.
More encapsulation, fewer public vars. Helping updateSuccessorList()
to avoid assembling a list of successors on every call only to find
most of the time that it's the same list it already had (e.g. compiling
quick.lib it says "59076 calls, 690 requiring allocation" rather than
59076 calls, 59076 requiring allocation.)
|
| |
| |
| |
| | |
with the other files.
|