Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit d159f14

Browse files
committed
Producers / Consumers Analysis
ASM has a built-in `SourceValue` analysis which computes for each value a set of instructions that may possibly have constructed it. The ProdConsAnalyzer class provides additional queries over the result of the SourceValue analysis: - consumers of values - tracking producers / consumers through copying operations (load, store, etc) A fix to (and therefore a new version of) ASM was required. See here: scala/scala-asm@94106a5472
1 parent 7f1336a commit d159f14

File tree

7 files changed

+724
-18
lines changed

7 files changed

+724
-18
lines changed

src/compiler/scala/tools/nsc/backend/jvm/analysis/InstructionStackEffect.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ object InstructionStackEffect {
9494
val isSize2 = peekStack(0).getSize == 2
9595
if (isSize2) t(1, 0) else t(2, 0)
9696

97-
case DUP => t(0, 1)
97+
case DUP => t(1, 2)
9898

9999
case DUP_X1 => t(2, 3)
100100

@@ -104,7 +104,7 @@ object InstructionStackEffect {
104104

105105
case DUP2 =>
106106
val isSize2 = peekStack(0).getSize == 2
107-
if (isSize2) t(0, 1) else t(0, 2)
107+
if (isSize2) t(1, 2) else t(2, 4)
108108

109109
case DUP2_X1 =>
110110
val isSize2 = peekStack(0).getSize == 2

0 commit comments

Comments
 (0)