Skip to content

Commit

Permalink
Runtime: adapt runtime for 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Feb 9, 2024
1 parent 65f8d81 commit 7d45f04
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 46 deletions.
12 changes: 6 additions & 6 deletions compiler/tests-check-prim/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime %{dep:main.bc}))))
(run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:main.bc}))))

(rule
(targets unix-unix.output)
Expand All @@ -36,7 +36,7 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc}))))
(run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc}))))

(rule
(targets unix-win32.output)
Expand All @@ -49,7 +49,7 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc}))))
(run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc}))))

(rule
(targets main.output5)
Expand All @@ -60,7 +60,7 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime %{dep:main.bc}))))
(run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:main.bc}))))

(rule
(targets unix-unix.output5)
Expand All @@ -73,7 +73,7 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc}))))
(run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc}))))

(rule
(targets unix-win32.output5)
Expand All @@ -86,4 +86,4 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc}))))
(run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc}))))
22 changes: 12 additions & 10 deletions compiler/tests-check-prim/main.output
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ caml_dynlink_close_lib
caml_dynlink_get_current_libs
caml_dynlink_lookup_symbol
caml_dynlink_open_lib
caml_get_current_environment
caml_get_section_table
caml_int64_add_native
caml_int64_and_native
caml_int64_div_native
Expand All @@ -20,13 +18,8 @@ caml_int64_or_native
caml_int64_sub_native
caml_int64_xor_native
caml_int_as_pointer
caml_invoke_traced_function
caml_realloc_global
caml_reify_bytecode
caml_reset_afl_instrumentation
caml_signbit
caml_static_release_bytecode
caml_terminfo_rows
debugger
is_digit_normalized

Expand Down Expand Up @@ -188,12 +181,12 @@ caml_lxm_next

From +runtime_events.js:
caml_custom_event_index
caml_ml_runtime_events_pause
caml_ml_runtime_events_resume
caml_ml_runtime_events_start
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_pause
caml_runtime_events_read_poll
caml_runtime_events_resume
caml_runtime_events_start
caml_runtime_events_user_register
caml_runtime_events_user_resolve
caml_runtime_events_user_write
Expand Down Expand Up @@ -230,6 +223,15 @@ caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_is_regular_file

From +toplevel.js:
caml_dynlink_get_bytecode_sections
caml_static_alloc
caml_static_free
caml_terminfo_backup
caml_terminfo_resume
caml_terminfo_setup
caml_terminfo_standout

From +unix.js:
caml_unix_cleanup
caml_unix_closedir
Expand Down
19 changes: 12 additions & 7 deletions compiler/tests-check-prim/main.output5
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ caml_dynlink_close_lib
caml_dynlink_get_current_libs
caml_dynlink_lookup_symbol
caml_dynlink_open_lib
caml_get_current_environment
caml_get_section_table
caml_int64_add_native
caml_int64_and_native
caml_int64_div_native
Expand All @@ -22,13 +20,8 @@ caml_int64_or_native
caml_int64_sub_native
caml_int64_xor_native
caml_int_as_pointer
caml_invoke_traced_function
caml_realloc_global
caml_reify_bytecode
caml_reset_afl_instrumentation
caml_signbit
caml_static_release_bytecode
caml_terminfo_rows
debugger
is_digit_normalized

Expand Down Expand Up @@ -161,6 +154,9 @@ caml_obj_set_tag
caml_obj_truncate

From +runtime_events.js:
caml_ml_runtime_events_pause
caml_ml_runtime_events_resume
caml_ml_runtime_events_start
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_read_poll
Expand Down Expand Up @@ -190,6 +186,15 @@ caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_const_naked_pointers_checked

From +toplevel.js:
caml_dynlink_get_bytecode_sections
caml_static_alloc
caml_static_free
caml_terminfo_backup
caml_terminfo_resume
caml_terminfo_setup
caml_terminfo_standout

