You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/06/04 19:50:15 UTC
[royale-compiler] 03/03: diagnostics
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch release_practice
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 3e8f585ce77937c504b82b096e10f1d9d1fdf965
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Jun 4 12:49:59 2019 -0700
diagnostics
---
.../apache/royale/abc/semantics/ControlFlowGraph.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/compiler/src/main/java/org/apache/royale/abc/semantics/ControlFlowGraph.java b/compiler/src/main/java/org/apache/royale/abc/semantics/ControlFlowGraph.java
index a23816b..9dbd05f 100644
--- a/compiler/src/main/java/org/apache/royale/abc/semantics/ControlFlowGraph.java
+++ b/compiler/src/main/java/org/apache/royale/abc/semantics/ControlFlowGraph.java
@@ -304,6 +304,7 @@ public class ControlFlowGraph implements IFlowgraph
*/
public void traverseGraph(IFlowGraphVisitor visitor)
{
+ boolean diagnostics = false;
if (mbi.getMethodInfo() != null &&
mbi.getMethodInfo().getMethodName() != null &&
mbi.getMethodInfo().getMethodName().contentEquals("dispatchEvent") &&
@@ -324,16 +325,34 @@ public class ControlFlowGraph implements IFlowgraph
blocklist[blockCount++] = blocks.next();
}
System.out.println("blockCount is: " + blockCount);
+ diagnostics = true;
}
+ int blockIndex = 0;
for (IBasicBlock b : this.blocksInControlFlowOrder())
{
+ if (diagnostics)
+ {
+ System.out.println("block " + blockIndex);
+ System.out.println(b.getInstructions());
+ }
if (visitor.visitBlock(b))
{
+ if (diagnostics)
+ System.out.println("visiting block: " + blockIndex);
for (Instruction i : b.getInstructions())
visitor.visitInstruction(i);
visitor.visitEnd(b);
+ if (diagnostics)
+ {
+ if (visitor instanceof FrameCountVisitor)
+ {
+ System.out.println("max_scope is now:" + ((FrameCountVisitor)visitor).max_scope);
+ System.out.println("scpDepth is now:" + ((FrameCountVisitor)visitor).scpdepth);
+ }
+ }
}
+ blockIndex++;
}
}