summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove sbaz and references from master repository.Josh Suereth2012-03-2711-661/+11
|
* Removed git from source repo generation.Josh Suereth2012-03-271-0/+1
|
* Added latest link for sources so we can include them in distributions.Josh Suereth2012-03-271-1/+15
|
* Syntactic/organizational optimizations in Settings.Paul Phillips2012-03-265-73/+49
|
* Removing some foolishness.Paul Phillips2012-03-241-8/+4
| | | | I swear this change didn't work last time I was in this neighborhood.
* Scaladoc is now pointing to sources in githubVlad Ureche2012-03-252-2/+2
| | | | | | | | | | For snapshots, it points to the exact commit, for releases it points to the tag ("v" + maven version). The link now opens in a different tab, as opening in the same frame is not compatible with github (the page doesn't load for some reason). Left the repo url in test/review untouched because it points to the root of all LAMP repos. But... is anyone still using that script?!?
* Broke up def bridgeDefs.Paul Phillips2012-03-241-85/+99
| | | | | | Possibly the ugliest function in the compiler. Unfortunately also effectively obscuring serious bugs like SI-3452. Still won't be winning homecoming queen, but might be able to leave the house.
* Merge remote-tracking branch 'adriaanm/topic/virtpatmat' into developPaul Phillips2012-03-233-20/+29
|\
| * [vpm] defend against null in erroneous type patsAdriaan Moors2012-03-231-4/+4
| |
| * further tweaking packing magicAdriaan Moors2012-03-231-4/+4
| |
| * splice in typed, dup'ed, trees for TRUE and FALSEAdriaan Moors2012-03-233-5/+10
| | | | | | | | | | sharing trees is bad also, substing in untyped trees into typed outer trees is not good for your health
| * less invasive packing of types in branches/casesAdriaan Moors2012-03-231-12/+13
| | | | | | | | | | | | we still do it in ifs when the packed types are equal, but packing types in cases breaks a lot of stuff (and I can't remember what it fixed -- we'll find out in the next test run)
| * [vpm] need cast in one for GADT magicAdriaan Moors2012-03-231-3/+3
| |
| * typedMatchAnonFun's missingCase call use apply's argAdriaan Moors2012-03-231-1/+4
| | | | | | | | can't pass the scrutinee since its type has been widened
| * [vpm] be more careful about swatchesAdriaan Moors2012-03-231-3/+5
| | | | | | | | | | type-switch-based catches must not contain type tests on traits for some reason, so fall back to full-blown pattern match TODO: can we improve this? this simply mimics the old pattern matcher's behavior
| * do nothing when closing closed block in ignoremodeAdriaan Moors2012-03-232-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this came to light with the virtual pattern matcher, which emits jumps like `matchEnd3(_test(Test.this, false))`, where _test is a tailcall the nested jumping caused double-closing (the second time in ignore mode) thus. when closing a closed block in ignore mode, simply do nothing from genLoad for label-jumps: note: when one of the args to genLoadLabelArguments is a jump to a label, it will call back into genLoad and arrive at this case, which will then set ctx1.bb.ignore to true, this is okay, since we're jumping unconditionally, so the loads and jumps emitted by the outer call to genLoad (by calling genLoadLabelArguments and emitOnly) can safely be ignored, however, as emitOnly will close the block, which reverses its instructions (when it's still open), we better not reverse when the block has already been closed but is in ignore mode (if it's not in ignore mode, double-closing is an error) @dragos figured it out, all I did was write the comment and the `if` test case to repro basic blocks crasher the tailcall in the forward jump `matchEnd3(_test(Test.this, false))` in the following program crashes the back-end (error below) @scala.annotation.tailrec final def test(meh: Boolean): Boolean = { <synthetic> val _$this: Test.type = Test.this; _test(_$this,meh){ case <synthetic> val x1: Some[String] = new Some[String]("a"); case3(){ matchEnd2({ case <synthetic> val x1: Some[String] = x1; case4(){ if (x1.ne(null)) matchEnd3(if (meh) _test(Test.this, false) else false) else case5() }; case5(){ matchEnd3(_test(Test.this, false)) }; matchEnd3(x){ x } }) }; matchEnd2(x){ x } } }; The last instruction (of basic block 11) is not a control flow instruction: CONSTANT(false) // methods def test(meh: Boolean (BOOL)): Boolean { locals: value meh, value _$this, value x1, value x, value x, value x1 startBlock: 1 blocks: [1,2,3,4,5,6,7,8,9,10,11,12,13] 1: 4 JUMP 2 2: 5 NEW REF(class Some) 5 DUP(REF(class Some)) 5 CONSTANT("a") 5 CALL_METHOD scala.Some.<init> (static-instance) 5 STORE_LOCAL(value x1) 5 SCOPE_ENTER value x1 5 JUMP 3 3: 5 LOAD_LOCAL(value x1) 7 STORE_LOCAL(value x1) 7 SCOPE_ENTER value x1 7 JUMP 4 4: 7 LOAD_LOCAL(value x1) 7 CZJUMP (REF(class Object))NE ? 5 : 6 5: 8 LOAD_LOCAL(value meh) 8 CZJUMP (BOOL)NE ? 8 : 9 6: ? JUMP 11 7: 7 DROP BOOL 7 JUMP 11 8: 8 CONSTANT(false) 8 STORE_LOCAL(value meh) 8 JUMP 2 9: 8 CONSTANT(false) 8 JUMP 10 10: 8 STORE_LOCAL(value x) 8 JUMP 12 11: 9 JUMP 2 9 STORE_LOCAL(value meh) 9 CONSTANT(false) 12: 7 LOAD_LOCAL(value x) 7 SCOPE_EXIT value x1 7 STORE_LOCAL(value x) 7 JUMP 13 13: 5 LOAD_LOCAL(value x) 5 SCOPE_EXIT value x1 5 RETURN(BOOL)
| * [vpm] avoid verifyerror: leave jump to tail-pos labelAdriaan Moors2012-03-231-2/+7
| | | | | | | | | | the following commit deals with the fall-out in basicblocks (double closing of blocks in ignore mode)
| * don't throw error in setError when -YdebugAdriaan Moors2012-03-231-4/+6
| |
| * [vpm] typeMatchAnonFun improvementsAdriaan Moors2012-03-235-114/+101
| | | | | | | | | | | | | | | | | | | | need to set up symbols with approximated info for the method and its owner before typing the method's body; when the body has been typed, we know what its result type will be, so update info of class and method to reflect that better detection of synthesized matches: annotate selector rather than relying on symbol info encapsulate CASE | SYNTHETIC flags (setting and querying)
* | Merge remote-tracking branch 'adriaanm/topic/virtpatmat' into developPaul Phillips2012-03-238-127/+136
|\ \
| * | [vpm] be more careful about swatchesAdriaan Moors2012-03-231-3/+5
| | | | | | | | | | | | | | | type-switch-based catches must not contain type tests on traits for some reason, so fall back to full-blown pattern match TODO: can we improve this? this simply mimics the old pattern matcher's behavior
| * | do nothing when closing closed block in ignoremodeAdriaan Moors2012-03-232-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this came to light with the virtual pattern matcher, which emits jumps like `matchEnd3(_test(Test.this, false))`, where _test is a tailcall the nested jumping caused double-closing (the second time in ignore mode) thus. when closing a closed block in ignore mode, simply do nothing from genLoad for label-jumps: note: when one of the args to genLoadLabelArguments is a jump to a label, it will call back into genLoad and arrive at this case, which will then set ctx1.bb.ignore to true, this is okay, since we're jumping unconditionally, so the loads and jumps emitted by the outer call to genLoad (by calling genLoadLabelArguments and emitOnly) can safely be ignored, however, as emitOnly will close the block, which reverses its instructions (when it's still open), we better not reverse when the block has already been closed but is in ignore mode (if it's not in ignore mode, double-closing is an error) @dragos figured it out, all I did was write the comment and the `if` test case to repro basic blocks crasher the tailcall in the forward jump `matchEnd3(_test(Test.this, false))` in the following program crashes the back-end (error below) @scala.annotation.tailrec final def test(meh: Boolean): Boolean = { <synthetic> val _$this: Test.type = Test.this; _test(_$this,meh){ case <synthetic> val x1: Some[String] = new Some[String]("a"); case3(){ matchEnd2({ case <synthetic> val x1: Some[String] = x1; case4(){ if (x1.ne(null)) matchEnd3(if (meh) _test(Test.this, false) else false) else case5() }; case5(){ matchEnd3(_test(Test.this, false)) }; matchEnd3(x){ x } }) }; matchEnd2(x){ x } } }; The last instruction (of basic block 11) is not a control flow instruction: CONSTANT(false) // methods def test(meh: Boolean (BOOL)): Boolean { locals: value meh, value _$this, value x1, value x, value x, value x1 startBlock: 1 blocks: [1,2,3,4,5,6,7,8,9,10,11,12,13] 1: 4 JUMP 2 2: 5 NEW REF(class Some) 5 DUP(REF(class Some)) 5 CONSTANT("a") 5 CALL_METHOD scala.Some.<init> (static-instance) 5 STORE_LOCAL(value x1) 5 SCOPE_ENTER value x1 5 JUMP 3 3: 5 LOAD_LOCAL(value x1) 7 STORE_LOCAL(value x1) 7 SCOPE_ENTER value x1 7 JUMP 4 4: 7 LOAD_LOCAL(value x1) 7 CZJUMP (REF(class Object))NE ? 5 : 6 5: 8 LOAD_LOCAL(value meh) 8 CZJUMP (BOOL)NE ? 8 : 9 6: ? JUMP 11 7: 7 DROP BOOL 7 JUMP 11 8: 8 CONSTANT(false) 8 STORE_LOCAL(value meh) 8 JUMP 2 9: 8 CONSTANT(false) 8 JUMP 10 10: 8 STORE_LOCAL(value x) 8 JUMP 12 11: 9 JUMP 2 9 STORE_LOCAL(value meh) 9 CONSTANT(false) 12: 7 LOAD_LOCAL(value x) 7 SCOPE_EXIT value x1 7 STORE_LOCAL(value x) 7 JUMP 13 13: 5 LOAD_LOCAL(value x) 5 SCOPE_EXIT value x1 5 RETURN(BOOL)
| * | [vpm] avoid verifyerror: leave jump to tail-pos labelAdriaan Moors2012-03-231-2/+7
| | | | | | | | | | | | | | | the following commit deals with the fall-out in basicblocks (double closing of blocks in ignore mode)
| * | don't throw error in setError when -YdebugAdriaan Moors2012-03-231-4/+6
| | |
| * | [vpm] typeMatchAnonFun improvementsAdriaan Moors2012-03-235-114/+101
| |/ | | | | | | | | | | | | | | | | | | need to set up symbols with approximated info for the method and its owner before typing the method's body; when the body has been typed, we know what its result type will be, so update info of class and method to reflect that better detection of synthesized matches: annotate selector rather than relying on symbol info encapsulate CASE | SYNTHETIC flags (setting and querying)
* | Changing URLs for svn and issue tracking.Vojin Jovanovic2012-03-2311-52/+42
| | | | | | | | Review by: @jsuereth
* | Document regex replacement strings behavior.Daniel C. Sobral2012-03-231-2/+33
| | | | | | | | | | | | | | | | | | All replacement methods use dolar signs to identify groups in the matched string, and backslashes to escape characters. Document this behavior, and provide a method that can be used to properly quote replacement strings when this behavior is not desired. Closes SI-4750.
* | Regex improvementsDaniel C. Sobral2012-03-232-4/+34
|/ | | | | | | | | | | This adds findAllMatchIn to Regex to mirror other similar methods. It also overloads StringLike's "r", adding a version that accepts group names. It includes test cases for both methods. Closes SI-2460.
* Undo the revert.Lukas Rytz2012-03-231-4/+8
| | | | | reverts 3db29dde051614d976bca92a1cdeb109c9c0ab01 and 5af2bf54d21ac63236cd6e68586b2c38fa0f28c3 restores 19a48510c2e18430a35319c04dfe3bad7119f23f
* Revert "Made changeOwner more robust; now also deals with return expressions."Paul Phillips2012-03-221-8/+4
| | | | This reverts commit 19a48510c2e18430a35319c04dfe3bad7119f23f.
*-------. Merge remote-tracking branches 'axel22/feature/pc-execution-contexts', ↵Paul Phillips2012-03-22123-3861/+4872
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'VladUreche/issue/5593', 'dragos/master', 'VladUreche/issue/5599', 'adriaanm/ticket/treeannot' and 'heathermiller/issue/5291' into develop
| | | | | * Scaladoc: improved usecases, display full signature. Closes #5291Heather Miller2012-03-222-1/+36
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | Makes the full signature of a use case member available, but still hidden under a drop-down menu.
| | | | * minimalist refactoring to allow annotating treesAdriaan Moors2012-03-225-10/+54
| | | |/ | | |/| | | | | | | | | | | | | | | | | not tested for performance, but shouldn't add any memory overhead see https://github.com/adriaanm/scala/commit/44362c557f for an example usage
| | | * Fixed SI-5599Vlad Ureche2012-03-221-26/+33
| | |/ | | | | | | | | | Eliminated the spurious warnings and made the code easier to follow.
| | * Merge branch 'issue/SI-5580' of /scala/trunk into developPaul Phillips2012-03-2113-1323/+1575
| | |\
| | | * Overhaul of JavaConver{sions,ters}.Paul Phillips2012-03-2110-1303/+1489
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initially motivated by SI-5580, then just motivated. I broke up the opaquely named JavaConversions and JavaConverters into the following traits encapsulating some permutation of { to java, to scala, bidirectional } { wrappers, decorators } I named everything consistently in terms of either Wrappers or Decorators. Decorators install those asJava/asScala methods onto collections of the right kind; Wrappers hide the process. JavaConversions then reduces to an object which (ill-advisedly) extends both WrapAsJava and WrapAsScala. And JavaConverters is an object extending DecorateAsScala and DecorateAsJava. However other more clearly named vals exist in the newly created scala.collection.convert package object. val decorateAsJava = new DecorateAsJava { } val decorateAsScala = new DecorateAsScala { } val decorateAll = new DecorateAsJava with DecorateAsScala { } val wrapAsJava = new WrapAsJava { } val wrapAsScala = new WrapAsScala { } val wrapAll = new WrapAsJava with WrapAsScala { } So for instance to import asScala decorators, and only those: scala> import scala.collection.convert.decorateAsScala._ import scala.collection.convert.decorateAsScala._ scala> new java.util.ArrayList[String].asScala groupBy (x => x) res0: scala.collection.immutable.Map[String,scala.collection.mutable.Buffer[String]] = Map() I propose we put those vals or a subset of them in the scala package object rather than way down in scala.collection.convert.
| | | * Fix for SI-5580.Paul Phillips2012-03-211-11/+37
| | | | | | | | | | | | | | | | | | | | Lub explosions mean we can't expect sane types in error messages. Defend against the insane.
| | | * Clarifying MethodSynthesis.Paul Phillips2012-03-212-9/+49
| | | | | | | | | | | | | | | | | | | | Tried to paint a picture of how one might synthesize an implicit method to accompany an implicit class.
| | * | Fixed SI-5063.Martin Odersky2012-03-211-6/+2
| | | |
| | * | Allows now private primary constructors in value classes.Martin Odersky2012-03-214-5/+8
| | |/
| * / Fixes SI-5593Vlad Ureche2012-03-224-4/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After hours of debugging and understanding all the root causes why scaladoc is rummaging through the current directory for classes, I decided to treat the symptoms rather than the cause. I'll document the decision here in case anyone is interested: - in order to find documentable entities, scaladoc exhaustively looks at all the symbols starting from the root package and going all the way to the leaves, visiting all classes in the classpath - if the classpath is empty, scaladoc and scalac add "." as the default classpath. This leads to scaladoc going on a class hunting spree in the current directory. If it happens that the current directory contains package objects and they're not in the expected path (like scala.tools.nsc in build/quick/classes/.../nsc) errors start to pop up - scalac is also affected by this, but to a more limited scope, since it will lazily expand packages whenever necessary. To show this, run the repl in the root directory of the scala source code, after compiling scala: scala> import build.quick.classes.compiler.scala.tools.nsc._ error: error while loading package, class file './build/quick/classes/ compiler/scala/tools/nsc/package.class' contains wrong package package The cleanest solution I can see now is to look at the tree resulting from compilation and use it for guidance -- I will look into this.
| * Overhauling mixin.Paul Phillips2012-03-211-146/+140
| | | | | | | | Feel the bugs falling away.
| * Restore irrefutability commits.Paul Phillips2012-03-203-21/+35
| | | | | | | | This reverts commit d8ba5d091e5641553b438ef9930a6023a2709dcd.
| * Fix for stability failure.Paul Phillips2012-03-201-1/+1
| | | | | | | | | | | | | | Pattern matcher! Totally unrelated to irrefutability, the pattern matcher at some point stopped sorting its lookup switch cases, and the butterfly's wings flapped enough to swap two cases. Now they're sorted in ascending order like they're supposed to be.
| * Lots of tedious warning and tree printing work.Paul Phillips2012-03-2021-120/+182
| | | | | | | | | | | | | | | | | | | | | | Fewer deprecation warnings, prettier trees, prettier symbols, more polished error messages. Oh the interesting people you meet handling warnings, I feel sorry for you all that I get to do it all the time. One of the characters I met invited me into the "Dead Code Society" and that's what I'm doing on Tuesdays now. No of course you haven't, it's a SECRET society.
| * Tweak to string coloring.Paul Phillips2012-03-203-13/+22
| | | | | | | | Concluded String->String would be more useful more often.
| * Revert irrefutability commits.Paul Phillips2012-03-203-35/+21
| | | | | | | | | | Temporary reversion of irrefutability commits in interests of stable milestone. Expect to restore shortly.
| *-. Merge remote-tracking branches 'vjovanov/duration-cleanup', ↵Paul Phillips2012-03-2068-1709/+2241
| |\ \ | | | | | | | | | | | | 'adriaanm/topic/virtpatmat' and 'vjovanov/actor-hierarchy' into develop
| | | * Prepared actors hierarchy for migration.Vojin Jovanovic2012-03-2014-646/+702
| | | | | | | | | | | | | | | | | | | | | | | | Internal nodes added so methods relevant to akka can be overridden. Review by: @phaller
| | * | [vpm] pack types of if branches before lubbingAdriaan Moors2012-03-201-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this way we don't end up with fresh, incompatible, skolems for every branch, but a neatly packed existential you get much nicer lubs this way -- threw in a fast path (I hope) that avoids lubbing when unnecessary (same types) since lub isn't robust enough to deal with the result of packedType, and we only really need the trivial case (S =:= T), special case it for now ... don't pack in ifs after typer, also only when virtPatmat