diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-10-02 12:27:43 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-10-20 11:17:04 +0200 |
commit | 0a33c421767f6e4587f8adac19169f184d845548 (patch) | |
tree | 9a6de2618f81a5324e642865d6655d77f9f83c59 /src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala | |
parent | 5bca4b2fca92dfe1f89785ba8d80cb9599d747f6 (diff) | |
download | scala-0a33c421767f6e4587f8adac19169f184d845548.tar.gz scala-0a33c421767f6e4587f8adac19169f184d845548.tar.bz2 scala-0a33c421767f6e4587f8adac19169f184d845548.zip |
Simplify post inlining requests
Clean up inliner test
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala index d8f12ffb11..52627e77e6 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala @@ -19,8 +19,10 @@ class InlinerHeuristics[BT <: BTypes](val bTypes: BT) { import inliner._ import callGraph._ - case class InlineRequest(callsite: Callsite, post: List[PostInlineRequest]) - case class PostInlineRequest(callsiteInstruction: MethodInsnNode, post: List[PostInlineRequest]) + case class InlineRequest(callsite: Callsite, post: List[InlineRequest]) { + // invariant: all post inline requests denote callsites in the callee of the main callsite + for (pr <- post) assert(pr.callsite.callsiteMethod == callsite.callee.get.callee, s"Callsite method mismatch: main $callsite - post ${pr.callsite}") + } /** * Select callsites from the call graph that should be inlined, grouped by the containing method. |