Skip to content

SI-9615 - -Ystatistics does not enable all possible statistics#5204

Closed
romanowski wants to merge 1 commit intoscala:2.11.xfrom
romanowski:fix-stats
Closed

SI-9615 - -Ystatistics does not enable all possible statistics#5204
romanowski wants to merge 1 commit intoscala:2.11.xfrom
romanowski:fix-stats

Conversation

@romanowski
Copy link
Contributor

@romanowski romanowski commented Jun 1, 2016

Statistics.canEnable now is def so it does not always return false.

Currently it is initialized with default value of '_enabled' var.
Basically -Ystatistics setting is ignored (since it sets _enabled to true later).

Fixes SI-9615

For certain reasons this time I have to paste the below disclaimer:
THIS PROGRAM IS SUBJECT TO THE TERMS OF THE BSD 3-CLAUSE LICENSE.

THE FOLLOWING DISCLAIMER APPLIES TO ALL SOFTWARE CODE AND OTHER MATERIALS CONTRIBUTED IN CONNECTION WITH THIS SOFTWARE:
THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR
ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.
ONLY THE SOFTWARE CODE AND OTHER MATERIALS CONTRIBUTED IN CONNECTION WITH THIS SOFTWARE, IF ANY, THAT ARE ATTACHED TO (OR OTHERWISE ACCOMPANY) THIS SUBMISSION (AND ORDINARY
COURSE CONTRIBUTIONS OF FUTURES PATCHES THERETO) ARE TO BE CONSIDERED A CONTRIBUTION. NO OTHER SOFTWARE CODE OR MATERIALS ARE A CONTRIBUTION.

Currently it is initialized with default value of '_enabled' var.
Basically -Ystatistics setting is ignored (since it sets _enabled to true later).

Fixes SI-9615
@scala-jenkins scala-jenkins added this to the 2.11.9 milestone Jun 1, 2016
@romanowski
Copy link
Contributor Author

However now compilation fails for parallel compilation with -Ystatistics on (exception below).

Since this is not commonly used option maybe we can just add information in description?

scala.MatchError: null
   at scala.reflect.internal.util.Statistics$TimerStack.pop(Statistics.scala:235)
   at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5375)
   at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5448)
   at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
   at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:440)
   at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:431)
   at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:440)
   at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
   at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
   at scala.collection.Iterator$class.foreach(Iterator.scala:893)
   at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
   at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
   at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1501)
   at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1486)
   at scala.tools.nsc.Global$Run.compileSources(Global.scala:1481)
   at scala.tools.nsc.Global$Run.compile(Global.scala:1582)
   at scala.tools.ant.Scalac.executeInternal(Scalac.scala:686)
   ...

@adriaanm
Copy link
Contributor

adriaanm commented Jun 6, 2016

As I said on the JIRA ticket, I'm a bit concerned with the performance impact of this change. We'll have to evaluate that before we can change this. We're currently heads down on getting 2.12.0-M5 out, but will do our best to take a look after Scala Days Berlin.

@adriaanm
Copy link
Contributor

I'm going to close this until we can measure the performance impact. Since 2.11.9 will likely be the last 2.11 release, I'd rather not take any chances.

@adriaanm adriaanm closed this Oct 18, 2016
@SethTisue SethTisue removed this from the 2.11.9 milestone Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants