-
Following on from Christian Humer publishing https://github.com/oracle/graal/blob/master/truffle/docs/AOTOverview.md It would be good if there was a high level explanation of when new Should this describe any language instances or contexts associated with llvm and when they are created? A real example program would help i.e. rails / rspec / etc Maybe go on to describe the current situation and consequence for deoptimsations. And then what the ultimate goal is (I guess referencing #1835 ) I for one am curious, maybe there are others also? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm sorry for the late answer, I missed this, the Slack GitHub plugin finally added support for Discussions.
A RubyContext is an execution context / isolate, e.g. each execution context has its own independent state, for instance its own set of global variables, constants, classes, etc. A RubyLanguage is what holds onto these are deeply immutable objects and on the AST, so on the representation of the code. So multiple RubyContexts sharing the same RubyLanguage e.g. only need to compile a method once per RubyLanguage and not once per RubyContext.
Context and language instances always match, so 1 LLVMContext per RubyContext, and the same for languages.
Whenever you run using Or with the Java Context API, or with the C/C++ APIs which interacts with the Java API.
Sharing the RubyLanguage for multiple contexts is currently not supported by default for TruffleRuby because it's not fast yet (e.g., uncached method and constant lookups). #1835 tracks that.
To share code between multiple contexts but also with Auxiliary Engine Caching (EE) to be able to persist the JITed code on disk and reuse for the next process, even when using a single context as with the |
Beta Was this translation helpful? Give feedback.
I'm sorry for the late answer, I missed this, the Slack GitHub plugin finally added support for Discussions.
A RubyContext is an execution context / isolate, e.g. each execution context has its own independent state, for instance its own set of global variables, constants, classes, etc.
The only objects which are/cam be shared between contexts are deeply immutable objects like Symbols, frozen string literals, nil, true, false, Regexps, Integers, Float, etc.
A RubyLanguage is what holds onto these are deeply immutable objects and on the AST, so on the representation of …