Mark artificially-rescued fields as volatile.

Patch by: bobv
Review by: scottb (desk)

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6814 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java
index d983dba..921ecfe 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java
@@ -92,6 +92,13 @@
     this.declStmt = declStmt;
   }
 
+  public void setVolatile() {
+    if (isFinal()) {
+      throw new IllegalStateException("Final fields cannot be set volatile");
+    }
+    isVolatile = true;
+  }
+
   public void traverse(JVisitor visitor, Context ctx) {
     if (visitor.visit(this, ctx)) {
       // Do not visit declStmt, it gets visited within its own code block.
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
index bf5aaf6..ed69e95 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
@@ -2534,6 +2534,9 @@
           }
 
           currentClass.addArtificialRescue((JNode) node);
+          if (node instanceof JField) {
+            ((JField) node).setVolatile();
+          }
         }
       }
     }