comparison truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java @ 22539:762dfc692689

SLContext: remove needless language field
author Andreas Woess <andreas.woess@oracle.com>
date Mon, 11 Jan 2016 14:46:50 +0100
parents ae2c10d36bed
children
comparison
equal deleted inserted replaced
22538:ae2c10d36bed 22539:762dfc692689
90 * context. Therefore, the context is not a singleton. 90 * context. Therefore, the context is not a singleton.
91 */ 91 */
92 public final class SLContext extends ExecutionContext { 92 public final class SLContext extends ExecutionContext {
93 private static final Layout LAYOUT = Layout.createLayout(); 93 private static final Layout LAYOUT = Layout.createLayout();
94 94
95 private final SLLanguage language;
96 private final BufferedReader input; 95 private final BufferedReader input;
97 private final PrintWriter output; 96 private final PrintWriter output;
98 private final SLFunctionRegistry functionRegistry; 97 private final SLFunctionRegistry functionRegistry;
99 private final Shape emptyShape; 98 private final Shape emptyShape;
100 private final TruffleLanguage.Env env; 99 private final TruffleLanguage.Env env;
101 100
102 public SLContext(SLLanguage language, TruffleLanguage.Env env, BufferedReader input, PrintWriter output) { 101 public SLContext(TruffleLanguage.Env env, BufferedReader input, PrintWriter output) {
103 this(language, env, input, output, true); 102 this(env, input, output, true);
104 } 103 }
105 104
106 public SLContext(SLLanguage language) { 105 public SLContext() {
107 this(language, null, null, null, false); 106 this(null, null, null, false);
108 } 107 }
109 108
110 private SLContext(SLLanguage language, TruffleLanguage.Env env, BufferedReader input, PrintWriter output, boolean installBuiltins) { 109 private SLContext(TruffleLanguage.Env env, BufferedReader input, PrintWriter output, boolean installBuiltins) {
111 this.language = language;
112 this.input = input; 110 this.input = input;
113 this.output = output; 111 this.output = output;
114 this.env = env; 112 this.env = env;
115 this.functionRegistry = new SLFunctionRegistry(); 113 this.functionRegistry = new SLFunctionRegistry();
116 installBuiltins(installBuiltins); 114 installBuiltins(installBuiltins);
137 /** 135 /**
138 * Returns the registry of all functions that are currently defined. 136 * Returns the registry of all functions that are currently defined.
139 */ 137 */
140 public SLFunctionRegistry getFunctionRegistry() { 138 public SLFunctionRegistry getFunctionRegistry() {
141 return functionRegistry; 139 return functionRegistry;
142 }
143
144 public SLLanguage getLanguage() {
145 return language;
146 } 140 }
147 141
148 /** 142 /**
149 * Adds all builtin functions to the {@link SLFunctionRegistry}. This method lists all 143 * Adds all builtin functions to the {@link SLFunctionRegistry}. This method lists all
150 * {@link SLBuiltinNode builtin implementation classes}. 144 * {@link SLBuiltinNode builtin implementation classes}.