Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLNanoTimeBuiltin.java @ 22251:8dddde8b20d4
Truffle/SL: provide an "unavailable" SourceSection for every RootNode, using a newly defined static name that identifies "SL Builtin" RootNodes.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Thu, 24 Sep 2015 13:16:52 -0700 |
parents | dc83cc1f94f2 |
children |
comparison
equal
deleted
inserted
replaced
22250:0fb3522e5b72 | 22251:8dddde8b20d4 |
---|---|
41 package com.oracle.truffle.sl.builtins; | 41 package com.oracle.truffle.sl.builtins; |
42 | 42 |
43 import com.oracle.truffle.api.dsl.Specialization; | 43 import com.oracle.truffle.api.dsl.Specialization; |
44 import com.oracle.truffle.api.nodes.NodeInfo; | 44 import com.oracle.truffle.api.nodes.NodeInfo; |
45 import com.oracle.truffle.api.source.SourceSection; | 45 import com.oracle.truffle.api.source.SourceSection; |
46 import com.oracle.truffle.sl.SLLanguage; | |
46 | 47 |
47 /** | 48 /** |
48 * Builtin function that returns the value of a high-resolution time, in nanoseconds. | 49 * Builtin function that returns the value of a high-resolution time, in nanoseconds. |
49 */ | 50 */ |
50 @NodeInfo(shortName = "nanoTime") | 51 @NodeInfo(shortName = "nanoTime") |
51 public abstract class SLNanoTimeBuiltin extends SLBuiltinNode { | 52 public abstract class SLNanoTimeBuiltin extends SLBuiltinNode { |
52 | 53 |
53 public SLNanoTimeBuiltin() { | 54 public SLNanoTimeBuiltin() { |
54 super(SourceSection.createUnavailable("SL builtin", "nanoTime")); | 55 super(SourceSection.createUnavailable(SLLanguage.builtinKind, "nanoTime")); |
55 } | 56 } |
56 | 57 |
57 @Specialization | 58 @Specialization |
58 public long nanoTime() { | 59 public long nanoTime() { |
59 return System.nanoTime(); | 60 return System.nanoTime(); |