diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 10076:25de9c96a032

Minor CompilationTask refactoring.
author Christian Haeubl <haeubl@ssw.jku.at>
date Tue, 18 Jun 2013 09:00:33 +0200
parents a323a9e20f9d
children 7bcc4bf839fe
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Mon Jun 17 22:09:44 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Tue Jun 18 09:00:33 2013 +0200
@@ -66,7 +66,7 @@
     private final int entryBCI;
     private final int id;
     private final int priority;
-    private final AtomicInteger status;
+    private final AtomicReference<CompilationStatus> status;
 
     private StructuredGraph graph;
 
@@ -83,7 +83,7 @@
         this.entryBCI = entryBCI;
         this.id = id;
         this.priority = priority;
-        this.status = new AtomicInteger();
+        this.status = new AtomicReference<>();
     }
 
     public ResolvedJavaMethod getMethod() {
@@ -224,7 +224,7 @@
     }
 
     private boolean tryToChangeStatus(CompilationStatus from, CompilationStatus to) {
-        return status.compareAndSet(from.ordinal(), to.ordinal());
+        return status.compareAndSet(from, to);
     }
 
     @Override