forked from smarr/TruffleSOM
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interpreter that uses the Truffle Bytecode DSL #226
Open
smarr
wants to merge
63
commits into
SOM-st:master
Choose a base branch
from
smarr:operations-dsl-visitor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [Hack] add copies to avoid current OpDSL limitations - Addition/Subtraction bits - EqualsOp, EqualsEqualsPrim, NotMessageNode - [Hack] the local return translation to produce a value. This is needed to avoid triggering the DSL - [Hack] implement GlobalCachedReadOp (there’s currently a DSL bug, which prevents the use of the assumption) - [Hack] add WriteArgument operation, this may not be ok, because on stack replacement apparently may lose the argument array - [Hack] Add fallback methods for reading non-local variables - [Hack] Make getting the source safe when a dispatch node is used in the context of an OperationsNode - [Hack] Make some specializations static by simply using a cached value, may not be ideal for the AST interpreter - [Hack] Change read node to specialize on frame descriptor, make write not use fd from frame - add specific ops - ReturnNonLocal for BcDSL - IsNilOp, NotNilOp - IntIncrementNode - NonLocalVar Read/Write - PushBlock* operations - DividePrim, LessThanOrEqualPrim, and DividePrim - CharAtOp, MultiplicationPrim, UnequalPrim, <, >, >= - AndBoolMsg, OrBoolMsg, WhileFalse/WhileTruePrimitiveNode - DoubleDiv, MaxInt, MinInt, IncField, and various more primitives - ConcatPrim - fix basic settings and test setup - add constructOperation to literals - add GlobalReadOp - add NonLocalArgumentReadNode - add a static version of determineContext - add missing ValueNonePrim.create() - implement ifTrue:ifFalse:,..., IfNotNilInlinedLiteralNode, IfMessageNode, IfNil, IfNotNil - implement Array’s #do: and #doIndexes:, Integer>>#to:do:, Integer>>#downTo:do:, Array>>#putAll: - implement literal nodes - handle literals explicitly when processing super expressions Since they do not take any arguments, the normal approach doesn’t work, but special casing here seems fine. - implement SuperSend - implement SuperExprNode by allowing to emit begin and end from the parent node - implement field read/write operations - implement LocalVariable Read/Write, Return Local, and WhileInlinedLiterals - use Conditional for control flow that needs to push a value - DSL block design: - make sure ReturnNonLocal is emitted as a block to look like it returns a single value - make sure to emit a block around a sequence to make sure it appears as a single value - handle conversion of methods only when assembling the class - this avoids issues with inlining. If we do it on method assembling, then we convert blocks already to OpDSL methods, which prevents inlining. Though, when we do it only at class-assemble time, we can handle inlining and trivial methods easily. - primitives won’t be converted. - need to create a new RootNode to have the compatible frame descriptor. I tried to just update the old root node, but that doesn’t work, because the frame is going to be used very differently. - make message send compile in OpDSL - expose assumptions on the dispatch guard to make it work - check in the SourceCompiler that we got the right one, based on VmSettings Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
… the OpDSL The following should now produce the decisions.json file for generating an optimized interpreter. ant compile-som -Denable.opdsl-tracing=true rm state.json touch state.json rebench -R rebench.conf opdsl-tracing Signed-off-by: Stefan Marr <[email protected]>
…he super classes Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
- added assertion, because it looks like I am not using the arg but it might be implied that it should be arg == 0 Signed-off-by: Stefan Marr <[email protected]>
…sn’t unrolled Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
…gging Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
… stack Signed-off-by: Stefan Marr <[email protected]>
This avoids issues with EE. Signed-off-by: Stefan Marr <[email protected]>
- this became $node, but should be ommitted Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
- add increment expression and field with constant value super instructions - add missing IncFieldWithExp - add the string concationation case, but doesn’t avoid double guard on field update Signed-off-by: Stefan Marr <[email protected]>
… the BytecodeNode for accessing locals in outer contexts Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
- added the replaces annotation on the field read nodes NonLocalReadField, and LocalReadField Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
This is when an arg is turned into an inlined local. Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Signed-off-by: Stefan Marr <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP