Skip to content

Commit a1ada77

Browse files
gahaasV8 LUCI CQ
authored andcommitted
[fast-api] Deprecate fallback flag in FastApiCallbackOptions struct
The fallback mechanism of fast API calls is not needed anymore as it is possible for the fast API call target to throw exceptions, trigger GC, and call back to JavaScript as well. Therefore the fallback flag in the FastApiCallbackOptions struct gets deprecated. Bug: 41492790 Change-Id: I51ac88309586abf92768ac55b1e315dfd7485160 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5600538 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Andreas Haas <ahaas@chromium.org> Cr-Commit-Position: refs/heads/main@{#94315}
1 parent f5206af commit a1ada77

12 files changed

Lines changed: 293 additions & 455 deletions

include/v8-fast-api-calls.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ struct FastApiCallbackOptions {
577577
* returned instance may be filled with mock data.
578578
*/
579579
static FastApiCallbackOptions CreateForTesting(Isolate* isolate) {
580-
return {false, {0}, nullptr};
580+
return {};
581581
}
582582

583583
/**
@@ -591,16 +591,16 @@ struct FastApiCallbackOptions {
591591
* fallback conditions are checked, because otherwise executing the slow
592592
* callback might produce visible side-effects twice.
593593
*/
594-
bool fallback;
594+
V8_DEPRECATE_SOON(
595+
"It is not necessary to use the `fallback` flag anymore, as it is "
596+
"possible now to trigger GC, throw exceptions, and call back into "
597+
"JavaScript even in API functions called with a fast API call.")
598+
bool fallback = false;
595599

596600
/**
597601
* The `data` passed to the FunctionTemplate constructor, or `undefined`.
598-
* `data_ptr` allows for default constructing FastApiCallbackOptions.
599602
*/
600-
union {
601-
uintptr_t data_ptr;
602-
v8::Local<v8::Value> data;
603-
};
603+
v8::Local<v8::Value> data;
604604

605605
/**
606606
* When called from WebAssembly, a view of the calling module's memory.

0 commit comments

Comments
 (0)