From +unix.js:
caml_unix_cleanup
caml_unix_closedir
Expand Down
22 changes: 12 additions & 10 deletions compiler/tests-check-prim/unix-unix.output
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ caml_dynlink_close_lib
caml_dynlink_get_current_libs
caml_dynlink_lookup_symbol
caml_dynlink_open_lib
caml_get_current_environment
caml_get_section_table
caml_int64_add_native
caml_int64_and_native
caml_int64_div_native
Expand All @@ -20,13 +18,8 @@ caml_int64_or_native
caml_int64_sub_native
caml_int64_xor_native
caml_int_as_pointer
caml_invoke_traced_function
caml_realloc_global
caml_reify_bytecode
caml_reset_afl_instrumentation
caml_signbit
caml_static_release_bytecode
caml_terminfo_rows
caml_unix_map_file_bytecode
debugger
is_digit_normalized
Expand Down Expand Up @@ -297,12 +290,12 @@ caml_lxm_next

From +runtime_events.js:
caml_custom_event_index
caml_ml_runtime_events_pause
caml_ml_runtime_events_resume
caml_ml_runtime_events_start
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_pause
caml_runtime_events_read_poll
caml_runtime_events_resume
caml_runtime_events_start
caml_runtime_events_user_register
caml_runtime_events_user_resolve
caml_runtime_events_user_write
Expand Down Expand Up @@ -339,6 +332,15 @@ caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_is_regular_file

From +toplevel.js:
caml_dynlink_get_bytecode_sections
caml_static_alloc
caml_static_free
caml_terminfo_backup
caml_terminfo_resume
caml_terminfo_setup
caml_terminfo_standout

From +unix.js:
caml_unix_cleanup
caml_unix_closedir
Expand Down
19 changes: 12 additions & 7 deletions compiler/tests-check-prim/unix-unix.output5
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ caml_dynlink_close_lib
caml_dynlink_get_current_libs
caml_dynlink_lookup_symbol
caml_dynlink_open_lib
caml_get_current_environment
caml_get_section_table
caml_int64_add_native
caml_int64_and_native
caml_int64_div_native
Expand All @@ -22,13 +20,8 @@ caml_int64_or_native
caml_int64_sub_native
caml_int64_xor_native
caml_int_as_pointer
caml_invoke_traced_function
caml_realloc_global
caml_reify_bytecode
caml_reset_afl_instrumentation
caml_signbit
caml_static_release_bytecode
caml_terminfo_rows
caml_unix_accept
caml_unix_access
caml_unix_alarm
Expand Down Expand Up @@ -270,6 +263,9 @@ caml_obj_set_tag
caml_obj_truncate

From +runtime_events.js:
caml_ml_runtime_events_pause
caml_ml_runtime_events_resume
caml_ml_runtime_events_start
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_read_poll
Expand Down Expand Up @@ -299,6 +295,15 @@ caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_const_naked_pointers_checked

From +toplevel.js:
caml_dynlink_get_bytecode_sections
caml_static_alloc
caml_static_free
caml_terminfo_backup
caml_terminfo_resume
caml_terminfo_setup
caml_terminfo_standout

From +unix.js:
caml_unix_cleanup
caml_unix_filedescr_of_fd
Expand Down
1 change: 1 addition & 0 deletions runtime/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function caml_atomic_make_contended(a) {
}

//Provides: caml_ml_domain_unique_token
//Version: < 5.2
var caml_ml_domain_unique_token_ = [0]
function caml_ml_domain_unique_token(unit) {
return caml_ml_domain_unique_token_
Expand Down
15 changes: 9 additions & 6 deletions runtime/runtime_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ function caml_runtime_events_user_resolve() {
return 0;
}

//Provides: caml_runtime_events_start
function caml_runtime_events_start() {
//Provides: caml_ml_runtime_events_start
//Alias: caml_runtime_events_start
function caml_ml_runtime_events_start() {
return 0;
}

//Provides: caml_runtime_events_pause
function caml_runtime_events_pause() {
//Provides: caml_ml_runtime_events_pause
//Alias: caml_runtime_events_pause
function caml_ml_runtime_events_pause() {
return 0;
}

//Provides: caml_runtime_events_resume
function caml_runtime_events_resume() {
//Provides: caml_ml_runtime_events_resume
//Alias: caml_runtime_events_resume
function caml_ml_runtime_events_resume() {
return 0;
}

Expand Down

0 comments on commit 7d45f04

Please sign in to comment.