Mercurial > hg > truffle
annotate truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/TruffleVM.java @ 22173:dcb70d90c11d
Merging in changes in default branch
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Mon, 21 Sep 2015 11:21:03 +0200 |
parents | b31dcacfc8ff dc83cc1f94f2 |
children | 0bcfe8c6088f |
rev | line source |
---|---|
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
1 /* |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
4 * |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
10 * |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
15 * accompanied this code). |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
16 * |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
20 * |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
23 * questions. |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
24 */ |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api.vm; |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
26 |
22157
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
27 import com.oracle.truffle.api.TruffleLanguage; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
28 import com.oracle.truffle.api.debug.ExecutionEvent; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
29 import com.oracle.truffle.api.debug.SuspendedEvent; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
30 import com.oracle.truffle.api.source.Source; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
31 import java.io.IOException; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
32 import java.io.Reader; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
33 import java.io.Writer; |
dc83cc1f94f2
Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22141
diff
changeset
|
34 import java.util.Map; |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
35 import java.util.concurrent.CountDownLatch; |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
36 import java.util.concurrent.Executor; |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
37 |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
38 /** |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
39 * @deprecated |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
40 */ |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
41 @Deprecated |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
42 @SuppressWarnings({"rawtypes", "deprecated"}) |
22170
796f0fef110e
Renaming to PolyglotEngine
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22169
diff
changeset
|
43 public final class TruffleVM extends PolyglotEngine { |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
44 private TruffleVM() { |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
45 super(); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
46 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
47 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
48 TruffleVM(Executor executor, Map<String, Object> globals, Writer out, Writer err, Reader in, EventConsumer<?>[] handlers) { |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
49 super(executor, globals, out, err, in, handlers); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
50 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
51 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
52 @Deprecated |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
53 public static TruffleVM.Builder newVM() { |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
54 // making Builder non-static inner class is a |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
55 // nasty trick to avoid the Builder class to appear |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
56 // in Javadoc next to TruffleVM class |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
57 TruffleVM vm = new TruffleVM(); |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
58 return vm.new Builder(); |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
59 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
60 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
61 @Deprecated |
22170
796f0fef110e
Renaming to PolyglotEngine
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22169
diff
changeset
|
62 public final class Builder extends PolyglotEngine.Builder { |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
63 Builder() { |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
64 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
65 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
66 @Deprecated |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
67 @Override |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
68 public Builder executor(Executor executor) { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
69 return (Builder) super.executor(executor); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
70 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
71 |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
72 @Deprecated |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
73 @Override |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
74 public Builder globalSymbol(String name, Object obj) { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
75 return (Builder) super.globalSymbol(name, obj); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
76 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
77 |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
78 @Deprecated |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
79 @Override |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
80 public Builder onEvent(EventConsumer<?> handler) { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
81 return (Builder) super.onEvent(handler); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
82 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
83 |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
84 @Deprecated |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
85 @Override |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
86 public Builder stdIn(Reader r) { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
87 return (Builder) super.stdIn(r); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
88 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
89 |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
90 @Deprecated |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
91 @Override |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
92 public Builder stdErr(Writer w) { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
93 return (Builder) super.stdErr(w); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
94 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
95 |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
96 @Deprecated |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
97 @Override |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
98 public Builder stdOut(Writer w) { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
99 return (Builder) super.stdOut(w); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
100 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
101 |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
102 @Deprecated |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
103 @Override |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
104 public TruffleVM build() { |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
105 return (TruffleVM) super.build(); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
106 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
107 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
108 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
109 @Override |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
110 Value createValue(TruffleLanguage lang, Object[] result, CountDownLatch ready) { |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
111 return new Symbol(lang, result, ready); |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
112 } |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
113 |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
114 @Override |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
115 Language createLanguage(Map.Entry<String, LanguageCache> en) { |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
116 return new Language(en.getValue()); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
117 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
118 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
119 @Override |
22169
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
120 @SuppressWarnings("unchecked") |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
121 public Map<String, Language> getLanguages() { |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
122 return (Map<String, Language>) super.getLanguages(); |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
123 } |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
124 |
307a4ed5430e
Two more changes to guarantee better compatibility with TruffleVM
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22168
diff
changeset
|
125 @Override |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
126 public Symbol eval(Source source) throws IOException { |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22170
diff
changeset
|
127 return (Symbol) super.eval(source); |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
128 } |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
129 |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
130 @Override |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
131 public Symbol findGlobalSymbol(final String globalName) { |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22170
diff
changeset
|
132 return (Symbol) super.findGlobalSymbol(globalName); |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
133 } |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22170
diff
changeset
|
134 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
135 @Override |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
136 void dispatchSuspendedEvent(SuspendedEvent event) { |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
137 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
138 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
139 @Override |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
140 void dispatchExecutionEvent(ExecutionEvent event) { |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
141 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
142 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
143 @Deprecated |
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
144 public class Symbol extends Value { |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
145 Symbol(TruffleLanguage<?> language, Object[] result, CountDownLatch ready) { |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
146 super(language, result, ready); |
22135
e70b20f4bb00
Implementing API for Java/Truffle interop. Based around JavaInterop.asJavaObject and JavaInterop.asTruffleObject methods. Connected to TruffleVM via Symbol.as(Class) wrapper. Verified by extended TCK.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22133
diff
changeset
|
147 } |
e70b20f4bb00
Implementing API for Java/Truffle interop. Based around JavaInterop.asJavaObject and JavaInterop.asTruffleObject methods. Connected to TruffleVM via Symbol.as(Class) wrapper. Verified by extended TCK.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22133
diff
changeset
|
148 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
149 @Override |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
150 public Symbol invoke(final Object thiz, final Object... args) throws IOException { |
22172
b31dcacfc8ff
Replacing more TruffleVM references in comments with the new PolyglotEngine name
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22170
diff
changeset
|
151 return (Symbol) super.invoke(thiz, args); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
152 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
153 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
154 |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
155 @Deprecated |
22170
796f0fef110e
Renaming to PolyglotEngine
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22169
diff
changeset
|
156 public final class Language extends PolyglotEngine.Language { |
22137
1957c49a979d
(Re)Introducing LanguageCache - e.g. data that hold the essential static information about Truffle languages. Pre-initializing the data if AOT property is specified. Use mx -J-Dcom.oracle.truffle.aot=true unittest to validate proper behavior of AOT mode.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22135
diff
changeset
|
157 Language(LanguageCache info) { |
22168
ffadd23c63c8
Introducing Portaal into the isolated world of each and any TruffleLanguage.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
22137
diff
changeset
|
158 super(info); |
22128
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
159 } |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
160 } // end of Language |
f879b1fe3773
Separating the TruffleVM into its own project makes it possible to cleanup various system parts interations
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff
changeset
|
161 } |