From 9132efa4a8511e267c808c95df4d2e3de68277e6 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 11 Sep 2014 10:22:37 +0200 Subject: Address review feedback. --- src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala | 4 ++-- src/compiler/scala/tools/nsc/backend/jvm/BackendStats.scala | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala index ba97cf3748..daf36ce374 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala @@ -824,7 +824,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { * the stack. "Phantom" because it never exists: such methods always throw, but the JVM does * not know that. * - * Note: The two verifiers (old: type inference, new: type checking) have differnet + * Note: The two verifiers (old: type inference, new: type checking) have different * requirements. Very briefly: * * Old (http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.10.2.1): at @@ -832,7 +832,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { * - Stack is same size and has same typed values * - Local and stack values need to have consistent types * - In practice, the old verifier seems to ignore unreachable code and accept any - * instrucitons after an ATHROW. For example, there can be another ATHROW (without + * instructions after an ATHROW. For example, there can be another ATHROW (without * loading another throwable first). * * New (http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.10.1) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BackendStats.scala b/src/compiler/scala/tools/nsc/backend/jvm/BackendStats.scala index d96ee933b7..4b9383c67c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BackendStats.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BackendStats.scala @@ -17,10 +17,8 @@ object BackendStats { val bcodeDceTimer = newSubTimer("dead code elimination", bcodeTimer) val bcodeWriteTimer = newSubTimer("classfile writing", bcodeTimer) - def timed[T](timer: Statistics.Timer)(body: => T) = { + def timed[T](timer: Statistics.Timer)(body: => T): T = { val start = Statistics.startTimer(timer) - val res = body - Statistics.stopTimer(timer, start) - res + try body finally Statistics.stopTimer(timer, start) } } -- cgit v1.2.3