@tishlang/tish-format 3.12.2 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +1 -0
- package/bin/tish-format +0 -0
- package/crates/tish/Cargo.toml +3 -1
- package/crates/tish/src/cli_help.rs +2 -1
- package/crates/tish/src/main.rs +21 -2
- package/crates/tish_bytecode/src/compiler.rs +6 -8
- package/crates/tish_compile/src/codegen.rs +93 -6
- package/crates/tish_compile/src/lib.rs +4 -0
- package/crates/tish_compile/src/resolve.rs +1 -0
- package/crates/tish_compile/tests/regr_ffi_module_emit.rs +120 -0
- package/crates/tish_core/src/lib.rs +43 -4
- package/crates/tish_cranelift_runtime/Cargo.toml +2 -0
- package/crates/tish_ffi/src/lib.rs +48 -25
- package/crates/tish_ffi/src/v2.rs +349 -0
- package/crates/tish_ffi/tests/fixtures/testmod_v2/Cargo.lock +282 -0
- package/crates/tish_ffi/tests/fixtures/testmod_v2/Cargo.toml +16 -0
- package/crates/tish_ffi/tests/fixtures/testmod_v2/src/lib.rs +111 -0
- package/crates/tish_ffi/tests/loader_v2.rs +159 -0
- package/crates/tish_ffi_guest/Cargo.toml +11 -0
- package/crates/tish_ffi_guest/src/lib.rs +333 -0
- package/crates/tish_fmt/Cargo.toml +1 -1
- package/crates/tish_native/src/build.rs +54 -15
- package/crates/tish_native/src/config.rs +10 -0
- package/crates/tish_native/src/lib.rs +7 -2
- package/crates/tish_runtime/Cargo.toml +4 -0
- package/crates/tish_runtime/src/lib.rs +21 -0
- package/crates/tish_vm/Cargo.toml +2 -0
- package/crates/tish_vm/src/vm.rs +61 -6
- package/crates/tish_vm/tests/ffi_load_module.rs +32 -0
- package/crates/tish_vm/tests/jit_off_leaves_jit_state.rs +24 -0
- package/crates/tish_vm/tests/jsx_lexical_resolution.rs +42 -0
- package/crates/tish_vm/tests/multi_vm_isolation.rs +123 -0
- package/package.json +1 -1
- package/platform/darwin-arm64/tish-fmt +0 -0
- package/platform/darwin-x64/tish-fmt +0 -0
- package/platform/linux-arm64/tish-fmt +0 -0
- package/platform/linux-x64/tish-fmt +0 -0
- package/platform/win32-x64/tish-fmt.exe +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
//! # ABI v2 — host accessors delivered as a function-pointer table
|
|
2
|
+
//!
|
|
3
|
+
//! v1 extensions resolve the host's `tish_value_*` symbols at load time, which needs the host
|
|
4
|
+
//! binary to export them (`-export_dynamic`) and keep them alive under LTO + strip. v2 hands the
|
|
5
|
+
//! module a [`TishHostApi`] table instead: the loader calls
|
|
6
|
+
//! `tish_module_register_v2(api: *const TishHostApi) -> *const TishExportTable`, the module keeps
|
|
7
|
+
//! the pointer, and every host access goes through it. No symbol export, no late binding, and
|
|
8
|
+
//! taking the functions' addresses keeps them alive in any host profile.
|
|
9
|
+
//!
|
|
10
|
+
//! Additions over v1: length-delimited UTF-8 strings (interior NUL allowed), object key
|
|
11
|
+
//! enumeration, array set, function handles in both directions ([`TishHostApi::new_function`] /
|
|
12
|
+
//! [`TishHostApi::call`]), and a throw channel ([`TishHostApi::throw_value`] /
|
|
13
|
+
//! [`TishHostApi::take_throw`]). Packed `NumberArray` values read as arrays.
|
|
14
|
+
//!
|
|
15
|
+
//! Ownership follows v1: handles returned by `new_*` / `*_get` / `object_keys` / `call` /
|
|
16
|
+
//! `take_throw` / `clone` are owned by the caller and released with `drop`; `*_push` / `*_set` /
|
|
17
|
+
//! `throw_value` clone their arguments. [`TishHostApi::string_utf8`] returns a pointer *borrowed*
|
|
18
|
+
//! from the handle, valid until that handle is dropped.
|
|
19
|
+
//!
|
|
20
|
+
//! Evolution: fields are only ever appended. A module checks `abi_version` and `size` before
|
|
21
|
+
//! touching a field newer than the version it was built for.
|
|
22
|
+
|
|
23
|
+
use std::cell::RefCell;
|
|
24
|
+
use std::ffi::c_void;
|
|
25
|
+
use std::sync::Arc;
|
|
26
|
+
|
|
27
|
+
use tishlang_core::{ObjectData, Value, VmRef};
|
|
28
|
+
|
|
29
|
+
use crate::{
|
|
30
|
+
box_value, tish_value_array_new, tish_value_array_push, tish_value_clone, tish_value_drop,
|
|
31
|
+
tish_value_new_bool, tish_value_new_null, tish_value_new_number, tish_value_object_new,
|
|
32
|
+
TishValueRef, TISH_TAG_ARRAY, TISH_TAG_BOOL, TISH_TAG_NULL, TISH_TAG_NUMBER, TISH_TAG_OBJECT,
|
|
33
|
+
TISH_TAG_OTHER, TISH_TAG_STRING,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
pub const TISH_FFI_ABI_VERSION: u32 = 2;
|
|
37
|
+
|
|
38
|
+
/// v2-only tag: a callable value (pass it to [`TishHostApi::call`]). v1's `tag` keeps reporting
|
|
39
|
+
/// functions as `TISH_TAG_OTHER`.
|
|
40
|
+
pub const TISH_TAG_FUNCTION: i32 = 7;
|
|
41
|
+
|
|
42
|
+
/// A foreign callback wrapped by [`TishHostApi::new_function`]: borrowed argument handles in,
|
|
43
|
+
/// freshly-owned result handle out (same contract as `TishNativeFn`, plus a context pointer).
|
|
44
|
+
pub type TishCallbackFn =
|
|
45
|
+
extern "C" fn(ctx: *mut c_void, args: *const TishValueRef, argc: usize) -> TishValueRef;
|
|
46
|
+
|
|
47
|
+
/// Releases a callback context when the last reference to the wrapping function value drops.
|
|
48
|
+
pub type TishCtxDropFn = extern "C" fn(ctx: *mut c_void);
|
|
49
|
+
|
|
50
|
+
/// The host API table. `#[repr(C)]`; fields are append-only across versions.
|
|
51
|
+
#[repr(C)]
|
|
52
|
+
pub struct TishHostApi {
|
|
53
|
+
pub abi_version: u32,
|
|
54
|
+
/// `size_of::<TishHostApi>()` as built by the host.
|
|
55
|
+
pub size: usize,
|
|
56
|
+
|
|
57
|
+
pub new_null: extern "C" fn() -> TishValueRef,
|
|
58
|
+
pub new_number: extern "C" fn(n: f64) -> TishValueRef,
|
|
59
|
+
pub new_bool: extern "C" fn(b: bool) -> TishValueRef,
|
|
60
|
+
pub new_string_utf8: unsafe extern "C" fn(ptr: *const u8, len: usize) -> TishValueRef,
|
|
61
|
+
|
|
62
|
+
/// `TISH_TAG_*`, with arrays covering `NumberArray` and [`TISH_TAG_FUNCTION`] for callables.
|
|
63
|
+
pub tag: unsafe extern "C" fn(r: TishValueRef) -> i32,
|
|
64
|
+
pub as_number: unsafe extern "C" fn(r: TishValueRef) -> f64,
|
|
65
|
+
pub as_bool: unsafe extern "C" fn(r: TishValueRef) -> bool,
|
|
66
|
+
/// Borrowed UTF-8 bytes of a string handle (null if not a string); `*len` receives the length.
|
|
67
|
+
pub string_utf8: unsafe extern "C" fn(r: TishValueRef, len: *mut usize) -> *const u8,
|
|
68
|
+
|
|
69
|
+
pub array_new: extern "C" fn() -> TishValueRef,
|
|
70
|
+
pub array_push: unsafe extern "C" fn(arr: TishValueRef, elem: TishValueRef),
|
|
71
|
+
pub array_len: unsafe extern "C" fn(arr: TishValueRef) -> usize,
|
|
72
|
+
pub array_get: unsafe extern "C" fn(arr: TishValueRef, i: usize) -> TishValueRef,
|
|
73
|
+
/// Sets element `i`, padding with null when `i >= len`.
|
|
74
|
+
pub array_set: unsafe extern "C" fn(arr: TishValueRef, i: usize, elem: TishValueRef),
|
|
75
|
+
|
|
76
|
+
pub object_new: extern "C" fn() -> TishValueRef,
|
|
77
|
+
pub object_set_utf8:
|
|
78
|
+
unsafe extern "C" fn(obj: TishValueRef, key: *const u8, key_len: usize, val: TishValueRef),
|
|
79
|
+
pub object_get_utf8:
|
|
80
|
+
unsafe extern "C" fn(obj: TishValueRef, key: *const u8, key_len: usize) -> TishValueRef,
|
|
81
|
+
/// Array of the object's own string keys, in insertion order.
|
|
82
|
+
pub object_keys: unsafe extern "C" fn(obj: TishValueRef) -> TishValueRef,
|
|
83
|
+
|
|
84
|
+
/// Wrap a foreign callback as a host function value. `drop_ctx` (nullable) runs once when the
|
|
85
|
+
/// function value is released.
|
|
86
|
+
pub new_function: unsafe extern "C" fn(
|
|
87
|
+
func: TishCallbackFn,
|
|
88
|
+
ctx: *mut c_void,
|
|
89
|
+
drop_ctx: Option<TishCtxDropFn>,
|
|
90
|
+
) -> TishValueRef,
|
|
91
|
+
/// Call a function handle. If it throws, returns a null handle and parks the thrown value for
|
|
92
|
+
/// [`TishHostApi::take_throw`] on this thread.
|
|
93
|
+
pub call:
|
|
94
|
+
unsafe extern "C" fn(f: TishValueRef, args: *const TishValueRef, argc: usize) -> TishValueRef,
|
|
95
|
+
/// Raise `val` in the host when the current native call returns.
|
|
96
|
+
pub throw_value: unsafe extern "C" fn(val: TishValueRef),
|
|
97
|
+
/// The value thrown by the last failing [`TishHostApi::call`] on this thread, or a null
|
|
98
|
+
/// pointer if none. Clears it.
|
|
99
|
+
pub take_throw: extern "C" fn() -> TishValueRef,
|
|
100
|
+
|
|
101
|
+
pub clone: unsafe extern "C" fn(r: TishValueRef) -> TishValueRef,
|
|
102
|
+
pub drop: unsafe extern "C" fn(r: TishValueRef),
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/// The host's table, handed to every v2 module the loader registers.
|
|
106
|
+
pub static TISH_HOST_API: TishHostApi = TishHostApi {
|
|
107
|
+
abi_version: TISH_FFI_ABI_VERSION,
|
|
108
|
+
size: std::mem::size_of::<TishHostApi>(),
|
|
109
|
+
new_null: tish_value_new_null,
|
|
110
|
+
new_number: tish_value_new_number,
|
|
111
|
+
new_bool: tish_value_new_bool,
|
|
112
|
+
new_string_utf8: v2_new_string_utf8,
|
|
113
|
+
tag: v2_tag,
|
|
114
|
+
as_number: v2_as_number,
|
|
115
|
+
as_bool: v2_as_bool,
|
|
116
|
+
string_utf8: v2_string_utf8,
|
|
117
|
+
array_new: tish_value_array_new,
|
|
118
|
+
array_push: tish_value_array_push,
|
|
119
|
+
array_len: v2_array_len,
|
|
120
|
+
array_get: v2_array_get,
|
|
121
|
+
array_set: v2_array_set,
|
|
122
|
+
object_new: tish_value_object_new,
|
|
123
|
+
object_set_utf8: v2_object_set_utf8,
|
|
124
|
+
object_get_utf8: v2_object_get_utf8,
|
|
125
|
+
object_keys: v2_object_keys,
|
|
126
|
+
new_function: v2_new_function,
|
|
127
|
+
call: v2_call,
|
|
128
|
+
throw_value: v2_throw_value,
|
|
129
|
+
take_throw: v2_take_throw,
|
|
130
|
+
clone: tish_value_clone,
|
|
131
|
+
drop: tish_value_drop,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
thread_local! {
|
|
135
|
+
static LAST_CALL_THROW: RefCell<Option<Value>> = const { RefCell::new(None) };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
#[inline]
|
|
139
|
+
unsafe fn val<'a>(r: TishValueRef) -> Option<&'a Value> {
|
|
140
|
+
(r as *const Value).as_ref()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
#[inline]
|
|
144
|
+
unsafe fn utf8<'a>(ptr: *const u8, len: usize) -> Option<&'a str> {
|
|
145
|
+
if ptr.is_null() {
|
|
146
|
+
return if len == 0 { Some("") } else { None };
|
|
147
|
+
}
|
|
148
|
+
std::str::from_utf8(std::slice::from_raw_parts(ptr, len)).ok()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
fn object_of(v: &Value) -> Option<VmRef<ObjectData>> {
|
|
152
|
+
match v {
|
|
153
|
+
Value::Object(o) => Some(o.clone()),
|
|
154
|
+
_ => None,
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
unsafe extern "C" fn v2_new_string_utf8(ptr: *const u8, len: usize) -> TishValueRef {
|
|
159
|
+
match utf8(ptr, len) {
|
|
160
|
+
Some(s) => box_value(Value::String(s.into())),
|
|
161
|
+
None => box_value(Value::Null),
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
unsafe extern "C" fn v2_tag(r: TishValueRef) -> i32 {
|
|
166
|
+
match val(r) {
|
|
167
|
+
None | Some(Value::Null) => TISH_TAG_NULL,
|
|
168
|
+
Some(Value::Number(_)) => TISH_TAG_NUMBER,
|
|
169
|
+
Some(Value::String(_)) => TISH_TAG_STRING,
|
|
170
|
+
Some(Value::Bool(_)) => TISH_TAG_BOOL,
|
|
171
|
+
Some(Value::Array(_)) | Some(Value::NumberArray(_)) => TISH_TAG_ARRAY,
|
|
172
|
+
Some(Value::Object(_)) => TISH_TAG_OBJECT,
|
|
173
|
+
Some(Value::Function(_)) => TISH_TAG_FUNCTION,
|
|
174
|
+
Some(_) => TISH_TAG_OTHER,
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
unsafe extern "C" fn v2_as_number(r: TishValueRef) -> f64 {
|
|
179
|
+
match val(r) {
|
|
180
|
+
Some(Value::Number(n)) => *n,
|
|
181
|
+
_ => f64::NAN,
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
unsafe extern "C" fn v2_as_bool(r: TishValueRef) -> bool {
|
|
186
|
+
matches!(val(r), Some(Value::Bool(true)))
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
unsafe extern "C" fn v2_string_utf8(r: TishValueRef, len: *mut usize) -> *const u8 {
|
|
190
|
+
let (ptr, n) = match val(r) {
|
|
191
|
+
Some(Value::String(s)) => (s.as_bytes().as_ptr(), s.as_bytes().len()),
|
|
192
|
+
_ => (std::ptr::null(), 0),
|
|
193
|
+
};
|
|
194
|
+
if !len.is_null() {
|
|
195
|
+
*len = n;
|
|
196
|
+
}
|
|
197
|
+
ptr
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
unsafe extern "C" fn v2_array_len(arr: TishValueRef) -> usize {
|
|
201
|
+
match val(arr) {
|
|
202
|
+
Some(Value::Array(a)) => a.borrow().len(),
|
|
203
|
+
Some(Value::NumberArray(a)) => a.borrow().len(),
|
|
204
|
+
_ => 0,
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
unsafe extern "C" fn v2_array_get(arr: TishValueRef, i: usize) -> TishValueRef {
|
|
209
|
+
let v = match val(arr) {
|
|
210
|
+
Some(Value::Array(a)) => a.borrow().get(i).cloned(),
|
|
211
|
+
Some(Value::NumberArray(a)) => a.borrow().get(i),
|
|
212
|
+
_ => None,
|
|
213
|
+
};
|
|
214
|
+
box_value(v.unwrap_or(Value::Null))
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
unsafe extern "C" fn v2_array_set(arr: TishValueRef, i: usize, elem: TishValueRef) {
|
|
218
|
+
let v = val(elem).cloned().unwrap_or(Value::Null);
|
|
219
|
+
match val(arr) {
|
|
220
|
+
Some(Value::Array(a)) => {
|
|
221
|
+
let mut a = a.borrow_mut();
|
|
222
|
+
if i >= a.len() {
|
|
223
|
+
a.resize(i + 1, Value::Null);
|
|
224
|
+
}
|
|
225
|
+
a[i] = v;
|
|
226
|
+
}
|
|
227
|
+
Some(Value::NumberArray(a)) => {
|
|
228
|
+
let mut a = a.borrow_mut();
|
|
229
|
+
let mut vals = a.to_values();
|
|
230
|
+
if i >= vals.len() {
|
|
231
|
+
vals.resize(i + 1, Value::Null);
|
|
232
|
+
}
|
|
233
|
+
vals[i] = v;
|
|
234
|
+
*a = tishlang_core::NumArrayBacking::Boxed(vals);
|
|
235
|
+
}
|
|
236
|
+
_ => {}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
unsafe extern "C" fn v2_object_set_utf8(
|
|
241
|
+
obj: TishValueRef,
|
|
242
|
+
key: *const u8,
|
|
243
|
+
key_len: usize,
|
|
244
|
+
v: TishValueRef,
|
|
245
|
+
) {
|
|
246
|
+
if let (Some(Value::Object(o)), Some(k)) = (val(obj), utf8(key, key_len)) {
|
|
247
|
+
let v = val(v).cloned().unwrap_or(Value::Null);
|
|
248
|
+
o.borrow_mut().strings.insert(k.into(), v);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
unsafe extern "C" fn v2_object_get_utf8(
|
|
253
|
+
obj: TishValueRef,
|
|
254
|
+
key: *const u8,
|
|
255
|
+
key_len: usize,
|
|
256
|
+
) -> TishValueRef {
|
|
257
|
+
let got = match (val(obj).and_then(object_of), utf8(key, key_len)) {
|
|
258
|
+
(Some(o), Some(k)) => o.borrow().strings.get(k).cloned(),
|
|
259
|
+
_ => None,
|
|
260
|
+
};
|
|
261
|
+
box_value(got.unwrap_or(Value::Null))
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
unsafe extern "C" fn v2_object_keys(obj: TishValueRef) -> TishValueRef {
|
|
265
|
+
let keys: Vec<Value> = match val(obj).and_then(object_of) {
|
|
266
|
+
Some(o) => o
|
|
267
|
+
.borrow()
|
|
268
|
+
.strings
|
|
269
|
+
.keys()
|
|
270
|
+
.map(|k| Value::String(k.as_ref().into()))
|
|
271
|
+
.collect(),
|
|
272
|
+
None => Vec::new(),
|
|
273
|
+
};
|
|
274
|
+
box_value(Value::Array(VmRef::new(keys)))
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/// A foreign callback + context, owned by the function value wrapping it.
|
|
278
|
+
struct ForeignCallback {
|
|
279
|
+
func: TishCallbackFn,
|
|
280
|
+
ctx: *mut c_void,
|
|
281
|
+
drop_ctx: Option<TishCtxDropFn>,
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// SAFETY: the context is opaque to the host; the module that created it owns its thread-safety
|
|
285
|
+
// (the documented contract is that callbacks are invoked on the thread that calls them).
|
|
286
|
+
unsafe impl Send for ForeignCallback {}
|
|
287
|
+
unsafe impl Sync for ForeignCallback {}
|
|
288
|
+
|
|
289
|
+
impl Drop for ForeignCallback {
|
|
290
|
+
fn drop(&mut self) {
|
|
291
|
+
if let Some(d) = self.drop_ctx {
|
|
292
|
+
d(self.ctx);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
unsafe extern "C" fn v2_new_function(
|
|
298
|
+
func: TishCallbackFn,
|
|
299
|
+
ctx: *mut c_void,
|
|
300
|
+
drop_ctx: Option<TishCtxDropFn>,
|
|
301
|
+
) -> TishValueRef {
|
|
302
|
+
let cb = Arc::new(ForeignCallback {
|
|
303
|
+
func,
|
|
304
|
+
ctx,
|
|
305
|
+
drop_ctx,
|
|
306
|
+
});
|
|
307
|
+
box_value(Value::native(move |args: &[Value]| {
|
|
308
|
+
let cb = &cb;
|
|
309
|
+
crate::call_through_handles(args, |argv, argc| (cb.func)(cb.ctx, argv, argc))
|
|
310
|
+
}))
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
unsafe extern "C" fn v2_call(
|
|
314
|
+
f: TishValueRef,
|
|
315
|
+
args: *const TishValueRef,
|
|
316
|
+
argc: usize,
|
|
317
|
+
) -> TishValueRef {
|
|
318
|
+
let Some(Value::Function(func)) = val(f) else {
|
|
319
|
+
LAST_CALL_THROW.with(|t| {
|
|
320
|
+
*t.borrow_mut() = Some(Value::String("ffi: call of non-function".into()))
|
|
321
|
+
});
|
|
322
|
+
return box_value(Value::Null);
|
|
323
|
+
};
|
|
324
|
+
let argv: Vec<Value> = if args.is_null() {
|
|
325
|
+
Vec::new()
|
|
326
|
+
} else {
|
|
327
|
+
std::slice::from_raw_parts(args, argc)
|
|
328
|
+
.iter()
|
|
329
|
+
.map(|h| val(*h).cloned().unwrap_or(Value::Null))
|
|
330
|
+
.collect()
|
|
331
|
+
};
|
|
332
|
+
let out = func.call(&argv);
|
|
333
|
+
if let Some(thrown) = tishlang_core::take_pending_throw() {
|
|
334
|
+
LAST_CALL_THROW.with(|t| *t.borrow_mut() = Some(thrown));
|
|
335
|
+
return box_value(Value::Null);
|
|
336
|
+
}
|
|
337
|
+
box_value(out)
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
unsafe extern "C" fn v2_throw_value(v: TishValueRef) {
|
|
341
|
+
tishlang_core::set_pending_throw(val(v).cloned().unwrap_or(Value::Null));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
extern "C" fn v2_take_throw() -> TishValueRef {
|
|
345
|
+
match LAST_CALL_THROW.with(|t| t.borrow_mut().take()) {
|
|
346
|
+
Some(v) => box_value(v),
|
|
347
|
+
None => std::ptr::null_mut(),
|
|
348
|
+
}
|
|
349
|
+
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "ahash"
|
|
7
|
+
version = "0.8.12"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"cfg-if",
|
|
12
|
+
"getrandom",
|
|
13
|
+
"once_cell",
|
|
14
|
+
"version_check",
|
|
15
|
+
"zerocopy",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[[package]]
|
|
19
|
+
name = "arcstr"
|
|
20
|
+
version = "1.2.0"
|
|
21
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
22
|
+
checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d"
|
|
23
|
+
|
|
24
|
+
[[package]]
|
|
25
|
+
name = "bumpalo"
|
|
26
|
+
version = "3.20.3"
|
|
27
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
28
|
+
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
|
|
29
|
+
|
|
30
|
+
[[package]]
|
|
31
|
+
name = "cfg-if"
|
|
32
|
+
version = "1.0.5"
|
|
33
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
+
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
|
35
|
+
|
|
36
|
+
[[package]]
|
|
37
|
+
name = "equivalent"
|
|
38
|
+
version = "1.0.2"
|
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
|
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "getrandom"
|
|
44
|
+
version = "0.3.4"
|
|
45
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
46
|
+
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
|
|
47
|
+
dependencies = [
|
|
48
|
+
"cfg-if",
|
|
49
|
+
"js-sys",
|
|
50
|
+
"libc",
|
|
51
|
+
"r-efi",
|
|
52
|
+
"wasip2",
|
|
53
|
+
"wasm-bindgen",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[[package]]
|
|
57
|
+
name = "hashbrown"
|
|
58
|
+
version = "0.17.1"
|
|
59
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
60
|
+
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
|
61
|
+
|
|
62
|
+
[[package]]
|
|
63
|
+
name = "indexmap"
|
|
64
|
+
version = "2.14.2"
|
|
65
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
+
checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
|
|
67
|
+
dependencies = [
|
|
68
|
+
"equivalent",
|
|
69
|
+
"hashbrown",
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[[package]]
|
|
73
|
+
name = "itoa"
|
|
74
|
+
version = "1.0.18"
|
|
75
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
76
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
77
|
+
|
|
78
|
+
[[package]]
|
|
79
|
+
name = "js-sys"
|
|
80
|
+
version = "0.3.106"
|
|
81
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
82
|
+
checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
|
|
83
|
+
dependencies = [
|
|
84
|
+
"cfg-if",
|
|
85
|
+
"wasm-bindgen",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[[package]]
|
|
89
|
+
name = "libc"
|
|
90
|
+
version = "0.2.190"
|
|
91
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
92
|
+
checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78"
|
|
93
|
+
|
|
94
|
+
[[package]]
|
|
95
|
+
name = "once_cell"
|
|
96
|
+
version = "1.21.4"
|
|
97
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
98
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
99
|
+
|
|
100
|
+
[[package]]
|
|
101
|
+
name = "proc-macro2"
|
|
102
|
+
version = "1.0.107"
|
|
103
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
104
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
105
|
+
dependencies = [
|
|
106
|
+
"unicode-ident",
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
[[package]]
|
|
110
|
+
name = "quote"
|
|
111
|
+
version = "1.0.47"
|
|
112
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
113
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
114
|
+
dependencies = [
|
|
115
|
+
"proc-macro2",
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
[[package]]
|
|
119
|
+
name = "r-efi"
|
|
120
|
+
version = "5.3.0"
|
|
121
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
122
|
+
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
|
123
|
+
|
|
124
|
+
[[package]]
|
|
125
|
+
name = "rustversion"
|
|
126
|
+
version = "1.0.23"
|
|
127
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
128
|
+
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|
129
|
+
|
|
130
|
+
[[package]]
|
|
131
|
+
name = "ryu"
|
|
132
|
+
version = "1.0.23"
|
|
133
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
134
|
+
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
|
135
|
+
|
|
136
|
+
[[package]]
|
|
137
|
+
name = "smallvec"
|
|
138
|
+
version = "1.16.2"
|
|
139
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
140
|
+
checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e"
|
|
141
|
+
|
|
142
|
+
[[package]]
|
|
143
|
+
name = "syn"
|
|
144
|
+
version = "2.0.119"
|
|
145
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
146
|
+
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
|
147
|
+
dependencies = [
|
|
148
|
+
"proc-macro2",
|
|
149
|
+
"quote",
|
|
150
|
+
"unicode-ident",
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
[[package]]
|
|
154
|
+
name = "syn"
|
|
155
|
+
version = "3.0.6"
|
|
156
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
157
|
+
checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
|
|
158
|
+
dependencies = [
|
|
159
|
+
"proc-macro2",
|
|
160
|
+
"quote",
|
|
161
|
+
"unicode-ident",
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
[[package]]
|
|
165
|
+
name = "tish_ffi_testmod_v2"
|
|
166
|
+
version = "0.0.0"
|
|
167
|
+
dependencies = [
|
|
168
|
+
"tishlang_core",
|
|
169
|
+
"tishlang_ffi_guest",
|
|
170
|
+
]
|
|
171
|
+
|
|
172
|
+
[[package]]
|
|
173
|
+
name = "tishlang_core"
|
|
174
|
+
version = "0.1.0"
|
|
175
|
+
dependencies = [
|
|
176
|
+
"ahash",
|
|
177
|
+
"arcstr",
|
|
178
|
+
"getrandom",
|
|
179
|
+
"indexmap",
|
|
180
|
+
"itoa",
|
|
181
|
+
"ryu",
|
|
182
|
+
"smallvec",
|
|
183
|
+
]
|
|
184
|
+
|
|
185
|
+
[[package]]
|
|
186
|
+
name = "tishlang_ffi_guest"
|
|
187
|
+
version = "0.1.0"
|
|
188
|
+
dependencies = [
|
|
189
|
+
"tishlang_core",
|
|
190
|
+
]
|
|
191
|
+
|
|
192
|
+
[[package]]
|
|
193
|
+
name = "unicode-ident"
|
|
194
|
+
version = "1.0.26"
|
|
195
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
196
|
+
checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
|
|
197
|
+
|
|
198
|
+
[[package]]
|
|
199
|
+
name = "version_check"
|
|
200
|
+
version = "0.9.5"
|
|
201
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
202
|
+
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
|
203
|
+
|
|
204
|
+
[[package]]
|
|
205
|
+
name = "wasip2"
|
|
206
|
+
version = "1.0.4+wasi-0.2.12"
|
|
207
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
208
|
+
checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
|
|
209
|
+
dependencies = [
|
|
210
|
+
"wit-bindgen",
|
|
211
|
+
]
|
|
212
|
+
|
|
213
|
+
[[package]]
|
|
214
|
+
name = "wasm-bindgen"
|
|
215
|
+
version = "0.2.129"
|
|
216
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
217
|
+
checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
|
|
218
|
+
dependencies = [
|
|
219
|
+
"cfg-if",
|
|
220
|
+
"once_cell",
|
|
221
|
+
"rustversion",
|
|
222
|
+
"wasm-bindgen-macro",
|
|
223
|
+
"wasm-bindgen-shared",
|
|
224
|
+
]
|
|
225
|
+
|
|
226
|
+
[[package]]
|
|
227
|
+
name = "wasm-bindgen-macro"
|
|
228
|
+
version = "0.2.129"
|
|
229
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
230
|
+
checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535"
|
|
231
|
+
dependencies = [
|
|
232
|
+
"quote",
|
|
233
|
+
"wasm-bindgen-macro-support",
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
[[package]]
|
|
237
|
+
name = "wasm-bindgen-macro-support"
|
|
238
|
+
version = "0.2.129"
|
|
239
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
240
|
+
checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7"
|
|
241
|
+
dependencies = [
|
|
242
|
+
"bumpalo",
|
|
243
|
+
"proc-macro2",
|
|
244
|
+
"quote",
|
|
245
|
+
"syn 3.0.6",
|
|
246
|
+
"wasm-bindgen-shared",
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
[[package]]
|
|
250
|
+
name = "wasm-bindgen-shared"
|
|
251
|
+
version = "0.2.129"
|
|
252
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
253
|
+
checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6"
|
|
254
|
+
dependencies = [
|
|
255
|
+
"unicode-ident",
|
|
256
|
+
]
|
|
257
|
+
|
|
258
|
+
[[package]]
|
|
259
|
+
name = "wit-bindgen"
|
|
260
|
+
version = "0.57.1"
|
|
261
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
262
|
+
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
|
|
263
|
+
|
|
264
|
+
[[package]]
|
|
265
|
+
name = "zerocopy"
|
|
266
|
+
version = "0.8.59"
|
|
267
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
268
|
+
checksum = "6df92bf3d9227be3d53173901ddbffac2babc27ae50f397776ffd6dc33f800cb"
|
|
269
|
+
dependencies = [
|
|
270
|
+
"zerocopy-derive",
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "zerocopy-derive"
|
|
275
|
+
version = "0.8.59"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "ac4f328cf2f05d084e496c3e9c3f33ed0a183656a16e1fcec4d464d8373aec82"
|
|
278
|
+
dependencies = [
|
|
279
|
+
"proc-macro2",
|
|
280
|
+
"quote",
|
|
281
|
+
"syn 2.0.119",
|
|
282
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# ABI v2 fixture: links only `tishlang_ffi_guest` (its own tishlang_core copy, no host symbols) and
|
|
2
|
+
# exports `tish_module_register_v2`. Standalone workspace so the main workspace ignores it.
|
|
3
|
+
[package]
|
|
4
|
+
name = "tish_ffi_testmod_v2"
|
|
5
|
+
version = "0.0.0"
|
|
6
|
+
edition = "2021"
|
|
7
|
+
publish = false
|
|
8
|
+
|
|
9
|
+
[workspace]
|
|
10
|
+
|
|
11
|
+
[lib]
|
|
12
|
+
crate-type = ["cdylib"]
|
|
13
|
+
|
|
14
|
+
[dependencies]
|
|
15
|
+
tishlang_ffi_guest = { path = "../../../../tish_ffi_guest" }
|
|
16
|
+
tishlang_core = { path = "../../../../tish_core" }
|