Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java @ 21557:31fc2fce38f3
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 27 May 2015 13:32:18 +0200 |
parents | 3286fb5fea4a |
children | 894f82515e38 |
comparison
equal
deleted
inserted
replaced
21556:48c1ebd24120 | 21557:31fc2fce38f3 |
---|---|
28 import com.oracle.truffle.api.dsl.*; | 28 import com.oracle.truffle.api.dsl.*; |
29 import com.oracle.truffle.api.frame.*; | 29 import com.oracle.truffle.api.frame.*; |
30 import com.oracle.truffle.api.nodes.*; | 30 import com.oracle.truffle.api.nodes.*; |
31 import com.oracle.truffle.api.object.*; | 31 import com.oracle.truffle.api.object.*; |
32 import com.oracle.truffle.api.source.*; | 32 import com.oracle.truffle.api.source.*; |
33 import com.oracle.truffle.sl.*; | |
34 import com.oracle.truffle.sl.builtins.*; | 33 import com.oracle.truffle.sl.builtins.*; |
35 import com.oracle.truffle.sl.nodes.*; | 34 import com.oracle.truffle.sl.nodes.*; |
36 import com.oracle.truffle.sl.nodes.local.*; | 35 import com.oracle.truffle.sl.nodes.local.*; |
37 import com.oracle.truffle.sl.parser.*; | 36 import com.oracle.truffle.sl.parser.*; |
38 | 37 |
156 * | 155 * |
157 * @param source The {@link Source} to execute. | 156 * @param source The {@link Source} to execute. |
158 */ | 157 */ |
159 public void executeMain(Source source) { | 158 public void executeMain(Source source) { |
160 Parser.parseSL(this, source); | 159 Parser.parseSL(this, source); |
161 SLFunction main = getFunctionRegistry().lookup("main"); | |
162 if (main.getCallTarget() == null) { | |
163 throw new SLException("No function main() defined in SL source file."); | |
164 } | |
165 main.getCallTarget().call(); | |
166 output.flush(); | |
167 } | 160 } |
168 | 161 |
169 public DynamicObject createObject() { | 162 public DynamicObject createObject() { |
170 return LAYOUT.newInstance(emptyShape); | 163 return LAYOUT.newInstance(emptyShape); |
171 } | 164 } |