Skip to content

Commit d263687

Browse files
Satisfy exported symbol requirements
1 parent 6c213c1 commit d263687

File tree

5 files changed

+55
-20
lines changed

5 files changed

+55
-20
lines changed

packages/gems/js/ext/js/bindgen/ext.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ void __wasm_export_exports_ruby_js_ruby_runtime_rstring_ptr_post_return(uint8_t
9292

9393

9494

95-
96-
9795
// Canonical ABI intrinsics
9896

9997
__attribute__((__weak__, __export_name__("cabi_realloc")))
@@ -539,18 +537,6 @@ int32_t __wasm_export_exports_ruby_js_ruby_runtime_rb_set_should_prohibit_rewind
539537
return ret;
540538
}
541539

542-
__attribute__((__export_name__("ruby:js/ruby-runtime#wrap-js-value")))
543-
int32_t __wasm_export_exports_ruby_js_ruby_runtime_wrap_js_value(int32_t arg) {
544-
exports_ruby_js_ruby_runtime_own_rb_abi_value_t ret = exports_ruby_js_ruby_runtime_wrap_js_value((exports_ruby_js_ruby_runtime_own_js_abi_value_t) { arg });
545-
return (ret).__handle;
546-
}
547-
548-
__attribute__((__export_name__("ruby:js/ruby-runtime#to-js-value")))
549-
int32_t __wasm_export_exports_ruby_js_ruby_runtime_to_js_value(int32_t arg) {
550-
exports_ruby_js_ruby_runtime_own_js_abi_value_t ret = exports_ruby_js_ruby_runtime_to_js_value(((exports_ruby_js_ruby_runtime_rb_abi_value_t*) arg));
551-
return (ret).__handle;
552-
}
553-
554540
// Ensure that the *_component_type.o object is linked in
555541

556542
extern void __component_type_object_force_link_ext(void);

packages/gems/js/ext/js/bindgen/ext.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ typedef struct exports_ruby_js_ruby_runtime_list_borrow_rb_abi_value_t {
8383
size_t len;
8484
} exports_ruby_js_ruby_runtime_list_borrow_rb_abi_value_t;
8585

86-
typedef ruby_js_js_runtime_own_js_abi_value_t exports_ruby_js_ruby_runtime_own_js_abi_value_t;
87-
8886
// Imported Functions from `ruby:js/js-runtime`
8987
extern void ruby_js_js_runtime_eval_js(ext_string_t *code, ruby_js_js_runtime_js_abi_result_t *ret);
9088
extern bool ruby_js_js_runtime_is_js(ruby_js_js_runtime_borrow_js_abi_value_t value);
@@ -125,8 +123,6 @@ void exports_ruby_js_ruby_runtime_rb_vm_bugreport(void);
125123
bool exports_ruby_js_ruby_runtime_rb_gc_enable(void);
126124
bool exports_ruby_js_ruby_runtime_rb_gc_disable(void);
127125
bool exports_ruby_js_ruby_runtime_rb_set_should_prohibit_rewind(bool new_value);
128-
exports_ruby_js_ruby_runtime_own_rb_abi_value_t exports_ruby_js_ruby_runtime_wrap_js_value(exports_ruby_js_ruby_runtime_own_js_abi_value_t value);
129-
exports_ruby_js_ruby_runtime_own_js_abi_value_t exports_ruby_js_ruby_runtime_to_js_value(exports_ruby_js_ruby_runtime_borrow_rb_abi_value_t value);
130126

131127
// Helper Functions
132128

Binary file not shown.

packages/gems/js/ext/js/witapi-core.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,56 @@ bool rb_abi_guest_rb_set_should_prohibit_rewind(bool value) {
332332
return old;
333333
}
334334

