summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-01-17 15:29:49 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2015-03-11 12:53:34 -0700
commitb34a452c0683d260ffb1644575a0e970559cae87 (patch)
tree62e359baa916e6df709a43adaed4deb3c599083e /src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala
parentff67161f946c515a3b0a719ce80531fa14a06a8f (diff)
downloadscala-b34a452c0683d260ffb1644575a0e970559cae87.tar.gz
scala-b34a452c0683d260ffb1644575a0e970559cae87.tar.bz2
scala-b34a452c0683d260ffb1644575a0e970559cae87.zip
Tools to perform inlining.
The method Inliner.inline clones the bytecode of a method and copies the new instructions to the callsite with the necessary modifications. See comments in the code. More tests are added in a later commit which integrates the inliner into the backend - tests are easier to write after that.
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala
index 9e56f25888..b3ac06877b 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala
@@ -13,6 +13,7 @@ import scala.collection.convert.decorateAsScala._
import scala.tools.nsc.io.AbstractFile
import scala.tools.nsc.util.ClassFileLookup
import OptimizerReporting._
+import BytecodeUtils._
import ByteCodeRepository._
import BTypes.InternalName
@@ -93,16 +94,6 @@ class ByteCodeRepository(val classPath: ClassFileLookup[AbstractFile], val class
inlineFailure(s"Class file for class $fullName not found.")
}
}
-
- private def removeLineNumberNodes(classNode: ClassNode): Unit = {
- for (method <- classNode.methods.asScala) {
- val iter = method.instructions.iterator()
- while (iter.hasNext) iter.next() match {
- case _: LineNumberNode => iter.remove()
- case _ =>
- }
- }
- }
}
object ByteCodeRepository {