From juan.fumero at ed.ac.uk Sun Apr 10 11:45:26 2016 From: juan.fumero at ed.ac.uk (Juan Fumero) Date: Sun, 10 Apr 2016 12:45:26 +0100 Subject: Questions about graal packages In-Reply-To: <234317478.57670.1460273068551.JavaMail.yahoo@mail.yahoo.com> References: <234317478.57670.1460273068551.JavaMail.yahoo.ref@mail.yahoo.com> <234317478.57670.1460273068551.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1460288726.8927.13.camel@ed.ac.uk> Hi,? ? For building the GraalIR you can do it via StructuredGraph. You might have a look at the unittest for the build the graph given a Java Method.? For modifications, with no information about what you want to do it is hard to tell. A starting point, I guess, you can either apply existing phases or implement your own phases and apply them to the Graph built previously. See the classes that inherit from?com.oracle.graal.phase.Phase .? Regards Juan On Sun, 2016-04-10 at 07:24 +0000, geargemartinez at yahoo.com wrote: > Hello GuysWe want to get Java bytecodes which reperesent lambdas and > Steam API and I want to make some modification after converting them > to graal IRWe have some questions about graal code base?There are a > bunch of packages which are a little confusing for us?As you know > graal code base is huge and it takes a lot of time for us to > understand it.In which package or java class we should focus more ? > Thanks a lot > Regards > -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From java at stefan-marr.de Mon Apr 11 08:45:34 2016 From: java at stefan-marr.de (Stefan Marr) Date: Mon, 11 Apr 2016 10:45:34 +0200 Subject: Call for Papers: 11th ICOOOLPS Workshop at ECOOP. New Deadline April 22nd, 2016 Message-ID: <5610BF80-EA20-410F-AD6A-183735662B18@stefan-marr.de> Please note that the submission deadline is on the 22nd of April, 2016. Call for Papers: ICOOOLPS?16 ============================ 11th Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems Co-located with ECOOP July 18, 2016, Rome, Italy URL: http://2016.ecoop.org/track/ICOOOLPS-2016 Twitter: @ICOOOLPS The ICOOOLPS workshop series brings together researchers and practitioners working in the field of language implementation and optimization. The goal of the workshop is to discuss emerging problems and research directions as well as new solutions to classic performance challenges. The topics of interest for the workshop include techniques for the implementation and optimization of a wide range of languages including but not limited to object-oriented ones. Furthermore, meta-compilation techniques or language-agnostic approaches are welcome, too. A non-exclusive list of topics follows: - implementation and optimization of fundamental languages features (from automatic memory management to zero-overhead metaprogramming) - runtime systems technology (libraries, virtual machines) - static, adaptive, and speculative optimizations and compiler techniques - meta-compilation techniques and language-agnostic approaches for the efficient implementation of languages - compilers (intermediate representations, offline and online optimizations,...) - empirical studies on language usage, benchmark design, and benchmarking methodology - resource-sensitive systems (real-time, low power, mobile, cloud) - studies on design choices and tradeoffs (dynamic vs. static compilation, heuristics vs. programmer input,...) - tooling support, debuggability and observability of languages as well as their implementations ### Workshop Format and Submissions This workshop welcomes the presentation and discussion of new ideas and emerging problems that give a chance for interaction and exchange. More mature work is welcome as part of a mini-conference format, too. We aim to interleave interactive brainstorming and demonstration sessions between the formal presentations to foster an active exchange of ideas. The workshop papers will be published either in the ACM DL or in the Dagstuhl LIPIcs ECOOP Workshop proceedings. Until further notice, please use the ACM SIGPLAN template with a 10pt font size: http://www.sigplan.org/Resources/Author/. - position and work-in-progress paper: 1-4 pages - technical paper: max. 10 pages - demos and posters: 1-page abstract The page limits include references and appendixes. Note further that the upper page limit is a maximum and not a requirement. For the submission, please use the HotCRP system: http://ssw.jku.at/icooolps/ ### Important Dates - abstract submission: April 18, 2016 - paper submission: April 22, 2016 - notification: May 13, 2016 - all deadlines: Anywhere on Earth (AoE), i.e., GMT/UTC?12:00 hour - workshop: July 18th, 2016 ### Program Committee Edd Barrett, King?s College London, UK Clement Bera, Inria Lille, France Maxime Chevalier-Boisvert, Universit? de Montr?al, Canada Tim Felgentreff, Hasso Plattner Institute, Germany Roland Ducournau, LIRMM, Universit? de Montpellier, France Elisa Gonzalez Boix, Vrije Universiteit Brussel, Belgium David Gregg, Trinity College Dublin, Ireland Matthias Grimmer, Johannes Kepler University Linz, Austria Michael Haupt, Oracle, Germany Richard Jones, University of Kent, UK Tomas Kalibera, Northeastern University, USA Hidehiko Masuhara, Tokyo Institute of Technology, Japan Tiark Rompf, Purdue University, USA Jennifer B. Sartor, Ghent University, Belgium Sam Tobin-Hochstadt, Indiana University, USA ### Workshop Organizers Stefan Marr, Johannes Kepler University Linz, Austria Eric Jul, University of Oslo, Norway From juan.fumero at ed.ac.uk Tue Apr 12 11:06:47 2016 From: juan.fumero at ed.ac.uk (Juan Fumero) Date: Tue, 12 Apr 2016 12:06:47 +0100 Subject: GraalIR Virtual nodes Message-ID: <1460459207.28049.9.camel@ed.ac.uk> Hi all,? ? ? I am working with FastR and I am analyzing the GraalIR after the Partial Evaluation. I have a question concerning virtual nodes in the Graal IR. What do they represent? Are they considered as FloatingNodes?? For instance, for a simple R expression: f <- function(x) x * 2.0; I see nodes such as VirtualArray, VirtualObjectState or VirtualBoxing. Thanks Juan -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From gilles.m.duboscq at oracle.com Tue Apr 12 12:17:47 2016 From: gilles.m.duboscq at oracle.com (Gilles Duboscq) Date: Tue, 12 Apr 2016 14:17:47 +0200 Subject: GraalIR Virtual nodes In-Reply-To: <1460459207.28049.9.camel@ed.ac.uk> References: <1460459207.28049.9.camel@ed.ac.uk> Message-ID: <570CE76B.3050703@oracle.com> These nodes represent scalar replaced arrays and objects or their content [1, 2]. All the VirtualState nodes (including FrameState and VirtualObjectState) are "floating". They are not sub-classes of FloatingNode because so far FloatingNode is reserved for floating nodes that return a value. Also, VirtualState node tend to need to be treated differently than other floating node. The VirtualObjectNodes (including VirtualArray and VirtualBoxing) are also floating and represent the scalar replaced objects and are typically only reachable through VirtualState nodes. They are not sub-classes of FloatingNode because they don't represent any value that is accessible during execution, are only used as part of the deoptimization metadata (VirtualState). Gilles [1] http://ssw.jku.at/Research/Papers/Stadler14PhD/ [2] http://www.ssw.uni-linz.ac.at/Research/Papers/Stadler14/Stadler2014-CGO-PEA.pdf On 12/04/16 13:06, Juan Fumero wrote: > Hi all, > I am working with FastR and I am analyzing the GraalIR after the > Partial Evaluation. I have a question concerning virtual nodes in the > Graal IR. What do they represent? Are they considered as > FloatingNodes? > > For instance, for a simple R expression: > > > f <- function(x) x * 2.0; > > > I see nodes such as VirtualArray, VirtualObjectState or VirtualBoxing. > > Thanks > Juan > From juan.fumero at ed.ac.uk Wed Apr 13 13:43:35 2016 From: juan.fumero at ed.ac.uk (Juan Fumero) Date: Wed, 13 Apr 2016 14:43:35 +0100 Subject: GraalIR Virtual nodes In-Reply-To: <570CE76B.3050703@oracle.com> References: <1460459207.28049.9.camel@ed.ac.uk> <570CE76B.3050703@oracle.com> Message-ID: <1460555015.11435.1.camel@ed.ac.uk> Hi Gilles,? ? ?great, it is now much clearer.? Thanks Juan On Tue, 2016-04-12 at 14:17 +0200, Gilles Duboscq wrote: > These nodes represent scalar replaced arrays and objects or their > content [1, 2]. > > All the VirtualState nodes (including FrameState and > VirtualObjectState) are "floating". > They are not sub-classes of FloatingNode because so far FloatingNode > is reserved for floating nodes that return a value. Also, > VirtualState node tend to need to be treated differently than other > floating node. > > The VirtualObjectNodes (including VirtualArray and VirtualBoxing) are > also floating and represent the scalar replaced objects and are > typically only reachable through VirtualState nodes. > They are not sub-classes of FloatingNode because they don't represent > any value that is accessible during execution, are only used as part > of the deoptimization metadata (VirtualState). > > ?Gilles > > [1] http://ssw.jku.at/Research/Papers/Stadler14PhD/ > [2] http://www.ssw.uni-linz.ac.at/Research/Papers/Stadler14/Stadler20 > 14-CGO-PEA.pdf > > On 12/04/16 13:06, Juan Fumero wrote: > > > > Hi all,? > > ????I am working with FastR and I am analyzing the GraalIR after > > the > > Partial Evaluation. I have a question concerning virtual nodes in > > the > > Graal IR. What do they represent? Are they considered as > > FloatingNodes?? > > > > For instance, for a simple R expression: > > > > > > f <- function(x) x * 2.0; > > > > > > I see nodes such as VirtualArray, VirtualObjectState or > > VirtualBoxing. > > > > Thanks > > Juan > > -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From bahram.yarahmadi at gmail.com Sun Apr 24 06:34:56 2016 From: bahram.yarahmadi at gmail.com (Bahram Yarahmadi) Date: Sun, 24 Apr 2016 11:04:56 +0430 Subject: a Sample for Sparc backend Message-ID: Hello guys, I want to generate code for different ISAs ( for example SPARC which is currently in graal code base) before migrating to old revisions ( my main target is PTX) I have written a very simple program ,that is : RuntimeProvider runtimeProvider = Graal.getRequiredCapability(RuntimeProvider.class); Backend backend = runtimeProvider.getBackend(SPARC.class); Providers providers=backend.getProviders(); MetaAccess metaAccess = providers.getMetaAccess(); CodeCache codeCache = providers.getCodeCache(); ResolvedJavaMethod method = findMethod(ScrachTest.class, "AddTwoNumbers"); //ScrachTest.class is a simple class with a method in it StructuredGraph graph = new StructuredGraph(method, AllowAssumptions.YES); PhaseSuite graphBuilderSuite = backend.getSuites().getDefaultGraphBuilderSuite(); Suites suites = backend.getSuites().getDefaultSuites(); LIRSuites lirSuites = backend.getSuites().getDefaultLIRSuites(); OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL; ProfilingInfo profilingInfo = graph.getProfilingInfo(method); CompilationResult compilationResult = new CompilationResult(); CompilationResultBuilderFactory factory = CompilationResultBuilderFactory.Default; GraalCompiler.compileGraph(graph, method, providers, backend, graphBuilderSuite, optimisticOpts, profilingInfo, suites, lirSuites, compilationResult, factory); CompiledCode compiledCode = backend.createCompiledCode(method, compilationResult); InstalledCode installedCode = codeCache.addCode(method, compiledCode, null, null); When I want to test my program I get these Errors (com.oracle.graal.compiler.test.tutorial.GraalTutorial) java.lang.NullPointerException at com.oracle.graal.compiler.test.tutorial.InvokeGraal.(InvokeGraal.java:76) at com.oracle.graal.compiler.test.tutorial.GraalTutorial.(GraalTutorial.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:195) at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244) Could you please tell me how can I generate code for different ISAs ? Thanks Regards From jaroslav.tulach at oracle.com Mon Apr 25 06:25:58 2016 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Mon, 25 Apr 2016 08:25:58 +0200 Subject: Removal of deprecated source section related methods was: truffle-api-changes #266 In-Reply-To: <1233222855.6.1461334480915@c8ffaf347c3f> References: <1233222855.6.1461334480915@c8ffaf347c3f> Message-ID: <2389647.yZGND9xWt8@pracovni> Hi. Following report indicates that few methods related to management of SourceSection in Node were removed. They were deprecated for few weeks, so hopefully you have already updated your code. In any case, sorry for inconvenience, but enjoy more lightweight instances of Node smaller by one pointer. -jt Missing Constructors -------------------- com.oracle.truffle.api.nodes.Node: constructor protected com.oracle.truffle.api.nodes.Node.init(com.oracle.truffle.api.source.SourceSection) anno 0 java.lang.Deprecated() Missing Methods --------------- com.oracle.truffle.api.instrument.EventHandlerNode: method public void com.oracle.truffle.api.nodes.Node.assignSourceSection(com.oracle.truffle.api.source.SourceSection) anno 0 java.lang.Deprecated() com.oracle.truffle.api.instrument.EventHandlerNode: method public void com.oracle.truffle.api.nodes.Node.clearSourceSection() anno 0 java.lang.Deprecated() com.oracle.truffle.api.nodes.Node: method public void com.oracle.truffle.api.nodes.Node.assignSourceSection(com.oracle.truffle.api.source.SourceSection) anno 0 java.lang.Deprecated() com.oracle.truffle.api.nodes.Node: method public void com.oracle.truffle.api.nodes.Node.clearSourceSection() anno 0 java.lang.Deprecated() duplicate messages suppressed: 8 STATUS:Failed.13 errors Checking all signature changes against /workdir/truffle/truffle/com.oracle.truffle.api.debug/snapshot.sigtest Checking all signature changes against /workdir/truffle/truffle/com.oracle.truffle.api.dsl/snapshot.sigtest Checking all signature changes against /workdir/truffle/truffle/com.oracle.truffle.api.instrumentation/snapshot.sigtest SignatureTest report Base version: Tested version: Check mode: bin [throws removed] Constant checking: on Missing Methods --------------- com.oracle.truffle.api.instrumentation.ExecutionEventNode: method public void com.oracle.truffle.api.nodes.Node.assignSourceSection(com.oracle.truffle.api.source.SourceSection) anno 0 java.lang.Deprecated() com.oracle.truffle.api.instrumentation.ExecutionEventNode: method public void com.oracle.truffle.api.nodes.Node.clearSourceSection() anno 0 java.lang.Deprecated() com.oracle.truffle.api.instrumentation.ProbeNode: method public void com.oracle.truffle.api.nodes.Node.assignSourceSection(com.oracle.truffle.api.source.SourceSection) anno 0 java.lang.Deprecated() com.oracle.truffle.api.instrumentation.ProbeNode: method public void com.oracle.truffle.api.nodes.Node.clearSourceSection() anno 0 java.lang.Deprecated() STATUS:Failed.4 errors From christian.thalinger at oracle.com Mon Apr 25 18:27:35 2016 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Mon, 25 Apr 2016 08:27:35 -1000 Subject: a Sample for Sparc backend In-Reply-To: References: Message-ID: > On Apr 23, 2016, at 8:34 PM, Bahram Yarahmadi wrote: > > Hello guys, > I want to generate code for different ISAs ( for example SPARC which is > currently in graal code base) before migrating to old revisions ( my main > target is PTX) > I have written a very simple program ,that is : > RuntimeProvider runtimeProvider = > Graal.getRequiredCapability(RuntimeProvider.class); > Backend backend = runtimeProvider.getBackend(SPARC.class); > Providers providers=backend.getProviders(); > MetaAccess metaAccess = providers.getMetaAccess(); > CodeCache codeCache = providers.getCodeCache(); > ResolvedJavaMethod method = findMethod(ScrachTest.class, > "AddTwoNumbers"); //ScrachTest.class is a simple class with a method in it > StructuredGraph graph = new StructuredGraph(method, > AllowAssumptions.YES); > PhaseSuite graphBuilderSuite = > backend.getSuites().getDefaultGraphBuilderSuite(); > Suites suites = backend.getSuites().getDefaultSuites(); > LIRSuites lirSuites = backend.getSuites().getDefaultLIRSuites(); > > OptimisticOptimizations optimisticOpts = > OptimisticOptimizations.ALL; > ProfilingInfo profilingInfo = graph.getProfilingInfo(method); > CompilationResult compilationResult = new CompilationResult(); > CompilationResultBuilderFactory factory = > CompilationResultBuilderFactory.Default; > GraalCompiler.compileGraph(graph, method, providers, backend, > graphBuilderSuite, > optimisticOpts, profilingInfo, suites, lirSuites, > compilationResult, factory); > CompiledCode compiledCode = backend.createCompiledCode(method, > compilationResult); > InstalledCode installedCode = codeCache.addCode(method, > compiledCode, null, null); > When I want to test my program I get these Errors > (com.oracle.graal.compiler.test.tutorial.GraalTutorial) > java.lang.NullPointerException > at > com.oracle.graal.compiler.test.tutorial.InvokeGraal.(InvokeGraal.java:76) > at > com.oracle.graal.compiler.test.tutorial.GraalTutorial.(GraalTutorial.java:65) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:423) > at > org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:195) > at > org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244) > > Could you please tell me how can I generate code for different ISAs ? The simplest way, which I used when working on the AArch64 port, is to define the os.arch system property: -Dos.arch=sparcv9 That way you can JIT compile methods for a different architecture on, let?s say, x86. Obviously this will bail out when the JVM wants to install the compiled code in the code cache but it gets you a long way. > > Thanks > > Regards From christian.thalinger at oracle.com Mon Apr 25 18:31:31 2016 From: christian.thalinger at oracle.com (Christian Thalinger) Date: Mon, 25 Apr 2016 08:31:31 -1000 Subject: a Sample for Sparc backend In-Reply-To: References: Message-ID: > On Apr 25, 2016, at 8:27 AM, Christian Thalinger wrote: > >> >> On Apr 23, 2016, at 8:34 PM, Bahram Yarahmadi wrote: >> >> Hello guys, >> I want to generate code for different ISAs ( for example SPARC which is >> currently in graal code base) before migrating to old revisions ( my main >> target is PTX) One more thing? GPU architectures are (or can be) treated a little differently. See: https://github.com/graalvm/graal-core/blob/master/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java#L106 and https://github.com/graalvm/graal-core/blob/master/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java#L120 Actually I?m surprised this code was never removed. Plain oversight, I guess. >> I have written a very simple program ,that is : >> RuntimeProvider runtimeProvider = >> Graal.getRequiredCapability(RuntimeProvider.class); >> Backend backend = runtimeProvider.getBackend(SPARC.class); >> Providers providers=backend.getProviders(); >> MetaAccess metaAccess = providers.getMetaAccess(); >> CodeCache codeCache = providers.getCodeCache(); >> ResolvedJavaMethod method = findMethod(ScrachTest.class, >> "AddTwoNumbers"); //ScrachTest.class is a simple class with a method in it >> StructuredGraph graph = new StructuredGraph(method, >> AllowAssumptions.YES); >> PhaseSuite graphBuilderSuite = >> backend.getSuites().getDefaultGraphBuilderSuite(); >> Suites suites = backend.getSuites().getDefaultSuites(); >> LIRSuites lirSuites = backend.getSuites().getDefaultLIRSuites(); >> >> OptimisticOptimizations optimisticOpts = >> OptimisticOptimizations.ALL; >> ProfilingInfo profilingInfo = graph.getProfilingInfo(method); >> CompilationResult compilationResult = new CompilationResult(); >> CompilationResultBuilderFactory factory = >> CompilationResultBuilderFactory.Default; >> GraalCompiler.compileGraph(graph, method, providers, backend, >> graphBuilderSuite, >> optimisticOpts, profilingInfo, suites, lirSuites, >> compilationResult, factory); >> CompiledCode compiledCode = backend.createCompiledCode(method, >> compilationResult); >> InstalledCode installedCode = codeCache.addCode(method, >> compiledCode, null, null); >> When I want to test my program I get these Errors >> (com.oracle.graal.compiler.test.tutorial.GraalTutorial) >> java.lang.NullPointerException >> at >> com.oracle.graal.compiler.test.tutorial.InvokeGraal.(InvokeGraal.java:76) >> at >> com.oracle.graal.compiler.test.tutorial.GraalTutorial.(GraalTutorial.java:65) >> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >> at >> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) >> at >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) >> at java.lang.reflect.Constructor.newInstance(Constructor.java:423) >> at >> org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:195) >> at >> org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244) >> >> Could you please tell me how can I generate code for different ISAs ? > > The simplest way, which I used when working on the AArch64 port, is to define the os.arch system property: > > -Dos.arch=sparcv9 > > That way you can JIT compile methods for a different architecture on, let?s say, x86. Obviously this will bail out when the JVM wants to install the compiled code in the code cache but it gets you a long way. > >> >> Thanks >> >> Regards From peter at pniederw.com Mon Apr 25 18:58:02 2016 From: peter at pniederw.com (Peter Niederwieser) Date: Mon, 25 Apr 2016 20:58:02 +0200 (CEST) Subject: How "mandatory" is PolyglotEngine? Message-ID: <906863971.36241.1461610682423@office.mailbox.org> It?s not clear to me what the supported options are for interacting with my own Truffle language from the host language (Java): 1. Is it OK to interact directly with `MyTruffleLanguage` (which extends `TruffleLanguage`), or do I always have to go through `PolyglotEngine`? (The latter seems more complicated, less flexible, and seems to do a lot of wrapping.) 2. Say I get back an instance of `MyTruffleObject` (which implements `TruffleObject`) from `PolyglotEngine`. Is it OK to get a `CallTarget` from that instance (assuming it offers an API for that), and call that directly? Or do I always have to go through a `TruffleObject` message send instead? If `PolyglotEngine` is not mandatory, are there nevertheless good reasons to use it when all I want is to interact with my own language? Thanks, Peter From java at stefan-marr.de Mon Apr 25 19:12:59 2016 From: java at stefan-marr.de (Stefan Marr) Date: Mon, 25 Apr 2016 21:12:59 +0200 Subject: How "mandatory" is PolyglotEngine? In-Reply-To: <906863971.36241.1461610682423@office.mailbox.org> References: <906863971.36241.1461610682423@office.mailbox.org> Message-ID: Hi Peter: > On 25 Apr 2016, at 20:58, Peter Niederwieser wrote: > > 1. Is it OK to interact directly with `MyTruffleLanguage` (which extends `TruffleLanguage`), or do I always have to go through `PolyglotEngine`? (The latter seems more complicated, less flexible, and seems to do a lot of wrapping.) If you don?t want to use any other Truffle-based languages, I would expect it to be fine. My understanding is that the PolyglotEngine is not supposed to be mandatory. Could you give examples for what you like to do, and were you found it to be insufficient? The design is somewhat driven by the know use cases. > 2. Say I get back an instance of `MyTruffleObject` (which implements `TruffleObject`) from `PolyglotEngine`. Is it OK to get a `CallTarget` from that instance (assuming it offers an API for that), and call that directly? Or do I always have to go through a `TruffleObject` message send instead? It depends on what you want to do. If this is for interactions at the boundary of Java and Truffle, it should be fine. Otherwise, the messages are better, because they are meant to allow the partial evaluation to compile out their overhead. > If `PolyglotEngine` is not mandatory, are there nevertheless good reasons to use it when all I want is to interact with my own language? If you want to use the REPL, the debugger, the Truffle profiler, or any of the other things built on the Instrumentation API, you?ll have to use the PolyglotEngine at the moment. Best regards Stefan -- Stefan Marr Johannes Kepler Universit?t Linz http://stefan-marr.de/research/ From jaroslav.tulach at oracle.com Tue Apr 26 14:41:42 2016 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Tue, 26 Apr 2016 16:41:42 +0200 Subject: Truffle 0.13 is Released Message-ID: <4990142.4euMiCozqA@pracovni> Hi. The version 0.13 of Truffle JARs has been successfully uploaded to Maven central: http://search.maven.org/#artifactdetails|com.oracle.truffle|truffle-api|0.13| jar List of new features can be found in changelog: https://github.com/graalvm/truffle/blob/6e5c428d1327da8fa0593fd81d1fa7722bdc7357/CHANGELOG.md Enjoy! -jt From jaroslav.tulach at oracle.com Tue Apr 26 14:53:35 2016 From: jaroslav.tulach at oracle.com (Jaroslav Tulach) Date: Tue, 26 Apr 2016 16:53:35 +0200 Subject: How "mandatory" is PolyglotEngine? In-Reply-To: References: <906863971.36241.1461610682423@office.mailbox.org> Message-ID: <1551502.monqSmYnrr@pracovni> Hello Peter, Stefan. ### Monday 25 of April 2016, 21:12:59 @ Stefan Marr ### > > On 25 Apr 2016, at 20:58, Peter Niederwieser wrote: > > > > 1. Is it OK to interact directly with `MyTruffleLanguage` (which extends > > `TruffleLanguage`), or do I always have to go through `PolyglotEngine`? > > (The latter seems more complicated, less flexible, and seems to do a lot > > of wrapping.) > If you don?t want to use any other Truffle-based languages, I would expect > it to be fine. Yes, that is true. People playing with their own language only are usually fine. > My understanding is that the PolyglotEngine is not supposed > to be mandatory. My goal/vision is to make PolyglotEngine mandatory. Even in case of a single language PolyglotEngine offers interfaces that other services can benefit from. For example if you go through PolyglotEngine, your language can be debugged like any other Truffle one. Without PolyglotEngine you are out of luck. > Could you give examples for what you like to do, and were you found it to be > insufficient? The design is somewhat driven by the know use cases. Yes, knowing the observed limitations would be good. Please note that in new version of Truffle @ 0.13 many limitations are removed. > > > 2. Say I get back an instance of `MyTruffleObject` (which implements > > `TruffleObject`) from `PolyglotEngine`. Is it OK to get a `CallTarget` > > from that instance (assuming it offers an API for that), and call that > > directly? Or do I always have to go through a `TruffleObject` message > > send instead? Please note that all the overhead of initial 'message' has been removed in Truffle @ 0.13 release. Hopefully there is no reason why not use it and try the CallTarget shortcut. > It depends on what you want to do. > If this is for interactions at the boundary of Java and Truffle, it should > be fine. Otherwise, the messages are better, because they are meant to > allow the partial evaluation to compile out their overhead. If you find a case where PolyglotEngine.Value.execute isn't as fast as direct CallTarget call please report a bug with steps to reproduce. > > If `PolyglotEngine` is not mandatory, are there nevertheless good reasons > > to use it when all I want is to interact with my own language? > If you want to use the REPL, the debugger, the Truffle profiler, or any of > the other things built on the Instrumentation API, you?ll have to use the > PolyglotEngine at the moment. PolyglotEngine glues everything together. If you bypass PolyglotEngine you: - either don't need to glue anything together - have to glue things together yourself -jt From juan.fumero at ed.ac.uk Wed Apr 27 17:16:50 2016 From: juan.fumero at ed.ac.uk (Juan Fumero) Date: Wed, 27 Apr 2016 18:16:50 +0100 Subject: Multiple ClassLoader for the same class Message-ID: <1461777410.12014.4.camel@ed.ac.uk> Hi all,? ? ?I am trying to work with the StructuredGraph in the Truffle level.? But I get the following error:? java.io.IOException: com.oracle.truffle.r.runtime.RInternalError: java.lang.ClassCastException: com.oracle.graal.nodes.StructuredGraph cannot be cast to com.oracle.graal.nodes.StructuredGraph If I trace the Class Loading and unloading I get the following:? [Loaded com.oracle.graal.nodes.StructuredGraph from file:/home/juan/phd/astx- compiler/jvmci/jdk1.8.0_91/product/jre/lib/jvmci/graal-compiler.jar] And later on? [Loaded com.oracle.graal.nodes.StructuredGraph from file:/home/juan/phd/astx-compiler/graal/mxbuild/dists/graal- compiler.jar] And then I get the error. Any idea? Any work around? Customize Class loading? ? Thanks Juan -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: From tom.rodriguez at oracle.com Wed Apr 27 22:33:48 2016 From: tom.rodriguez at oracle.com (Tom Rodriguez) Date: Wed, 27 Apr 2016 15:33:48 -0700 Subject: Multiple ClassLoader for the same class In-Reply-To: <1461777410.12014.4.camel@ed.ac.uk> References: <1461777410.12014.4.camel@ed.ac.uk> Message-ID: It sounds like you have graal-compiler.jar on your classpath and it doesn?t need to be there. It?s possible you should be running with -XX:-UseJVMCIClassLoader so that graal is exposed through the bootclasspath instead of being isolated in it?s own class loader. tom > On Apr 27, 2016, at 10:16 AM, Juan Fumero wrote: > > Hi all, > I am trying to work with the StructuredGraph in the Truffle level. > > But I get the following error: > > java.io.IOException: com.oracle.truffle.r.runtime.RInternalError: > java.lang.ClassCastException: com.oracle.graal.nodes.StructuredGraph > cannot be cast to com.oracle.graal.nodes.StructuredGraph > > If I trace the Class Loading and unloading I get the following: > > [Loaded com.oracle.graal.nodes.StructuredGraph from > file:/home/juan/phd/astx- > compiler/jvmci/jdk1.8.0_91/product/jre/lib/jvmci/graal-compiler.jar] > And later on > > [Loaded com.oracle.graal.nodes.StructuredGraph from > file:/home/juan/phd/astx-compiler/graal/mxbuild/dists/graal- > compiler.jar] > > And then I get the error. Any idea? Any work around? Customize Class > loading? > > > Thanks > JuanThe University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. From juan.fumero at ed.ac.uk Thu Apr 28 10:08:10 2016 From: juan.fumero at ed.ac.uk (Juan Fumero) Date: Thu, 28 Apr 2016 11:08:10 +0100 Subject: Multiple ClassLoader for the same class In-Reply-To: References: <1461777410.12014.4.camel@ed.ac.uk> Message-ID: <1461838090.2832.3.camel@ed.ac.uk> Hi Tom,? ? ?yes you are right. I am using mx Rscript with server mode but I need the?-XX:-UseJVMCIClassLoader. If I do that there is no?problem.? Thanks a lot Juan On Wed, 2016-04-27 at 15:33 -0700, Tom Rodriguez wrote: > It sounds like you have graal-compiler.jar on your classpath and it > doesn?t need to be there.??It?s possible you should be running with > -XX:-UseJVMCIClassLoader so that graal is exposed through the > bootclasspath instead of being isolated in it?s own class loader. > > tom > > > > > On Apr 27, 2016, at 10:16 AM, Juan Fumero > > wrote: > > > > Hi all,? > > ???I am trying to work with the StructuredGraph in the Truffle > > level.? > > > > But I get the following error:? > > > > java.io.IOException: com.oracle.truffle.r.runtime.RInternalError: > > java.lang.ClassCastException: > > com.oracle.graal.nodes.StructuredGraph > > cannot be cast to com.oracle.graal.nodes.StructuredGraph > > > > If I trace the Class Loading and unloading I get the following:? > > > > [Loaded com.oracle.graal.nodes.StructuredGraph from > > file:/home/juan/phd/astx- > > compiler/jvmci/jdk1.8.0_91/product/jre/lib/jvmci/graal- > > compiler.jar] > > And later on? > > > > [Loaded com.oracle.graal.nodes.StructuredGraph from > > file:/home/juan/phd/astx-compiler/graal/mxbuild/dists/graal- > > compiler.jar] > > > > And then I get the error. Any idea? Any work around? Customize > > Class > > loading??? > > > > > > Thanks > > JuanThe University of Edinburgh is a charitable body, registered in > > Scotland, with registration number SC005336. > -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.