annotate truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/processor/LanguageRegistrationTest.java @ 22548:6b76a24fffbd default tip

Use all variables: a, b, u,v and x, y
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Thu, 14 Jan 2016 14:20:57 +0100
parents 260e3cdf11ec
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
1 /*
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
4 *
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
8 *
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
13 * accompanied this code).
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
14 *
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
18 *
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
21 * questions.
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
22 */
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
23 package com.oracle.truffle.api.dsl.test.processor;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
24
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
25 import java.io.IOException;
21494
f5b49d881909 Truffle-DSL: move internal @ExpectError annotation from public API to the test package only; share expect error handling between new processors.
Christian Humer <christian.humer@gmail.com>
parents: 21481
diff changeset
26
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
27 import com.oracle.truffle.api.CallTarget;
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
28 import com.oracle.truffle.api.TruffleLanguage;
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
29 import com.oracle.truffle.api.dsl.test.ExpectError;
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
30 import com.oracle.truffle.api.frame.MaterializedFrame;
22244
3c73d029b651 Truffle/Insntrumentation: remove deprecated methods in Accessor and TruffleLanguage
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22226
diff changeset
31 import com.oracle.truffle.api.instrument.Visualizer;
22226
c896a8e70777 Truffle/Instrumentation:
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22220
diff changeset
32 import com.oracle.truffle.api.instrument.WrapperNode;
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.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
33 import com.oracle.truffle.api.nodes.Node;
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
34 import com.oracle.truffle.api.source.Source;
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
35
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
36 public class LanguageRegistrationTest {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
37
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
38 @ExpectError("Registered language class must be public")
21889
45083be8a812 Truffle: add a version string to the information provided with Language registration
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21716
diff changeset
39 @TruffleLanguage.Registration(name = "myLang", version = "0", mimeType = "text/x-my")
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
40 private static final class MyLang {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
41 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
42
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
43 @ExpectError("Registered language inner-class must be static")
21889
45083be8a812 Truffle: add a version string to the information provided with Language registration
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21716
diff changeset
44 @TruffleLanguage.Registration(name = "myLangNonStatic", version = "0", mimeType = "text/x-my")
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
45 public final class MyLangNonStatic {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
46 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
47
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
48 @ExpectError("Registered language class must subclass TruffleLanguage")
21889
45083be8a812 Truffle: add a version string to the information provided with Language registration
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21716
diff changeset
49 @TruffleLanguage.Registration(name = "myLang", version = "0", mimeType = "text/x-my")
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
50 public static final class MyLangNoSubclass {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
51 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
52
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
53 @ExpectError("Language class must have public static final singleton field called INSTANCE")
21889
45083be8a812 Truffle: add a version string to the information provided with Language registration
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21716
diff changeset
54 @TruffleLanguage.Registration(name = "myLangNoCnstr", version = "0", mimeType = "text/x-my")
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
55 public static final class MyLangWrongConstr extends TruffleLanguage<Object> {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
56 private MyLangWrongConstr() {
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
57 super();
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
58 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
59
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
60 @Override
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.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
61 protected CallTarget parse(Source code, Node context, String... argumentNames) throws IOException {
e7c2d36daf72 TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
62 throw new IOException();
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
63 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
64
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
65 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
66 protected Object findExportedSymbol(Object context, String globalName, boolean onlyExplicit) {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
67 return null;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
68 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
69
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
70 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
71 protected Object getLanguageGlobal(Object context) {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
72 return null;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
73 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
74
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
75 @Override
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
76 protected boolean isObjectOfLanguage(Object object) {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
77 return false;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
78 }
21890
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
79
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
80 @Override
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
81 protected Visualizer getVisualizer() {
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
82 return null;
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
83 }
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
84
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
85 @Override
22220
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
86 protected boolean isInstrumentable(Node node) {
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
87 return false;
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
88 }
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
89
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
90 @Override
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
91 protected WrapperNode createWrapperNode(Node node) {
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
92 return null;
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
93 }
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
94
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
95 @Override
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
96 protected Object evalInContext(Source source, Node node, MaterializedFrame mFrame) throws IOException {
21890
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
97 return null;
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
98 }
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
99
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
100 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
101 protected Object createContext(Env env) {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
102 throw new UnsupportedOperationException();
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
103 }
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
104
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
105 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
106
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
107 @ExpectError("Language class must have public static final singleton field called INSTANCE")
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
108 @TruffleLanguage.Registration(name = "myLangNoField", version = "0", mimeType = "text/x-my")
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
109 public static final class MyLangNoField extends TruffleLanguage<Object> {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
110 public MyLangNoField() {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
111 super();
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
112 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
113
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
114 @Override
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.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
115 protected CallTarget parse(Source code, Node context, String... argumentNames) throws IOException {
e7c2d36daf72 TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
116 throw new IOException();
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
117 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
118
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
119 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
120 protected Object findExportedSymbol(Object context, String globalName, boolean onlyExplicit) {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
121 return null;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
122 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
123
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
124 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
125 protected Object getLanguageGlobal(Object context) {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
126 return null;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
127 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
128
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
129 @Override
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
130 protected boolean isObjectOfLanguage(Object object) {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
131 return false;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
132 }
21890
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
133
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
134 @Override
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
135 protected Visualizer getVisualizer() {
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
136 return null;
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
137 }
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
138
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
139 @Override
22220
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
140 protected boolean isInstrumentable(Node node) {
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
141 return false;
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
142 }
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
143
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
144 @Override
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
145 protected WrapperNode createWrapperNode(Node node) {
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
146 return null;
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
147 }
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
148
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
149 @Override
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
150 protected Object evalInContext(Source source, Node node, MaterializedFrame mFrame) throws IOException {
21890
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
151 return null;
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
152 }
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
153
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
154 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
155 protected Object createContext(Env env) {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
156 throw new UnsupportedOperationException();
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
157 }
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
158
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
159 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
160
21889
45083be8a812 Truffle: add a version string to the information provided with Language registration
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21716
diff changeset
161 @TruffleLanguage.Registration(name = "myLangGood", version = "0", mimeType = "text/x-my")
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
162 public static final class MyLangGood extends TruffleLanguage<Object> {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
163 private MyLangGood() {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
164 super();
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
165 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
166
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
167 public static final MyLangGood INSTANCE = new MyLangGood();
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
168
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
169 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
170 protected Object findExportedSymbol(Object context, String globalName, boolean onlyExplicit) {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
171 return null;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
172 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
173
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
174 @Override
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
175 protected Object getLanguageGlobal(Object context) {
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
176 return null;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
177 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
178
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
179 @Override
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
180 protected boolean isObjectOfLanguage(Object object) {
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
181 return false;
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
182 }
21890
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
183
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
184 @Override
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
185 protected Visualizer getVisualizer() {
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
186 return null;
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
187 }
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
188
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
189 @Override
22220
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
190 protected boolean isInstrumentable(Node node) {
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
191 return false;
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
192 }
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
193
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
194 @Override
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
195 protected WrapperNode createWrapperNode(Node node) {
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
196 return null;
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
197 }
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
198
20380d1d41f2 Truffle/Instrumentation: second merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22219
diff changeset
199 @Override
22214
3aad794eec0e Truffle/Instrumentation: first large merge of instrumentation code into the TruffleVM framework
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22066
diff changeset
200 protected Object evalInContext(Source source, Node node, MaterializedFrame mFrame) throws IOException {
21890
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
201 return null;
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
202 }
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
203
894f82515e38 Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 21889
diff changeset
204 @Override
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.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
205 protected CallTarget parse(Source code, Node context, String... argumentNames) throws IOException {
e7c2d36daf72 TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
206 throw new IOException();
e7c2d36daf72 TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
207 }
e7c2d36daf72 TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
208
22066
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
209 @Override
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
210 protected Object createContext(Env env) {
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
211 return env;
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
212 }
78c3d3d8d86e Clearly separating the TruffleLanguage definition from context used during its execution. TruffleLanguage now has to have public static field INSTANCE and override createContext method.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22046
diff changeset
213
21481
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
214 }
bb51b9a142b3 Enforcing public, one parameter constructor for each TruffleLanguage by annotation processor and required call to super.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
215 }