changeset 8464:68b04162180e

made node intrinsic interpretable: SystemSubstitutions.callLong()
author Doug Simon <doug.simon@oracle.com>
date Mon, 25 Mar 2013 10:35:03 +0100
parents d815f0ac9ed3
children a7d3f7b5b462
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java	Fri Mar 22 19:50:51 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java	Mon Mar 25 10:35:03 2013 +0100
@@ -65,5 +65,11 @@
     }
 
     @NodeIntrinsic(value = RuntimeCallNode.class, setStampFromReturnType = true)
-    public static native long callLong(@ConstantNodeParameter Descriptor descriptor);
+    public static long callLong(@ConstantNodeParameter Descriptor descriptor) {
+        if (descriptor == JAVA_TIME_MILLIS) {
+            return System.currentTimeMillis();
+        }
+        assert descriptor == JAVA_TIME_NANOS;
+        return System.nanoTime();
+    }
 }