changeset 10076:25de9c96a032

Minor CompilationTask refactoring.
author Christian Haeubl <haeubl@ssw.jku.at>
date Tue, 18 Jun 2013 09:00:33 +0200
parents c0e9ae41ed17
children 9c4e6767ab78 7bcc4bf839fe f158703c308c
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
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
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Jun 17 22:09:44 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Tue Jun 18 09:00:33 2013 +0200
@@ -582,7 +582,7 @@
     }
 
     /**
-     * Compiled a method to machine code.
+     * Compiles a method to machine code.
      */
     public void compileMethod(final HotSpotResolvedJavaMethod method, final int entryBCI, boolean blocking, int priority) throws Throwable {
         boolean osrCompilation = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI;