changeset 6458:fb66841a0994

made all @NodeIntrinsic annotated methods be native (this is a requirement now enforced during snippet intrinsification)
author Doug Simon <doug.simon@oracle.com>
date Fri, 28 Sep 2012 11:50:37 +0200
parents 03a1a0c5ee84
children a938e15e3bd7
files graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CastFromHub.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentLockNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DimensionsNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectCompareAndSwapNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectStoreNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/InitializeArrayNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorCounterNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorEnterStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorExitStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TLABAllocateNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Log.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetIntrinsificationPhase.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/BitScanForwardNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/BitScanReverseNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/DirectObjectStoreNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ExplodeLoopNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/JumpNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ReverseBytesNode.java
diffstat 43 files changed, 71 insertions(+), 261 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java	Fri Sep 28 11:50:37 2012 +0200
@@ -79,6 +79,10 @@
      * with an instance of the node class denoted by {@link #value()}.
      * For this reason, the signature of the annotated method must match
      * the signature of a constructor in the node class.
+     * <p>
+     * All methods annotated with this annotation must be declared native
+     * to ensure they throw a {@link UnsatisfiedLinkError} if called by
+     * non-Graal compiled code.
      */
     @Retention(RetentionPolicy.RUNTIME)
     @Target(ElementType.METHOD)
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -62,9 +62,6 @@
         gen.setResult(this, result);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Word beginLockScope(@ConstantNodeParameter boolean eliminated, @ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Word beginLockScope(@ConstantNodeParameter boolean eliminated, @ConstantNodeParameter Kind wordKind);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CastFromHub.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CastFromHub.java	Fri Sep 28 11:50:37 2012 +0200
@@ -61,9 +61,6 @@
         return this;
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <T> T castFromHub(Object object, Object hub) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native <T> T castFromHub(Object object, Object hub);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentLockNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentLockNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -45,9 +45,6 @@
         gen.setResult(this, result);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Word currentLock(@ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Word currentLock(@ConstantNodeParameter Kind wordKind);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Fri Sep 28 11:50:37 2012 +0200
@@ -44,9 +44,6 @@
         gen.setResult(this, gen.emitLoad(new Address(Kind.Object, thread.asValue(gen.target().wordKind), threadObjectOffset), false));
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object get(@ConstantNodeParameter int threadObjectOffset) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Object get(@ConstantNodeParameter int threadObjectOffset);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DimensionsNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DimensionsNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -53,9 +53,6 @@
         gen.setResult(this, result);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Word allocaDimsArray(@ConstantNodeParameter int rank, @ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Word allocaDimsArray(@ConstantNodeParameter int rank, @ConstantNodeParameter Kind wordKind);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectCompareAndSwapNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectCompareAndSwapNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -96,7 +96,5 @@
      * @return either {@code expectedValue} or the actual value
      */
     @NodeIntrinsic
-    public static Word compareAndSwap(Object object, long offset, Word expectedValue, Word newValue) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Word compareAndSwap(Object object, long offset, Word expectedValue, Word newValue);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectStoreNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectStoreNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -43,17 +43,11 @@
         this.value = value;
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(long address, long value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(long address, long value);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(long address, boolean value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(long address, boolean value);
 
     @Override
     public void generate(LIRGeneratorTool gen) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -49,7 +49,5 @@
     }
 
     @NodeIntrinsic
-    public static void endLockScope() {
-        throw new UnsupportedOperationException();
-    }
+    public static native void endLockScope();
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -41,11 +41,8 @@
         this.object = obj;
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static long get(Object array) {
-        throw new UnsupportedOperationException();
-    }
+    public static native long get(Object array);
 
     @Override
     public void generate(LIRGeneratorTool gen) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/InitializeArrayNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/InitializeArrayNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -76,9 +76,6 @@
         tool.getRuntime().lower(this, tool);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object initialize(Object memory, int length, int size, @ConstantNodeParameter ResolvedJavaType type, @ConstantNodeParameter boolean fillContents) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Object initialize(Object memory, int length, int size, @ConstantNodeParameter ResolvedJavaType type, @ConstantNodeParameter boolean fillContents);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorCounterNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorCounterNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -48,11 +48,6 @@
         gen.setResult(this, result);
     }
 
-
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Word counter(@ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException();
-    }
-
+    public static native Word counter(@ConstantNodeParameter Kind wordKind);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorEnterStubCall.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorEnterStubCall.java	Fri Sep 28 11:50:37 2012 +0200
@@ -58,9 +58,6 @@
         gen.append(new AMD64MonitorEnterStubCallOp(objectFixed, lockFixed, gen.state()));
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void call(Object hub, Word lock) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void call(Object hub, Word lock);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorExitStubCall.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorExitStubCall.java	Fri Sep 28 11:50:37 2012 +0200
@@ -56,9 +56,6 @@
         gen.append(new AMD64MonitorExitStubCallOp(objectFixed, lockFixed, gen.state()));
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void call(Object hub) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void call(Object hub);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java	Fri Sep 28 11:50:37 2012 +0200
@@ -77,9 +77,6 @@
         gen.setResult(this, result);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object call(@ConstantNodeParameter boolean isObjectArray, Object hub, int length) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Object call(@ConstantNodeParameter boolean isObjectArray, Object hub, int length);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Fri Sep 28 11:50:37 2012 +0200
@@ -71,11 +71,6 @@
         gen.setResult(this, result);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object call(Object hub) {
-        throw new UnsupportedOperationException();
-    }
-
-
+    public static native Object call(Object hub);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java	Fri Sep 28 11:50:37 2012 +0200
@@ -78,9 +78,6 @@
         gen.setResult(this, result);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object call(Object hub, @ConstantNodeParameter int rank, Word dims) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Object call(Object hub, @ConstantNodeParameter int rank, Word dims);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TLABAllocateNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TLABAllocateNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -53,9 +53,6 @@
     /**
      * @return null if allocation fails
      */
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Word allocateVariableSize(int size, @ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Word allocateVariableSize(int size, @ConstantNodeParameter Kind wordKind);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -26,7 +26,6 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.gen.*;
 import com.oracle.graal.compiler.target.*;
-import com.oracle.graal.graph.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.nodes.*;
@@ -64,9 +63,6 @@
         gen.emitCall(vmErrorStub, Kind.Void, signature, false, Constant.forObject(where), gen.operand(format), gen.operand(value));
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void vmError(String format, long value) {
-        throw new GraalInternalError("");
-    }
+    public static native void vmError(String format, long value);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java	Fri Sep 28 11:50:37 2012 +0200
@@ -55,9 +55,6 @@
         gen.append(new AMD64VerifyOopStubCallOp(objectFixed, info));
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object call(Object object) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Object call(Object object);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java	Fri Sep 28 11:50:37 2012 +0200
@@ -226,23 +226,14 @@
         return loadWordFromObjectIntrinsic(object, 0, offset, wordKind());
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(value = RegisterNode.class, setStampFromReturnType = true)
-    public static Word registerAsWord(@ConstantNodeParameter Register register) {
-        throw new UnsupportedOperationException();
-    }
+    public static native Word registerAsWord(@ConstantNodeParameter Register register);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true)
-    private static Word loadWordFromObjectIntrinsic(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    private static native Word loadWordFromObjectIntrinsic(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true)
-    private static Word loadWordFromWordIntrinsic(Word address, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    private static native Word loadWordFromWordIntrinsic(Word address, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind);
 
     static {
         assert arrayIndexScale(Kind.Byte) == 1;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java	Fri Sep 28 11:50:37 2012 +0200
@@ -348,11 +348,8 @@
      */
     private static final boolean ENABLE_BREAKPOINT = false;
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(BreakpointNode.class)
-    static void bkpt(Object object, Word mark, Word tmp, Word value) {
-        throw new GraalInternalError("");
-    }
+    static native void bkpt(Object object, Word mark, Word tmp, Word value);
 
     private static void incCounter() {
         if (CHECK_BALANCED_MONITORS) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -73,9 +73,6 @@
         gen.emitDeoptimize(action, reason, message, leafGraphId);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void deopt(@ConstantNodeParameter DeoptimizationAction action, @ConstantNodeParameter DeoptimizationReason reason) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void deopt(@ConstantNodeParameter DeoptimizationAction action, @ConstantNodeParameter DeoptimizationReason reason);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/MaterializeNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -72,14 +72,8 @@
     }
 
     @NodeIntrinsic
-    @SuppressWarnings("unused")
-    public static boolean materialize(@ConstantNodeParameter Condition condition, int x, int y) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native boolean materialize(@ConstantNodeParameter Condition condition, int x, int y);
 
     @NodeIntrinsic
-    @SuppressWarnings("unused")
-    public static boolean materialize(@ConstantNodeParameter Condition condition, long x, long y) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native boolean materialize(@ConstantNodeParameter Condition condition, long x, long y);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -132,9 +132,6 @@
         gen.setResult(this, gen.emitConvert(opcode, gen.operand(value())));
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <S, T> S convert(@ConstantNodeParameter Op op, T value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native <S, T> S convert(@ConstantNodeParameter Op op, T value);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -47,9 +47,6 @@
         generator.emitMembar(barriers);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void memoryBarrier(@ConstantNodeParameter int barriers) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native void memoryBarrier(@ConstantNodeParameter int barriers);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -78,14 +78,10 @@
         }
     }
 
-    @SuppressWarnings("unused")
     private ReadNode(ValueNode object, ValueNode location) {
         this(object, location, StampFactory.forNodeIntrinsic());
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <T> T readMemory(Object object, Object location) {
-        throw new UnsupportedOperationException();
-    }
+    public static native <T> T readMemory(Object object, Object location);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -65,21 +65,12 @@
     }
 
     // specialized on return type (instead of public static <T> T performCall) until boxing/unboxing is sorted out in intrinsification
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <S> double callDouble(@ConstantNodeParameter RuntimeCall call, S arg1) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native <S> double callDouble(@ConstantNodeParameter RuntimeCall call, S arg1);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static long callLong(@ConstantNodeParameter RuntimeCall call) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native long callLong(@ConstantNodeParameter RuntimeCall call);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void runtimeCall(@ConstantNodeParameter RuntimeCall call) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native void runtimeCall(@ConstantNodeParameter RuntimeCall call);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -85,17 +85,11 @@
         return false;
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <T> T cast(Object object, @ConstantNodeParameter Class<?> toType) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native <T> T cast(Object object, @ConstantNodeParameter Class<?> toType);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <T> T cast(Object object, @ConstantNodeParameter Class<?> toType, @ConstantNodeParameter boolean exactType, @ConstantNodeParameter boolean nonNull) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native <T> T cast(Object object, @ConstantNodeParameter Class<?> toType, @ConstantNodeParameter boolean exactType, @ConstantNodeParameter boolean nonNull);
 
     @Override
     public void generate(LIRGeneratorTool generator) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -74,15 +74,9 @@
         tool.getRuntime().lower(this, tool);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <T> T load(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native <T> T load(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static Object loadObject(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter boolean nonNull) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native Object loadObject(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter boolean nonNull);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -96,58 +96,31 @@
     }
 
     // specialized on value type until boxing/unboxing is sorted out in intrinsification
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, Object value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, Object value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, boolean value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, boolean value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, byte value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, byte value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, char value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, char value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, double value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, double value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, float value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, float value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, int value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, int value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, long value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, long value, @ConstantNodeParameter Kind kind);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void store(Object object, @ConstantNodeParameter int displacement, long offset, short value, @ConstantNodeParameter Kind kind) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void store(Object object, @ConstantNodeParameter int displacement, long offset, short value, @ConstantNodeParameter Kind kind);
 
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -76,9 +76,6 @@
         }
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void writeMemory(Object object, Object value, Object location) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void writeMemory(Object object, Object value, Object location);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -65,9 +65,6 @@
         tool.getRuntime().lower(this, tool);
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static int arrayLength(Object array) {
-        throw new UnsupportedOperationException();
-    }
+    public static native int arrayLength(Object array);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -81,21 +81,12 @@
     }
 
     // specialized on value type until boxing/unboxing is sorted out in intrinsification
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, Object expected, Object newValue) {
-        throw new UnsupportedOperationException();
-    }
+    public static native boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, Object expected, Object newValue);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, long expected, long newValue) {
-        throw new UnsupportedOperationException();
-    }
+    public static native boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, long expected, long newValue);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, int expected, int newValue) {
-        throw new UnsupportedOperationException();
-    }
+    public static native boolean compareAndSwap(Object object, @ConstantNodeParameter int displacement, long offset, int expected, int newValue);
 }
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Log.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Log.java	Fri Sep 28 11:50:37 2012 +0200
@@ -42,23 +42,14 @@
     private static final int LOG_OBJECT_STRING  = 0x02;
     private static final int LOG_OBJECT_ADDRESS = 0x04;
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(RuntimeCallNode.class)
-    private static void log(@ConstantNodeParameter RuntimeCall logObject, Object object, int flags) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    private static native void log(@ConstantNodeParameter RuntimeCall logObject, Object object, int flags);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(RuntimeCallNode.class)
-    private static void log(@ConstantNodeParameter RuntimeCall logPrimitive, int typeChar, long value, boolean newline) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    private static native void log(@ConstantNodeParameter RuntimeCall logPrimitive, int typeChar, long value, boolean newline);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic(RuntimeCallNode.class)
-    private static void printf(@ConstantNodeParameter RuntimeCall logPrintf, String format, long value) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    private static native void printf(@ConstantNodeParameter RuntimeCall logPrintf, String format, long value);
 
     public static void print(boolean value) {
         log(RuntimeCall.LogPrimitive, Kind.Boolean.typeChar, value ? 1L : 0L, false);
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetIntrinsificationPhase.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetIntrinsificationPhase.java	Fri Sep 28 11:50:37 2012 +0200
@@ -84,6 +84,7 @@
         NodeIntrinsic intrinsic = target.getAnnotation(Node.NodeIntrinsic.class);
         if (intrinsic != null) {
             assert target.getAnnotation(Fold.class) == null;
+            assert Modifier.isNative(target.accessFlags()) : "node intrinsic " + target + " should be native";
 
             Class< ? >[] parameterTypes = MetaUtil.signatureToTypes(target.signature(), target.holder());
             ResolvedJavaType returnType = (ResolvedJavaType) target.signature().returnType(target.holder());
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/BitScanForwardNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/BitScanForwardNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -56,9 +56,7 @@
     }
 
     @NodeIntrinsic
-    public static int scan(@SuppressWarnings("unused") long v) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native int scan(long v);
 
     @Override
     public void generate(LIRGenerator gen) {
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/BitScanReverseNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/BitScanReverseNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -57,14 +57,10 @@
     }
 
     @NodeIntrinsic
-    public static int scan(@SuppressWarnings("unused") int v) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native int scan(int v);
 
     @NodeIntrinsic
-    public static int scan(@SuppressWarnings("unused") long v) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native int scan(long v);
 
     @Override
     public void generate(LIRGenerator gen) {
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/DirectObjectStoreNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/DirectObjectStoreNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -46,29 +46,17 @@
         this.displacement = displacement;
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void storeObject(Object obj, @ConstantNodeParameter int displacement, long offset, Object value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void storeObject(Object obj, @ConstantNodeParameter int displacement, long offset, Object value);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void storeLong(Object obj, @ConstantNodeParameter int displacement, long offset, long value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void storeLong(Object obj, @ConstantNodeParameter int displacement, long offset, long value);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void storeWord(Object obj, @ConstantNodeParameter int displacement, long offset, Word value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void storeWord(Object obj, @ConstantNodeParameter int displacement, long offset, Word value);
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void storeInt(Object obj, @ConstantNodeParameter int displacement, long offset, int value) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void storeInt(Object obj, @ConstantNodeParameter int displacement, long offset, int value);
 
     @Override
     public void lower(LoweringTool tool) {
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ExplodeLoopNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ExplodeLoopNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -62,7 +62,5 @@
      * A call to this method must be placed immediately prior to the loop that is to be exploded.
      */
     @NodeIntrinsic
-    public static void explodeLoop() {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native void explodeLoop();
 }
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/JumpNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/JumpNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -61,7 +61,5 @@
      * @param successorIndex e.g. {@link IfNode#TRUE_EDGE}
      */
     @NodeIntrinsic
-    public static void jump(@ConstantNodeParameter int successorIndex) {
-        throw new UnsupportedOperationException();
-    }
+    public static native void jump(@ConstantNodeParameter int successorIndex);
 }
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -94,9 +94,6 @@
         return this;
     }
 
-    @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static double compute(double x, @ConstantNodeParameter Operation op) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native double compute(double x, @ConstantNodeParameter Operation op);
 }
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ReverseBytesNode.java	Thu Sep 27 21:37:46 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/ReverseBytesNode.java	Fri Sep 28 11:50:37 2012 +0200
@@ -55,14 +55,10 @@
     }
 
     @NodeIntrinsic
-    public static int reverse(@SuppressWarnings("unused") int v) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native int reverse(int v);
 
     @NodeIntrinsic
-    public static long reverse(@SuppressWarnings("unused") long v) {
-        throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
-    }
+    public static native long reverse(long v);
 
     @Override
     public void generate(LIRGenerator gen) {