You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2006/04/19 17:37:24 UTC

svn commit: r395278 [1/2] - in /xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util: ErrorMessages.java ErrorMsg.java MethodGenerator.java

Author: zongaro
Date: Wed Apr 19 08:37:23 2006
New Revision: 395278

URL: http://svn.apache.org/viewcvs?rev=395278&view=rev
Log:
Part of patch for XALANJ-1324 and others.

Added support for splitting and outlining chunks of a method that would
otherwise exceed the 64KB limit imposed by the Java Virtual Machine
specification on the length of the byte code in a method.  See Javadocs for all
the gory details.

Also made changes to fix-up branches that would overflow a 16-bit relative
branch offset.  Such branches could occur even in methods that would not exceed
the 64KB method size limit.  The sense of the branch is reversed and made to
guard an unconditional branch whose target is the target of the original
conditional branch.  A wide (32-bit) offset is used in the unconditional branch.

See org.apache.xalan.xsltc.compiler.util.MethodGenerator.outlineChunks for more
information.

Patch reviewed by Christine Li and Erin Harris.

Modified:
    xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java
    xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
    xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java

Modified: xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java
URL: http://svn.apache.org/viewcvs/xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java?rev=395278&r1=395277&r2=395278&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java (original)
+++ xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java Wed Apr 19 08:37:23 2006
@@ -940,8 +940,63 @@
         "The feature name cannot be null in TransformerFactory.setFeature(String name, boolean value)."},
 
         {ErrorMsg.JAXP_UNSUPPORTED_FEATURE,
-        "Cannot set the feature ''{0}'' on this TransformerFactory."}
+        "Cannot set the feature ''{0}'' on this TransformerFactory."},
 
+        /*
+         * Note to translators:  This message describes an internal error in the
+         * processor.  The term "byte code" is a Java technical term for the
+         * executable code in a Java method, and "try-catch-finally block"
+         * refers to the Java keywords with those names.  "Outlined" is a
+         * technical term internal to XSLTC and should not be translated.
+         */
+        {ErrorMsg.OUTLINE_ERR_TRY_CATCH,
+         "Internal XSLTC error:  the generated byte code contains a " +
+         "try-catch-finally block and cannot be outlined."},
+
+        /*
+         * Note to translators:  This message describes an internal error in the
+         * processor.  The terms "OutlineableChunkStart" and
+         * "OutlineableChunkEnd" are the names of classes internal to XSLTC and
+         * should not be translated.  The message indicates that for every
+         * "start" there must be a corresponding "end", and vice versa, and
+         * that if one of a pair of "start" and "end" appears between another
+         * pair of corresponding "start" and "end", then the other half of the
+         * pair must also be between that same enclosing pair.
+         */
+        {ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS,
+         "Internal XSLTC error:  OutlineableChunkStart and " +
+         "OutlineableChunkEnd markers must be balanced and properly nested."},
+
+        /*
+         * Note to translators:  This message describes an internal error in the
+         * processor.  The term "byte code" is a Java technical term for the
+         * executable code in a Java method.  The "method" that is being
+         * referred to is a Java method in a translet that XSLTC is generating
+         * in processing a stylesheet.  The "instruction" that is being
+         * referred to is one of the instrutions in the Java byte code in that
+         * method.  "Outlined" is a technical term internal to XSLTC and
+         * should not be translated.
+         */
+        {ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
+         "Internal XSLTC error:  an instruction that was part of a block of " +
+         "byte code that was outlined is still referred to in the original "+
+         "method."
+        },
+
+
+        /*
+         * Note to translators:  This message describes an internal error in the
+         * processor.  The "method" that is being referred to is a Java method
+         * in a translet that XSLTC is generating.
+         *
+         */
+        {ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG,
+         "Internal XSLTC error:  a method in the translet exceeds the Java " +
+         "Virtual Machine limitation on the length of a method of 64 "+
+         "kilobytes.  This is usually caused by templates in a stylesheet " +
+         "that are very large.  Try restructuring your stylesheet to use " +
+         "smaller templates."
+        }
     };
     }
 }

Modified: xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
URL: http://svn.apache.org/viewcvs/xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java?rev=395278&r1=395277&r2=395278&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java (original)
+++ xalan/java/trunk/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java Wed Apr 19 08:37:23 2006
@@ -151,6 +151,14 @@
     public static final String INVALID_QNAME_ERR = "INVALID_QNAME_ERR";
     public static final String INVALID_NCNAME_ERR = "INVALID_NCNAME_ERR";
     public static final String INVALID_METHOD_IN_OUTPUT = "INVALID_METHOD_IN_OUTPUT";
+
+    public static final String OUTLINE_ERR_TRY_CATCH = "OUTLINE_ERR_TRY_CATCH";
+    public static final String OUTLINE_ERR_UNBALANCED_MARKERS =
+                                            "OUTLINE_ERR_UNBALANCED_MARKERS";
+    public static final String OUTLINE_ERR_DELETED_TARGET =
+                                            "OUTLINE_ERR_DELETED_TARGET";
+    public static final String OUTLINE_ERR_METHOD_TOO_BIG =
+                                            "OUTLINE_ERR_METHOD_TOO_BIG";
                                                      
     // All error messages are localized and are stored in resource bundles.
     // This array and the following 4 strings are read from that bundle.



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org