comparison truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLNewObjectBuiltin.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 * Built-in function to create a new object. Objects in SL are simply made up of name/value pairs. 49 * Built-in function to create a new object. Objects in SL are simply made up of name/value pairs.
49 */ 50 */
50 @NodeInfo(shortName = "new") 51 @NodeInfo(shortName = "new")
51 public abstract class SLNewObjectBuiltin extends SLBuiltinNode { 52 public abstract class SLNewObjectBuiltin extends SLBuiltinNode {
52 53
53 public SLNewObjectBuiltin() { 54 public SLNewObjectBuiltin() {
54 super(SourceSection.createUnavailable("SL builtin", "new")); 55 super(SourceSection.createUnavailable(SLLanguage.builtinKind, "new"));
55 } 56 }
56 57
57 @Specialization 58 @Specialization
58 public Object newObject() { 59 public Object newObject() {
59 return getContext().createObject(); 60 return getContext().createObject();