Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java @ 22003:5bc7f7b867ab
Making debugger always on for each TruffleVM execution. Introducing EventConsumer to process such debugger events. Requesting each RootNode to be associated with a TruffleLanguage, so debugger can find out proper context for each Node where executions gets suspended.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Sat, 18 Jul 2015 18:03:36 +0200 |
parents | c07e64ecb528 |
children | e7c2d36daf72 |
comparison
equal
deleted
inserted
replaced
22002:324997830dc9 | 22003:5bc7f7b867ab |
---|---|
46 import com.oracle.truffle.api.dsl.*; | 46 import com.oracle.truffle.api.dsl.*; |
47 import com.oracle.truffle.api.frame.*; | 47 import com.oracle.truffle.api.frame.*; |
48 import com.oracle.truffle.api.nodes.*; | 48 import com.oracle.truffle.api.nodes.*; |
49 import com.oracle.truffle.api.object.*; | 49 import com.oracle.truffle.api.object.*; |
50 import com.oracle.truffle.api.source.*; | 50 import com.oracle.truffle.api.source.*; |
51 import com.oracle.truffle.sl.SLLanguage; | |
51 import com.oracle.truffle.sl.builtins.*; | 52 import com.oracle.truffle.sl.builtins.*; |
52 import com.oracle.truffle.sl.nodes.*; | 53 import com.oracle.truffle.sl.nodes.*; |
53 import com.oracle.truffle.sl.nodes.local.*; | 54 import com.oracle.truffle.sl.nodes.local.*; |
54 import com.oracle.truffle.sl.parser.*; | 55 import com.oracle.truffle.sl.parser.*; |
55 | 56 |
64 * context. Therefore, the context is not a singleton. | 65 * context. Therefore, the context is not a singleton. |
65 */ | 66 */ |
66 public final class SLContext extends ExecutionContext { | 67 public final class SLContext extends ExecutionContext { |
67 private static final Layout LAYOUT = Layout.createLayout(); | 68 private static final Layout LAYOUT = Layout.createLayout(); |
68 | 69 |
70 private final SLLanguage language; | |
69 private final BufferedReader input; | 71 private final BufferedReader input; |
70 private final PrintWriter output; | 72 private final PrintWriter output; |
71 private final SLFunctionRegistry functionRegistry; | 73 private final SLFunctionRegistry functionRegistry; |
72 private final Shape emptyShape; | 74 private final Shape emptyShape; |
73 | 75 |
74 public SLContext(BufferedReader input, PrintWriter output) { | 76 public SLContext(SLLanguage language, BufferedReader input, PrintWriter output) { |
77 this.language = language; | |
75 this.input = input; | 78 this.input = input; |
76 this.output = output; | 79 this.output = output; |
77 this.functionRegistry = new SLFunctionRegistry(); | 80 this.functionRegistry = new SLFunctionRegistry(); |
78 installBuiltins(); | 81 installBuiltins(); |
79 | 82 |
99 /** | 102 /** |
100 * Returns the registry of all functions that are currently defined. | 103 * Returns the registry of all functions that are currently defined. |
101 */ | 104 */ |
102 public SLFunctionRegistry getFunctionRegistry() { | 105 public SLFunctionRegistry getFunctionRegistry() { |
103 return functionRegistry; | 106 return functionRegistry; |
107 } | |
108 | |
109 public SLLanguage getLanguage() { | |
110 return language; | |
104 } | 111 } |
105 | 112 |
106 /** | 113 /** |
107 * Adds all builtin functions to the {@link SLFunctionRegistry}. This method lists all | 114 * Adds all builtin functions to the {@link SLFunctionRegistry}. This method lists all |
108 * {@link SLBuiltinNode builtin implementation classes}. | 115 * {@link SLBuiltinNode builtin implementation classes}. |