-
Notifications
You must be signed in to change notification settings - Fork 248
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
jit: support for memory grow/size #85
Conversation
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
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.
looks good, just a few notes to consider
// Now size should return the new pages -- 10. | ||
out, _, err = store.CallFunction("test", "size") | ||
require.NoError(t, err) | ||
require.Equal(t, newPages, out[0]) |
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 suppose there's no test we can do to see that the memory is usable? (ex using an offset that would only work if it was 10)
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.
indirectly tested as the size instruction takes len of the memory region, meaning that these offsets can be assumed to work. (Plus memory load,store instructions are not implemented so I cannot write in-Wasm memory access to verify it for now :D)
builder.initializeReservedRegisters() | ||
// Emit memory.size instructions. | ||
builder.handleMemorySize() | ||
// At this point, the size of memory should be pushed onto the stack. |
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.
ex this is a good "what" comment because the assertion is a bit indirect. so this one helps a lot
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.
agreed yeah:D I've put too many comments including the obvious ones. Will keep each line more meaningful from now on!
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
@codefromthecrypt thanks a lot! 🕺 |
Signed-off-by: Takeshi Yoneda takeshi@tetrate.io