-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Add C++20 std::span-based APIs for function arguments #43489
Conversation
This pull request was exported from Phabricator. Differential Revision: D54901847 |
19870a0
to
7cbce63
Compare
This pull request was exported from Phabricator. Differential Revision: D54901847 |
Summary: Changelog: [General][Changed] - Add `std::span` methods to `jsi::Function` when compiled as C++20 Adds `std::span<const jsi::Value>` overloads to public JSI methods that currently accept (or are designed to emit) `const jsi::Value* args, size_t count` for a dynamically-sized span of function arguments. These are: * `Function::call` * `Function::callWithThis` * `Function::callAsConstructor` * `Function::createFromHostFunction` We also add a `HostFunctionTypeWithSpanArgs` typedef (naming feedback welcome!) to serve a similar purpose to the existing `HostFunctionType`. ## Backwards compatibility * The new APIs are compiled conditionally to support pre-C++20 compilers. * No overloads are removed. * The new overloads are implemented as `inline` wrappers over the pointer+size versions. No change is made to the JSI contract for implementers (i.e. no new overloads, virtual or otherwise, are added to `Runtime`). Differential Revision: D54901847
7cbce63
to
3bebe76
Compare
This pull request was exported from Phabricator. Differential Revision: D54901847 |
3bebe76
to
61ffa58
Compare
Summary: Changelog: [General][Changed] - Add `std::span` methods to `jsi::Function` when compiled as C++20 Adds `std::span<const jsi::Value>` overloads to public JSI methods that currently accept (or are designed to emit) `const jsi::Value* args, size_t count` for a dynamically-sized span of function arguments. These are: * `Function::call` * `Function::callWithThis` * `Function::callAsConstructor` * `Function::createFromHostFunction` ## Backwards compatibility * The new APIs are compiled conditionally to support pre-C++20 compilers. * No overloads are removed. * The new overloads are implemented as `inline` wrappers over the pointer+size versions. * No change is made to the JSI contract for implementers (i.e. no new overloads, virtual or otherwise, are added to `Runtime`). Differential Revision: D54901847
This pull request was exported from Phabricator. Differential Revision: D54901847 |
Summary: Changelog: [General][Changed] - Add `std::span` methods to `jsi::Function` when compiled as C++20 Adds `std::span<const jsi::Value>` overloads to public JSI methods that currently accept (or are designed to emit) `const jsi::Value* args, size_t count` for a dynamically-sized span of function arguments. These are: * `Function::call` * `Function::callWithThis` * `Function::callAsConstructor` * `Function::createFromHostFunction` ## Backwards compatibility * The new APIs are compiled conditionally to support pre-C++20 compilers. * No overloads are removed. * The new overloads are implemented as `inline` wrappers over the pointer+size versions. * No change is made to the JSI contract for implementers (i.e. no new overloads, virtual or otherwise, are added to `Runtime`). Differential Revision: D54901847
61ffa58
to
3757f82
Compare
This pull request was exported from Phabricator. Differential Revision: D54901847 |
Summary: Changelog: [General][Changed] - Add `std::span` methods to `jsi::Function` when compiled as C++20 Adds `std::span<const jsi::Value>` overloads to public JSI methods that currently accept (or are designed to emit) `const jsi::Value* args, size_t count` for a dynamically-sized span of function arguments. These are: * `Function::call` * `Function::callWithThis` * `Function::callAsConstructor` * `Function::createFromHostFunction` ## Backwards compatibility * The new APIs are compiled conditionally to support pre-C++20 compilers. * No overloads are removed, except for `createFromHostFunction` (which has been folded into the template implementation). * The new overloads are implemented as `inline` wrappers over the pointer+size versions. * No change is made to the JSI contract for implementers (i.e. no new overloads, virtual or otherwise, are added to `Runtime`). Differential Revision: D54901847
3757f82
to
6513db1
Compare
This pull request was exported from Phabricator. Differential Revision: D54901847 |
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Differential Revision: D54901847
Changelog: [General][Changed] - Add
std::span
methods tojsi::Function
when compiled as C++20Adds
std::span<const jsi::Value>
overloads to public JSI methods that currently accept (or are designed to emit)const jsi::Value* args, size_t count
for a dynamically-sized span of function arguments.These are:
Function::call
Function::callWithThis
Function::callAsConstructor
Function::createFromHostFunction
We also add a
HostFunctionTypeWithSpanArgs
typedef (naming feedback welcome!) to serve a similar purpose to the existingHostFunctionType
.Backwards compatibility
inline
wrappers over the pointer+size versions. No change is made to the JSI contract for implementers (i.e. no new overloads, virtual or otherwise, are added toRuntime
).