diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-01-12 16:55:26 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-01-12 16:55:26 +0000 |
commit | d75264a14a560e1655c59dcfa1152882f2bad807 (patch) | |
tree | 17789181cc31132e3cfae178577c498c3f41a118 /src/compiler/scala/tools/nsc/backend/icode | |
parent | 335f62ba638b462976cef74e43276c71b5f0fbc8 (diff) | |
download | scala-d75264a14a560e1655c59dcfa1152882f2bad807.tar.gz scala-d75264a14a560e1655c59dcfa1152882f2bad807.tar.bz2 scala-d75264a14a560e1655c59dcfa1152882f2bad807.zip |
Updated attempt at removing @inline warnings:
- fixed a bug in closure elimination causing VerifyErrors
- fixed a broken assert in GenICode that fired when -Ydebug was used
- added final modifiers
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/icode')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index cd690097e8..23b75e1142 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -362,7 +362,7 @@ abstract class GenICode extends SubComponent { thenCtx = genLoad(thenp, thenCtx, resKind) elseCtx = genLoad(elsep, elseCtx, resKind) - assert(!settings.debug.value || expectedType == UNIT, + assert(!settings.debug.value || !(hasUnitBranch && expectedType != UNIT), "I produce UNIT in a context where " + expectedType + " is expected!") thenCtx.bb.emitOnly(JUMP(contCtx.bb)) diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala index 4f0da17bb3..8a65875fbf 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/CopyPropagation.scala @@ -146,10 +146,12 @@ abstract class CopyPropagation { target match { case Deref(LocalVar(l)) => val alias = getAlias(l) + val derefAlias = Deref(LocalVar(alias)) getBinding(alias) match { - case Record(_, _) => Some(Deref(LocalVar(alias))) + case Record(_, _) => Some(derefAlias) case Deref(Field(r1, f1)) => - getFieldNonRecordValue(r1, f1) orElse Some(Deref(LocalVar(alias))) + getFieldNonRecordValue(r1, f1) orElse Some(derefAlias) + case Boxed(_) => Some(derefAlias) case v => Some(v) } case Deref(Field(r1, f1)) => |