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:12 UTC

[royale-compiler] branch release_practice updated (4bc95fe -> 3e8f585)

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a change to branch release_practice
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git.


    from 4bc95fe  another eof fix for CRLF filter
     new 153682b  diagnostics
     new 795b4b9  try using a list instead of set to get predictability
     new 3e8f585  diagnostics

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/royale/abc/semantics/Block.java     |  4 +--
 .../royale/abc/semantics/ControlFlowGraph.java     | 40 ++++++++++++++++++++++
 .../royale/abc/semantics/MethodBodyInfo.java       |  7 ++++
 3 files changed, 49 insertions(+), 2 deletions(-)


[royale-compiler] 02/03: try using a list instead of set to get predictability

Posted by ah...@apache.org.
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 795b4b9483d4fd39d780bc365c19a723e6a040c5
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Jun 4 12:49:48 2019 -0700

    try using a list instead of set to get predictability
---
 compiler/src/main/java/org/apache/royale/abc/semantics/Block.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/src/main/java/org/apache/royale/abc/semantics/Block.java b/compiler/src/main/java/org/apache/royale/abc/semantics/Block.java
index 930cf90..d404ae0 100644
--- a/compiler/src/main/java/org/apache/royale/abc/semantics/Block.java
+++ b/compiler/src/main/java/org/apache/royale/abc/semantics/Block.java
@@ -48,7 +48,7 @@ public class Block implements IBasicBlock
     /**
      * Successors to this block.
      */
-    private Set<IBasicBlock> successors = Collections.emptySet();
+    private Collection<IBasicBlock> successors = Collections.emptySet();
 
     /**
      * @return successors of this block.
@@ -66,7 +66,7 @@ public class Block implements IBasicBlock
     void addSuccessor(IBasicBlock succ)
     {
         if (this.successors.size() == 0)
-            this.successors = new HashSet<IBasicBlock>();
+            this.successors = new ArrayList<IBasicBlock>();
 
         this.successors.add(succ);
     }


[royale-compiler] 01/03: diagnostics

Posted by ah...@apache.org.
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 153682b648b8b0c551d68d1c17ce04a4f24bf344
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Jun 4 11:03:01 2019 -0700

    diagnostics
---
 .../royale/abc/semantics/ControlFlowGraph.java      | 21 +++++++++++++++++++++
 .../apache/royale/abc/semantics/MethodBodyInfo.java |  7 +++++++
 2 files changed, 28 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 de0c42b..a23816b 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,27 @@ public class ControlFlowGraph implements IFlowgraph
      */
     public void traverseGraph(IFlowGraphVisitor visitor)
     {
+    	if (mbi.getMethodInfo() != null &&
+    			mbi.getMethodInfo().getMethodName() != null &&
+    			mbi.getMethodInfo().getMethodName().contentEquals("dispatchEvent") &&
+    			mbi.getMethodInfo().getParamNames().contains("event1"))
+    	{
+    		Iterator<IBasicBlock> blocks = this.blocksInControlFlowOrder().iterator();
+    		int blockCount = 0;
+    		while (blocks.hasNext())
+    		{
+    			blockCount++;
+    			blocks.next();
+    		}
+    		IBasicBlock[] blocklist = new IBasicBlock[blockCount];
+    		blocks = this.blocksInControlFlowOrder().iterator();
+    		blockCount = 0;
+    		while (blocks.hasNext())
+    		{
+    			blocklist[blockCount++] = blocks.next();
+    		}    		
+    		System.out.println("blockCount is: " + blockCount);
+    	}
         for (IBasicBlock b : this.blocksInControlFlowOrder())
         {
             if (visitor.visitBlock(b))
diff --git a/compiler/src/main/java/org/apache/royale/abc/semantics/MethodBodyInfo.java b/compiler/src/main/java/org/apache/royale/abc/semantics/MethodBodyInfo.java
index fcf53d4..540c132 100644
--- a/compiler/src/main/java/org/apache/royale/abc/semantics/MethodBodyInfo.java
+++ b/compiler/src/main/java/org/apache/royale/abc/semantics/MethodBodyInfo.java
@@ -219,6 +219,13 @@ public class MethodBodyInfo
         FrameCountVisitor counts = new FrameCountVisitor(this, diagnosticsVisitor, this.initial_scope);
         getCfg().traverseGraph(counts);
 
+        if (this.getMethodInfo().getMethodName() != null &&
+        		this.getMethodInfo().getMethodName().contentEquals("dispatchEvent") &&
+        		this.getMethodInfo().getParamNames() != null &&
+        		this.getMethodInfo().getParamNames().contains("event1"))
+        {
+        	System.out.println("ComputedFrameCounts: " + counts.max_scope + " " + this.max_scope );
+        }
         // Grrr..  TODO when we tighten up the max_stack,
         // max_scope, etc for code we read out of the flex
         // framework we seem to break that code.


[royale-compiler] 03/03: diagnostics

Posted by ah...@apache.org.
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++;
         }
     }