nashorn/src/jdk/nashorn/internal/ir/CatchNode.java
changeset 24751 ccbd9cd3f720
parent 24719 f726e9d67629
child 24759 31aed7d9c02a
--- a/nashorn/src/jdk/nashorn/internal/ir/CatchNode.java	Mon May 05 14:17:20 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/CatchNode.java	Tue May 13 11:30:40 2014 +0200
@@ -42,10 +42,7 @@
     /** Catch body. */
     private final Block body;
 
-    private final int flags;
-
-    /** Is this block a synthethic rethrow created by finally inlining? */
-    public static final int IS_SYNTHETIC_RETHROW = 1;
+    private final boolean isSyntheticRethrow;
 
     /**
      * Constructors
@@ -56,22 +53,24 @@
      * @param exception          variable name of exception
      * @param exceptionCondition exception condition
      * @param body               catch body
-     * @param flags              flags
+     * @param isSyntheticRethrow true if this node is a synthetically generated rethrow node.
      */
-    public CatchNode(final int lineNumber, final long token, final int finish, final IdentNode exception, final Expression exceptionCondition, final Block body, final int flags) {
+    public CatchNode(final int lineNumber, final long token, final int finish, final IdentNode exception,
+            final Expression exceptionCondition, final Block body, final boolean isSyntheticRethrow) {
         super(lineNumber, token, finish);
         this.exception          = exception == null ? null : exception.setIsInitializedHere();
         this.exceptionCondition = exceptionCondition;
         this.body               = body;
-        this.flags              = flags;
+        this.isSyntheticRethrow = isSyntheticRethrow;
     }
 
-    private CatchNode(final CatchNode catchNode, final IdentNode exception, final Expression exceptionCondition, final Block body, final int flags) {
+    private CatchNode(final CatchNode catchNode, final IdentNode exception, final Expression exceptionCondition,
+            final Block body, final boolean isSyntheticRethrow) {
         super(catchNode);
         this.exception          = exception;
         this.exceptionCondition = exceptionCondition;
         this.body               = body;
-        this.flags              = flags;
+        this.isSyntheticRethrow = isSyntheticRethrow;
     }
 
     /**
@@ -132,7 +131,7 @@
         if (this.exceptionCondition == exceptionCondition) {
             return this;
         }
-        return new CatchNode(this, exception, exceptionCondition, body, flags);
+        return new CatchNode(this, exception, exceptionCondition, body, isSyntheticRethrow);
     }
 
     /**
@@ -152,14 +151,14 @@
         if (this.exception == exception) {
             return this;
         }
-        return new CatchNode(this, exception, exceptionCondition, body, flags);
+        return new CatchNode(this, exception, exceptionCondition, body, isSyntheticRethrow);
     }
 
     private CatchNode setBody(final Block body) {
         if (this.body == body) {
             return this;
         }
-        return new CatchNode(this, exception, exceptionCondition, body, flags);
+        return new CatchNode(this, exception, exceptionCondition, body, isSyntheticRethrow);
     }
 
     /**
@@ -170,7 +169,6 @@
      * @return true if a finally synthetic rethrow
      */
     public boolean isSyntheticRethrow() {
-        return (flags & IS_SYNTHETIC_RETHROW) == IS_SYNTHETIC_RETHROW;
+        return isSyntheticRethrow;
     }
-
 }