-
Notifications
You must be signed in to change notification settings - Fork 880
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
EOF Optimization - don't split code sections #4898
Conversation
Optimize the EOF Functions implementation by not splitting code sections into separate Bytes object. Instead the EOF evaluation occurs on a single container space. When a function is called the PC (relative to container start, not section start) is moved. EOF lacks PC introspection and absolute jumps, so where "PC=0" starts is not observable to the code. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
workList[maxWork] = new int[] {currentPC + rvalue + 3, currentStackHeight}; | ||
maxWork++; | ||
} else if (thisOp == RelativeJumpVectorOperation.OPCODE) { | ||
int immediateDataSize = (code[currentPC + 1] & 0xff) * 2; |
Check failure
Code scanning / CodeQL
Array index out of bounds
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.
All good. Is this just improving memory usage or is there some other improvement i'm not seeing?
(a) memory usage. We don't have to slice out code sections and make copies of the sections. Also a bit of speed on the parse |
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
(c) there is also a runtime performance improvement, as we don't have to swap code sections in and out at function calls, but instead it's just a jump with more rules. |
Optimize the EOF Functions implementation by not splitting code sections into separate Bytes object. Instead the EOF evaluation occurs on a single container space. When a function is called the PC (relative to container start, not section start) is moved. EOF lacks PC introspection and absolute jumps, so where "PC=0" starts is not observable to the code. "PC=0" is still respected in the traces. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
PR description
Optimize the EOF Functions implementation by not splitting code sections into separate Bytes object. Instead the EOF evaluation occurs on a single container space. When a function is called the PC (relative to container start, not section start) is moved, and no section re-loading needs to occur.
EOF lacks PC introspection and absolute jumps, so where "PC=0" starts is not observable to the code.
Fixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog