[JVM] Move isTcbStart computation in FastAnalyzer
This commit is contained in:
+8
-3
@@ -17,15 +17,15 @@ import org.jetbrains.org.objectweb.asm.tree.analysis.Value
|
|||||||
|
|
||||||
abstract class FastAnalyzer<V : Value, I : Interpreter<V>, F : Frame<V>>(
|
abstract class FastAnalyzer<V : Value, I : Interpreter<V>, F : Frame<V>>(
|
||||||
private val owner: String,
|
private val owner: String,
|
||||||
protected val method: MethodNode,
|
private val method: MethodNode,
|
||||||
private val interpreter: I,
|
private val interpreter: I,
|
||||||
private val pruneExceptionEdges: Boolean,
|
private val pruneExceptionEdges: Boolean,
|
||||||
) {
|
) {
|
||||||
private val nInsns = method.instructions.size()
|
private val nInsns = method.instructions.size()
|
||||||
private val frames: Array<Frame<V>?> = arrayOfNulls(nInsns)
|
private val frames: Array<Frame<V>?> = arrayOfNulls(nInsns)
|
||||||
|
|
||||||
protected val handlers: Array<MutableList<TryCatchBlockNode>?> = arrayOfNulls(nInsns)
|
private val handlers: Array<MutableList<TryCatchBlockNode>?> = arrayOfNulls(nInsns)
|
||||||
protected val isTcbStart = BooleanArray(nInsns)
|
private val isTcbStart = BooleanArray(nInsns)
|
||||||
private val isMergeNode = findMergeNodes(method)
|
private val isMergeNode = findMergeNodes(method)
|
||||||
|
|
||||||
private val queued = BooleanArray(nInsns)
|
private val queued = BooleanArray(nInsns)
|
||||||
@@ -39,6 +39,11 @@ abstract class FastAnalyzer<V : Value, I : Interpreter<V>, F : Frame<V>>(
|
|||||||
|
|
||||||
checkAssertions()
|
checkAssertions()
|
||||||
computeExceptionHandlers(method)
|
computeExceptionHandlers(method)
|
||||||
|
|
||||||
|
for (tcb in method.tryCatchBlocks) {
|
||||||
|
isTcbStart[tcb.start.indexOf() + 1] = true
|
||||||
|
}
|
||||||
|
|
||||||
beforeAnalyze()
|
beforeAnalyze()
|
||||||
|
|
||||||
analyzeMainLoop()
|
analyzeMainLoop()
|
||||||
|
|||||||
-6
@@ -50,10 +50,4 @@ class FastMethodAnalyzer<V : Value>
|
|||||||
private val createFrame: (Int, Int) -> Frame<V> = { nLocals, nStack -> Frame<V>(nLocals, nStack) }
|
private val createFrame: (Int, Int) -> Frame<V> = { nLocals, nStack -> Frame<V>(nLocals, nStack) }
|
||||||
) : FastAnalyzer<V, Interpreter<V>, Frame<V>>(owner, method, interpreter, pruneExceptionEdges) {
|
) : FastAnalyzer<V, Interpreter<V>, Frame<V>>(owner, method, interpreter, pruneExceptionEdges) {
|
||||||
override fun newFrame(nLocals: Int, nStack: Int): Frame<V> = createFrame(nLocals, nStack)
|
override fun newFrame(nLocals: Int, nStack: Int): Frame<V> = createFrame(nLocals, nStack)
|
||||||
|
|
||||||
override fun beforeAnalyze() {
|
|
||||||
for (tcb in method.tryCatchBlocks) {
|
|
||||||
isTcbStart[tcb.start.indexOf() + 1] = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user