-
Notifications
You must be signed in to change notification settings - Fork 59
Global review of the project (part 1) #600
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
Conversation
03e6cd4 to
e4bfd77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we paired on this, it already LGTM. Thanks for bringing it home with the final touches!
| INSTANCE_CALL_HOST_FUNCTION = | ||
| Instance.class.getMethod("callHostFunction", int.class, long[].class); | ||
| INSTANCE_READ_GLOBAL = Instance.class.getMethod("readGlobal", int.class); | ||
| READ_GLOBAL = AotMethods.class.getMethod("readGlobal", int.class, Instance.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say this and related are the most notable changes in the PR. The rest of it is changes to the visibility of some class and methods so that they are all package-private
| return globals[idx - importedGlobalsOffset]; | ||
| } | ||
|
|
||
| public void writeGlobal(int idx, long val) { | ||
| if (idx < importedGlobalsOffset) { | ||
| imports.global(idx).instance().setValue(val); | ||
| } | ||
| globals[idx - importedGlobalsOffset].setValue(val); | ||
| } | ||
|
|
||
| public ValueType readGlobalType(int idx) { | ||
| if (idx < importedGlobalsOffset) { | ||
| return imports.global(idx).instance().getType(); | ||
| } | ||
| return globals[idx - importedGlobalsOffset].getType(); | ||
| } | ||
|
|
||
| public long readGlobal(int idx) { | ||
| if (idx < importedGlobalsOffset) { | ||
| return imports.global(idx).instance().getValue(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "related" change I was mention in the other comment.
|
As promised, I have created a bunch of issues for about half the notes in the gist. The others I think can be considered minor and/or already in progress, but feel free to create more. I have also assigned a few to myself, but
|
Co-authored-by: evacchi <evacchi@users.noreply.github.com>
e4bfd77 to
ab965d5
Compare
Thanks a ton to @evacchi that paired on this time-consuming task ❤️
We did an almost full (file by file) review of the project and actioned anything trivial, this is the list of remaining task/future ideas:
https://gist.github.com/andreaTP/da9ceaaa20b72d84fb07cc0d1471891c