diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-02-21 16:04:21 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-03-11 12:53:34 -0700 |
commit | 0d8b32469ec655f35a31843e1843b8a580e772d1 (patch) | |
tree | 0a58379ab346045b890105dd0e134fcd8b8c7640 /test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala | |
parent | 4ffe9345ca6e611ff5a83a3fdabeb7658a2fce50 (diff) | |
download | scala-0d8b32469ec655f35a31843e1843b8a580e772d1.tar.gz scala-0d8b32469ec655f35a31843e1843b8a580e772d1.tar.bz2 scala-0d8b32469ec655f35a31843e1843b8a580e772d1.zip |
Build a call graph for inlining decisions
Inlining decisions will be taken by analyzing the ASM bytecode. This
commit adds tools to build a call graph representation that can be
used for these decisions.
The call graph is currently built by considering method descriptors of
callsite instructions. It will become more precise by using data flow
analyses.
Diffstat (limited to 'test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala index 4481fcd6be..65c96226ff 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/BTypesFromClassfileTest.scala @@ -59,6 +59,15 @@ class BTypesFromClassfileTest { else (fromSym.flags | ACC_PRIVATE | ACC_PUBLIC) == (fromClassfile.flags | ACC_PRIVATE | ACC_PUBLIC) }, s"class flags differ\n$fromSym\n$fromClassfile") + // when parsing from classfile, the inline infos are obtained through the classSymbol, which + // is searched based on the classfile name. this lookup can fail. + assert(fromSym.inlineInfos.size == fromClassfile.inlineInfos.size || fromClassfile.inlineInfos.isEmpty, + s"wrong # of inline infos:\n${fromSym.inlineInfos.keys.toList.sorted}\n${fromClassfile.inlineInfos.keys.toList.sorted}") + fromClassfile.inlineInfos foreach { + case (signature, inlineInfo) => + assert(fromSym.inlineInfos(signature) == inlineInfo, s"inline infos differ for $signature:\n$inlineInfo\n${fromClassfile.inlineInfos(signature)}") + } + val chk1 = sameBTypes(fromSym.superClass, fromClassfile.superClass, checked) val chk2 = sameBTypes(fromSym.interfaces, fromClassfile.interfaces, chk1) |