335+
336+
// Exported Functions from `ruby:js/ruby-runtime`
337+
void exports_ruby_js_ruby_runtime_ruby_show_version(void) {
338+
rb_abi_guest_ruby_show_version();
339+
}
340+
void exports_ruby_js_ruby_runtime_ruby_init(void) {
341+
rb_abi_guest_ruby_init();
342+
}
343+
void exports_ruby_js_ruby_runtime_ruby_sysinit(ext_list_string_t *args) {
344+
rb_abi_guest_ruby_sysinit(args);
345+
}
346+
exports_ruby_js_ruby_runtime_own_rb_iseq_t exports_ruby_js_ruby_runtime_ruby_options(ext_list_string_t *args) {
347+
return rb_abi_guest_ruby_options(args);
348+
}
349+
void exports_ruby_js_ruby_runtime_ruby_script(ext_string_t *name) {
350+
rb_abi_guest_ruby_script(name);
351+
}
352+
void exports_ruby_js_ruby_runtime_ruby_init_loadpath(void) {
353+
rb_abi_guest_ruby_init_loadpath();
354+
}
355+
void exports_ruby_js_ruby_runtime_rb_eval_string_protect(ext_string_t *str, exports_ruby_js_ruby_runtime_tuple2_own_rb_abi_value_s32_t *ret) {
356+
rb_abi_guest_rb_eval_string_protect(str, ret);
357+
}
358+
void exports_ruby_js_ruby_runtime_rb_funcallv_protect(exports_ruby_js_ruby_runtime_borrow_rb_abi_value_t recv, exports_ruby_js_ruby_runtime_rb_id_t mid, exports_ruby_js_ruby_runtime_list_borrow_rb_abi_value_t *args, exports_ruby_js_ruby_runtime_tuple2_own_rb_abi_value_s32_t *ret) {
359+
rb_abi_guest_rb_funcallv_protect(recv, mid, args, ret);
360+
}
361+
exports_ruby_js_ruby_runtime_rb_id_t exports_ruby_js_ruby_runtime_rb_intern(ext_string_t *name) {
362+
return rb_abi_guest_rb_intern(name);
363+
}
364+
exports_ruby_js_ruby_runtime_own_rb_abi_value_t exports_ruby_js_ruby_runtime_rb_errinfo(void) {
365+
return rb_abi_guest_rb_errinfo();
366+
}
367+
void exports_ruby_js_ruby_runtime_rb_clear_errinfo(void) {
368+
rb_abi_guest_rb_clear_errinfo();
369+
}
370+
void exports_ruby_js_ruby_runtime_rstring_ptr(exports_ruby_js_ruby_runtime_borrow_rb_abi_value_t value, ext_string_t *ret) {
371+
rb_abi_guest_rstring_ptr(value, ret);
372+
}
373+
void exports_ruby_js_ruby_runtime_rb_vm_bugreport(void) {
374+
rb_abi_guest_rb_vm_bugreport();
375+
}
376+
bool exports_ruby_js_ruby_runtime_rb_gc_enable(void) {
377+
return rb_abi_guest_rb_gc_enable();
378+
}
379+
bool exports_ruby_js_ruby_runtime_rb_gc_disable(void) {
380+
return rb_abi_guest_rb_gc_disable();
381+
}
382+
bool exports_ruby_js_ruby_runtime_rb_set_should_prohibit_rewind(bool new_value) {
383+
return rb_abi_guest_rb_set_should_prohibit_rewind(new_value);
384+
}
385+
386+
335387
void Init_witapi(void) {}

packages/gems/js/wit/ruby-runtime.wit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface ruby-runtime {
2929
rb-gc-disable: func() -> bool;
3030

3131
rb-set-should-prohibit-rewind: func(new-value: bool) -> bool;
32-
wrap-js-value: func(value: js-abi-value) -> rb-abi-value;
33-
to-js-value: func(value: borrow<rb-abi-value>) -> js-abi-value;
32+
// XXX: Do we really need them?
33+
// wrap-js-value: func(value: js-abi-value) -> rb-abi-value;
34+
// to-js-value: func(value: borrow<rb-abi-value>) -> js-abi-value;
3435
}

0 commit comments

Comments
 (0)