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
Simplifying WyIL Bytecode #502
Labels
Milestone
Comments
This was referenced Jan 11, 2016
The Plan
At this point, we want to start turning the bytecode into a structured form:
Also, allowing bytecode operands to be constants will enable further simplifications:
Other refactorings:
|
DavePearce
added a commit
that referenced
this issue
Mar 27, 2016
The Codes.Void bytecode makes heaps of sense but is completely unused at this stage. For simplicity it's gone for now. The Codes.NULL_REG and related constants are no longer required and have been removed.
DavePearce
added a commit
that referenced
this issue
Mar 28, 2016
The Codes.Void bytecode makes heaps of sense but is completely unused at this stage. For simplicity it's gone for now. The Codes.NULL_REG and related constants are no longer required and have been removed.
DavePearce
added a commit
that referenced
this issue
Mar 28, 2016
These bytecodes have been folded into the <code>Operator</code> class.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
This bytecode was not currently used, so has been removed. However, I will expect it to make a come back later on.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
Have pulled out the "operators" from the interpreter and split them into an array of InternalFunction instances. The idea behind this is to reduce the amount of code in the Interpreter class.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
This refactors the interpreter and the JVM code generator to split out the code responsible for simple bytecodes. This exploits the uniformity that is beginning to be seen in the WyIL bytecode format.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
This refactors the JVM code generator to split out the code responsible for simple bytecodes. This exploits the uniformity that is beginning to be seen in the WyIL bytecode format.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
This remoces the bytecode Codes.NewRecord and turns it into an "Operator". This means it can be manipulated in a more uniform fashion.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
These bytecodes have been merged into Codes.Operator.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
Renamed Code to Bytecode, and Code.AbstractBranchingCode to Bytecode.Branching and Code.AbstractCompoundCode to Bytecode.Compound. This naming is better for sure, though there's more to go.
DavePearce
added a commit
that referenced
this issue
Mar 29, 2016
This is something of an experiment. Basically, I'm wondering how far I can push the refactoring done so far. In particular, can we make the Abstract Syntax Tree more uniform in the same way that we have done for WyIL bytecodes? I'd guess the answer is yes, but it probably needs a fair bit of work. I have succeeding in doing one example only so far, and it wasn't easy.
DavePearce
added a commit
that referenced
this issue
Mar 30, 2016
Having everything centered around the Bytecode class is not ideal, but I think it's more consistent and looks better. Realistically, we need a better language to get a better effect :)
DavePearce
added a commit
that referenced
this issue
Mar 30, 2016
This refactors Bytecode.If to accept only one argument rather than two and a comparator. Instead the comparator is implemented as a Bytecode.Operator.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
This refactors Bytecode.If to accept only one argument rather than two and a comparator. Instead the comparator is implemented as a Bytecode.Operator. Perhaps surprisingly, this does offer some useful simplifications.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
The Codes.Void bytecode makes heaps of sense but is completely unused at this stage. For simplicity it's gone for now. The Codes.NULL_REG and related constants are no longer required and have been removed.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
These bytecodes have been folded into the <code>Operator</code> class.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
This bytecode was not currently used, so has been removed. However, I will expect it to make a come back later on.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
Have pulled out the "operators" from the interpreter and split them into an array of InternalFunction instances. The idea behind this is to reduce the amount of code in the Interpreter class.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
This refactors the JVM code generator to split out the code responsible for simple bytecodes. This exploits the uniformity that is beginning to be seen in the WyIL bytecode format.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
This remoces the bytecode Codes.NewRecord and turns it into an "Operator". This means it can be manipulated in a more uniform fashion.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
These bytecodes have been merged into Codes.Operator.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
Renamed Code to Bytecode, and Code.AbstractBranchingCode to Bytecode.Branching and Code.AbstractCompoundCode to Bytecode.Compound. This naming is better for sure, though there's more to go.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
This is something of an experiment. Basically, I'm wondering how far I can push the refactoring done so far. In particular, can we make the Abstract Syntax Tree more uniform in the same way that we have done for WyIL bytecodes? I'd guess the answer is yes, but it probably needs a fair bit of work. I have succeeding in doing one example only so far, and it wasn't easy.
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
Having everything centered around the Bytecode class is not ideal, but I think it's more consistent and looks better. Realistically, we need a better language to get a better effect :)
DavePearce
added a commit
that referenced
this issue
Mar 31, 2016
This refactors Bytecode.If to accept only one argument rather than two and a comparator. Instead the comparator is implemented as a Bytecode.Operator. Perhaps surprisingly, this does offer some useful simplifications.
DavePearce
added a commit
that referenced
this issue
Apr 16, 2016
This removes the so-called bytecode constructors, which were static methods that actually instantiated Bytecode objects. Whilst these were actually quite nice in some ways, they were just accounting for yet more code. Removing makes little or no difference.
DavePearce
added a commit
that referenced
this issue
Apr 16, 2016
This adds an explicit Operator kind for logical not expressions. This can simplify code generation in some situations.
Done and merged into |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The WyIL bytecode could be significantly simplified by turning a large number of operations into builtin function calls. For example, removing the
add
bytecode and just having a function call to the builtin+
operator.The advantage of this is that it would make the bytecode language itself much more uniform and remove lots of the strange distinctions between unary, binary and nary relations. Furthermore, type information is included which will simplify type checking, etc.
The text was updated successfully, but these errors were encountered: