You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2019/08/19 16:30:21 UTC

[royale-compiler] branch develop updated (6f76b72 -> b5eba65)

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

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


    from 6f76b72  Fix for error if <fx:Metadata/> tag is empty or effectively empty (contains commented our tags)
     new 6048e84  compiler: remove old diagnostics
     new b5eba65  compiler-jx: some more verbose messages

The 2 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:
 .../internal/codegen/js/jx/ClassEmitter.java       | 17 +++++++--
 .../internal/codegen/js/utils/DocEmitterUtils.java |  5 +--
 .../royale/abc/semantics/ControlFlowGraph.java     | 40 ----------------------
 .../royale/abc/semantics/MethodBodyInfo.java       |  7 ----
 4 files changed, 18 insertions(+), 51 deletions(-)


[royale-compiler] 02/02: compiler-jx: some more verbose messages

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit b5eba6583982965a1c0d4df0b836e6269df623f8
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Mon Aug 19 09:25:25 2019 -0700

    compiler-jx: some more verbose messages
---
 .../compiler/internal/codegen/js/jx/ClassEmitter.java   | 17 +++++++++++++++--
 .../internal/codegen/js/utils/DocEmitterUtils.java      |  5 +++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ClassEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ClassEmitter.java
index df85044..4c1877d 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ClassEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/ClassEmitter.java
@@ -19,6 +19,8 @@
 
 package org.apache.royale.compiler.internal.codegen.js.jx;
 
+import java.util.List;
+
 import org.apache.royale.compiler.asdoc.royale.ASDocComment;
 import org.apache.royale.compiler.codegen.ISubEmitter;
 import org.apache.royale.compiler.codegen.js.IJSEmitter;
@@ -55,9 +57,11 @@ public class ClassEmitter extends JSSubEmitter implements
     @Override
     public void emit(IClassNode node)
     {
-    	boolean keepASDoc = false;
+        boolean keepASDoc = false;
+        boolean verbose = false;
         RoyaleJSProject project = (RoyaleJSProject)getEmitter().getWalker().getProject();
         keepASDoc = project.config != null && project.config.getKeepASDoc();
+        verbose = project.config != null && project.config.isVerbose();
     	
         getModel().pushClass(node.getDefinition());
 
@@ -66,7 +70,16 @@ public class ClassEmitter extends JSSubEmitter implements
         
         ASDocComment asDoc = (ASDocComment) node.getASDocComment();
         if (asDoc != null && keepASDoc)
-            DocEmitterUtils.loadImportIgnores(fjs, asDoc.commentNoEnd());
+        {
+            List<String> ignoreList = DocEmitterUtils.loadImportIgnores(fjs, asDoc.commentNoEnd());
+            if(verbose)
+            {
+                for(String ignorable : ignoreList)
+                {
+                    System.out.println("Found ignorable: " + ignorable);
+                }
+            }
+        }
         
         boolean suppressExport = (asDoc != null && DocEmitterUtils.hasSuppressExport(fjs, asDoc.commentNoEnd()));
 
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/DocEmitterUtils.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/DocEmitterUtils.java
index 2e03bb0..a188e76 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/DocEmitterUtils.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/utils/DocEmitterUtils.java
@@ -20,6 +20,7 @@
 package org.apache.royale.compiler.internal.codegen.js.utils;
 
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleDocEmitter;
 import org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitter;
@@ -27,7 +28,7 @@ import org.apache.royale.compiler.internal.codegen.js.royale.JSRoyaleEmitterToke
 
 public class DocEmitterUtils
 {
-    public static void loadImportIgnores(JSRoyaleEmitter emitter, String doc)
+    public static List<String> loadImportIgnores(JSRoyaleEmitter emitter, String doc)
     {
         ArrayList<String> ignoreList = new ArrayList<String>();
         String ignoreToken = JSRoyaleEmitterTokens.IGNORE_IMPORT.getToken();
@@ -39,12 +40,12 @@ public class DocEmitterUtils
             ignorable = ignorable.substring(0, endIndex);
             ignorable = ignorable.trim();
             ignoreList.add(ignorable);
-            System.out.println("Found ignorable: " + ignorable);
             index = doc.indexOf(ignoreToken, index + endIndex);
         }
         
         // TODO (mschmalle)
         ((JSRoyaleDocEmitter)emitter.getDocEmitter()).setClassIgnoreList(ignoreList);
+        return ignoreList;
     }
     
     


[royale-compiler] 01/02: compiler: remove old diagnostics

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 6048e84b17692b40b5a9a3e1ecfaf89330687e09
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Mon Aug 19 09:24:23 2019 -0700

    compiler: remove old diagnostics
---
 .../royale/abc/semantics/ControlFlowGraph.java     | 40 ----------------------
 .../royale/abc/semantics/MethodBodyInfo.java       |  7 ----
 2 files changed, 47 deletions(-)

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 14c9c00..4f2800d 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
@@ -327,55 +327,15 @@ 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") &&
-    			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);
-    		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++;
         }
     }
 
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 540c132..fcf53d4 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,13 +219,6 @@ 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.