< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java

Print this page
rev 52509 : [mq]: graal

@@ -22,10 +22,12 @@
  */
 
 
 package org.graalvm.compiler.word;
 
+import static jdk.vm.ci.services.Services.IS_BUILDING_NATIVE_IMAGE;
+
 import org.graalvm.compiler.core.common.type.Stamp;
 import org.graalvm.compiler.core.common.type.StampFactory;
 import org.graalvm.compiler.nodes.ValueNode;
 import org.graalvm.compiler.nodes.type.StampTool;
 import org.graalvm.compiler.word.Word.Operation;

@@ -76,21 +78,23 @@
         this.wordImplType = metaAccess.lookupJavaType(Word.class);
         this.wordFactoryType = metaAccess.lookupJavaType(WordFactory.class);
         this.objectAccessType = metaAccess.lookupJavaType(ObjectAccess.class);
         this.barrieredAccessType = metaAccess.lookupJavaType(BarrieredAccess.class);
 
+        if (!IS_BUILDING_NATIVE_IMAGE) {
         Word.ensureInitialized();
+        }
         this.wordImplType.initialize();
     }
 
     /**
      * Determines if a given method denotes a word operation.
      */
     public boolean isWordOperation(ResolvedJavaMethod targetMethod) {
         final boolean isWordFactory = wordFactoryType.equals(targetMethod.getDeclaringClass());
         if (isWordFactory) {
-            return true;
+            return !targetMethod.isConstructor();
         }
         final boolean isObjectAccess = objectAccessType.equals(targetMethod.getDeclaringClass());
         final boolean isBarrieredAccess = barrieredAccessType.equals(targetMethod.getDeclaringClass());
         if (isObjectAccess || isBarrieredAccess) {
             assert targetMethod.getAnnotation(Operation.class) != null : targetMethod + " should be annotated with @" + Operation.class.getSimpleName();
< prev index next >