Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/TestingLanguage.java @ 22046:e7c2d36daf72
TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Thu, 30 Jul 2015 17:36:34 +0200 |
parents | 5bc7f7b867ab |
children | 6dd4ab4d76d3 |
comparison
equal
deleted
inserted
replaced
22045:ffbc7f472438 | 22046:e7c2d36daf72 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.truffle.api.test; | 23 package com.oracle.truffle.api.test; |
24 | 24 |
25 import com.oracle.truffle.api.CallTarget; | |
26 import com.oracle.truffle.api.RootCallTarget; | |
25 import com.oracle.truffle.api.TruffleLanguage; | 27 import com.oracle.truffle.api.TruffleLanguage; |
26 import com.oracle.truffle.api.debug.DebugSupportProvider; | 28 import com.oracle.truffle.api.debug.DebugSupportProvider; |
27 import com.oracle.truffle.api.instrument.ToolSupportProvider; | 29 import com.oracle.truffle.api.instrument.ToolSupportProvider; |
30 import com.oracle.truffle.api.nodes.Node; | |
28 import com.oracle.truffle.api.source.Source; | 31 import com.oracle.truffle.api.source.Source; |
29 import java.io.IOException; | 32 import java.io.IOException; |
30 | 33 |
31 public final class TestingLanguage extends TruffleLanguage { | 34 public final class TestingLanguage extends TruffleLanguage { |
32 public static final TruffleLanguage INSTANCE = new TestingLanguage(); | 35 public static final TruffleLanguage INSTANCE = new TestingLanguage(); |
34 private TestingLanguage() { | 37 private TestingLanguage() { |
35 super(null); | 38 super(null); |
36 } | 39 } |
37 | 40 |
38 @Override | 41 @Override |
39 protected Object eval(Source code) throws IOException { | 42 protected CallTarget parse(Source code, Node context, String... argumentNames) throws IOException { |
40 throw new IOException(); | 43 throw new IOException(); |
41 } | 44 } |
42 | 45 |
43 @Override | 46 @Override |
44 protected Object findExportedSymbol(String globalName, boolean onlyExplicit) { | 47 protected Object findExportedSymbol(String globalName, boolean onlyExplicit) { |