-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement tables and call_indirect #12
Implement tables and call_indirect #12
Conversation
lib/environ/src/environ.rs
Outdated
|
||
// For some reason table_addr only works with I64. | ||
let callee_i64 = pos.ins().uextend(I64, callee); | ||
let table_entry_addr = pos.ins().table_addr(I64, table, callee_i64, 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.
The current limitation is that it be the same type as a pointer, fwiw.
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.
Oh, didn't know about that.
Then I would probably go with pointer_type()
and extend only if needed.
lib/environ/src/environ.rs
Outdated
debug_assert_eq!(table_index, 0, "non-default tables not supported yet"); | ||
|
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.
We should leave the comment about signature checking for now.
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.
😨 oh yeah you're right! That was unintended.
53182c8
to
d9c070a
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.
Cool, this looks good. The table_addr type limitation is something I hope to lift, but for now it's reasonable to add a uextend here.
Binds functions added in bytecodealliance#1654 Closes bytecodealliance#5
Currently traps for the `*_CPUTIME_*` clocks and doesn't check for overflow on nanoseconds.
Merge with upstream
Based on #9
Consists of only de6b9f1 for the moment of writing