Skip to content

Commit 76c0ba2

Browse files
committed
ffi: add experimental fast FFI call API
Signed-off-by: Paolo Insogna <paolo@cowtech.it> Assisted-By: OpenAI:GPT-5.5 <openai/gpt-5.5>
1 parent d179c7e commit 76c0ba2

20 files changed

Lines changed: 835 additions & 12 deletions

configure.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,12 @@
10591059
default=None,
10601060
help='build without FFI (Foreign Function Interface) support')
10611061

1062+
parser.add_argument('--without-fast-ffi',
1063+
action='store_true',
1064+
dest='without_fast_ffi',
1065+
default=None,
1066+
help='build without fast FFI support')
1067+
10621068
parser.add_argument('--experimental-quic',
10631069
action='store_true',
10641070
dest='experimental_quic',
@@ -2330,6 +2336,7 @@ def bundled_ffi_supported(os_name, target_arch):
23302336

23312337
def configure_ffi(o):
23322338
use_ffi = not options.without_ffi
2339+
use_fast_ffi = False
23332340

23342341
if use_ffi and not options.shared_ffi:
23352342
target_arch = o['variables']['target_arch']
@@ -2341,6 +2348,7 @@ def configure_ffi(o):
23412348
use_ffi = False
23422349

23432350
o['variables']['node_use_ffi'] = b(use_ffi)
2351+
o['variables']['node_use_fast_ffi'] = b(use_fast_ffi)
23442352

23452353
if options.without_ffi:
23462354
if options.shared_ffi:
@@ -2352,6 +2360,9 @@ def configure_ffi(o):
23522360

23532361
configure_library('ffi', o, pkgname='libffi')
23542362

2363+
use_fast_ffi = not options.without_fast_ffi and not options.shared_ffi
2364+
o['variables']['node_use_fast_ffi'] = b(use_fast_ffi)
2365+
23552366
def configure_quic(o):
23562367
o['variables']['node_use_quic'] = b(options.experimental_quic and
23572368
not options.without_ssl)

deps/crates/Cargo.lock

Lines changed: 251 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/crates/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ rust-version = "1.82"
1010
[lib]
1111
crate-type = ["staticlib"]
1212

13+
[features]
14+
fast_ffi = ["dep:cranelift", "dep:cranelift-native", "dep:memmap2"]
15+
1316
[dependencies]
17+
cranelift = { version = "0.116.1", optional = true }
18+
cranelift-native = { version = "0.116.1", optional = true }
1419
# Pin all temporal dependencies to the last version support rustc 1.82
1520
icu_collections = "~2.0.0"
1621
icu_locale_core = "~2.0.0"
1722
icu_provider = "~2.0.0"
23+
memmap2 = { version = "0.9.9", optional = true }
1824
timezone_provider = "=0.1.0"
1925

2026
[dependencies.temporal_capi]

0 commit comments

Comments
 (0)