diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-19 13:32:14 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-19 13:32:14 -0800 |
commit | b0ae549fcc44b068eced8d4af18044f63c2b8093 (patch) | |
tree | 9b2d0fcff248356e961dfdce94531fdada4e7dd3 /src | |
parent | 526c92848af4b4b1647d7400aab2296fba6752d2 (diff) | |
parent | 5e52ce9a13f12ef159e25ac80c6be2803ec48950 (diff) | |
download | scala-b0ae549fcc44b068eced8d4af18044f63c2b8093.tar.gz scala-b0ae549fcc44b068eced8d4af18044f63c2b8093.tar.bz2 scala-b0ae549fcc44b068eced8d4af18044f63c2b8093.zip |
Merge remote-tracking branch 'szabolcsberecz/SI-5215' into develop
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 5 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 16 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 9e801e3ea8..ca00508dc7 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -876,6 +876,11 @@ abstract class GenICode extends SubComponent { val (newCtx, resKind) = genPrimitiveOp(app, ctx, expectedType) generatedType = resKind newCtx + } else if (sym.elisionLevel.exists (_ < settings.elidebelow.value || settings.noassertions.value)) { + // XXX settings.noassertions.value temporarily retained to avoid + // breakage until a reasonable interface is settled upon. + debuglog("Eliding call from " + tree.symbol.owner + " to " + sym + " based on its elision threshold of " + sym.elisionLevel.get) + ctx } else { // normal method call debuglog("Gen CALL_METHOD with sym: " + sym + " isStaticSymbol: " + sym.isStaticMember); val invokeStyle = diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index c4b70c672c..256c829db0 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -452,19 +452,6 @@ abstract class UnCurry extends InfoTransform } } - /** For removing calls to specially designated methods. - */ - def elideIntoUnit(tree: Tree): Tree = Literal(Constant()) setPos tree.pos setType UnitClass.tpe - def isElidable(tree: Tree) = { - val sym = treeInfo.methPart(tree).symbol - // XXX settings.noassertions.value temporarily retained to avoid - // breakage until a reasonable interface is settled upon. - sym != null && sym.elisionLevel.exists(x => x < settings.elidebelow.value || settings.noassertions.value) && { - log("Eliding call from " + tree.symbol.owner + " to " + sym + " based on its elision threshold of " + sym.elisionLevel.get) - true - } - } - // ------ The tree transformers -------------------------------------------------------- def mainTransform(tree: Tree): Tree = { @@ -502,8 +489,7 @@ abstract class UnCurry extends InfoTransform finally this.inConstructorFlag = saved } - if (isElidable(tree)) elideIntoUnit(tree) - else tree match { + tree match { case dd @ DefDef(mods, name, tparams, vparamss, tpt, rhs) => if (dd.symbol hasAnnotation VarargsClass) saveRepeatedParams(dd) withNeedLift(false) { |