changeset 13351:7345e9672dc3

refactor computation of architecture features
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Mon, 16 Dec 2013 10:22:17 -0800
parents 2c3b59f34619
children cd22c6bb4a35
files graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java	Mon Dec 16 09:31:19 2013 -0800
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java	Mon Dec 16 10:22:17 2013 -0800
@@ -37,6 +37,10 @@
 public class AMD64HotSpotBackendFactory implements HotSpotBackendFactory {
 
     protected Architecture createArchitecture(HotSpotVMConfig config) {
+        return new AMD64(computeFeatures(config));
+    }
+
+    protected EnumSet<AMD64.CPUFeature> computeFeatures(HotSpotVMConfig config) {
         // Configure the feature set using the HotSpot flag settings.
         EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
         assert config.useSSE >= 2 : "minimum config for x64";
@@ -66,8 +70,7 @@
         if (config.allocatePrefetchInstr == 3) {
             features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH);
         }
-
-        return new AMD64(features);
+        return features;
     }
 
     protected TargetDescription createTarget(HotSpotVMConfig config) {