-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
support dynamic function calls in component model #4442
support dynamic function calls in component model #4442
Commits on Jul 21, 2022
-
support dynamic function calls in component model
This addresses bytecodealliance#4310, introducing a new `component::values::Val` type for representing component values dynamically, as well as `component::types::Type` for representing the corresponding interface types. It also adds a `call` method to `component::func::Func`, which takes a slice of `Val`s as parameters and returns a `Result<Val>` representing the result. Note that I've moved `post_return` and `call_raw` from `TypedFunc` to `Func` since there was nothing specific to `TypedFunc` about them, and I wanted to reuse them. The code in both is unchanged beyond the trivial tweaks to make them fit in their new home. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for 68f7786 - Browse repository at this point
Copy the full SHA 68f7786View commit details -
order variants and match cases more consistently
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for eb18b7a - Browse repository at this point
Copy the full SHA eb18b7aView commit details -
implement lift for String, Box<str>, etc.
This also removes the redundant `store` parameter from `Type::load`. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for 3c8d25a - Browse repository at this point
Copy the full SHA 3c8d25aView commit details -
implement code review feedback
This fixes a few issues: - Bad offset calculation when lowering - Missing variant padding - Style issues regarding `types::Handle` - Missed opportunities to reuse `Lift` and `Lower` impls It also adds forwarding `Lift` impls for `Box<[T]>`, `Vec<T>`, etc. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for b2644c1 - Browse repository at this point
Copy the full SHA b2644c1View commit details
Commits on Jul 22, 2022
-
move
new_*
methods to specifictypes
structsPer review feedback, I've moved `Type::new_record` to `Record::new_val` and added a `Type::unwrap_record` method; likewise for the other kinds of types. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for c0f36c4 - Browse repository at this point
Copy the full SHA c0f36c4View commit details -
make tuple, option, and expected type comparisons recursive
These types should compare as equal across component boundaries as long as their type parameters are equal. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for 6c7c10b - Browse repository at this point
Copy the full SHA 6c7c10bView commit details -
improve error diagnostic in
Type::check
We now distinguish between more failure cases to provide an informative error message. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for 66271ba - Browse repository at this point
Copy the full SHA 66271baView commit details -
- Remove `WasmStr::to_str_from_memory` and `WasmList::get_from_memory` - add `try_new` methods to various `values` types - avoid using `ExactSizeIterator::len` where we can't trust it - fix over-constrained bounds on forwarded `ComponentType` impls Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for b414cd2 - Browse repository at this point
Copy the full SHA b414cd2View commit details
Commits on Jul 25, 2022
-
rearrange code per review feedback
- Move functions from `types` to `values` module so we can make certain struct fields private - Rename `try_new` to just `new` Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for 47ef3c1 - Browse repository at this point
Copy the full SHA 47ef3c1View commit details -
remove special-case equality test for tuples, options, and expecteds
Instead, I've added a FIXME comment and will open an issue to do recursive structural equality testing. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Configuration menu - View commit details
-
Copy full SHA for 7289687 - Browse repository at this point
Copy the full SHA 7289687View commit details