From 2718547d28e4d90f34008298de4c7faac011dcbf Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Wed, 6 Nov 2024 14:32:30 -0500 Subject: [PATCH 1/5] Update prng.js --- runtime/js/prng.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/runtime/js/prng.js b/runtime/js/prng.js index 9bce1eafbd..f5dc5ba984 100644 --- a/runtime/js/prng.js +++ b/runtime/js/prng.js @@ -1,3 +1,13 @@ +//Provides: caml_lxm_M +//Requires: caml_int64_of_string +//Requires: caml_new_string +var caml_lxm_M = caml_int64_of_string(caml_new_string("0xd1342543de82ef95")); + +//Provides: caml_lxm_daba +//Requires: caml_int64_of_string +//Requires: caml_new_string +var caml_lxm_daba = caml_int64_of_string(caml_new_string("0xdaba0b6eb09322e3")); + //Provides: caml_lxm_next //Requires: caml_int64_shift_left //Requires: caml_int64_shift_right_unsigned @@ -7,8 +17,8 @@ //Requires: caml_int64_mul //Requires: caml_ba_get_1 //Requires: caml_ba_set_1 -//Requires: caml_int64_of_string -//Requires: caml_new_string +//Requires: caml_lxm_M +//Requires: caml_lxm_daba function caml_lxm_next(v) { function shift_l(x, k) { return caml_int64_shift_left(x, k); @@ -37,8 +47,8 @@ function caml_lxm_next(v) { function set(a, i, x) { return caml_ba_set_1(a, i, x); } - var M = caml_int64_of_string(caml_new_string("0xd1342543de82ef95")); - var daba = caml_int64_of_string(caml_new_string("0xdaba0b6eb09322e3")); + var M = caml_lxm_M; + var daba = caml_lxm_daba; var z, q0, q1; var st = v; var a = get(st, 0); From 772fbf0fbf7400d2c06f706bed343b5a855c3fd0 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Wed, 6 Nov 2024 14:37:16 -0500 Subject: [PATCH 2/5] Update CHANGES.md --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f4c9358851..5a68b0e380 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,8 @@ * Lib: Modify Typed_array API for compatibility with WebAssembly * Lib: add details element and toggle event (#1728) * Toplevel: no longer set globals for toplevel initialization +* Runtime: precompute constants used in `caml_lxm_next` (#1730) + ## Bug fixes * Runtime: fix parsing of unsigned integers (0u2147483648) (#1633, #1666) From e8ed9ce62ebcbcee40b9865fb593677607072f48 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Wed, 6 Nov 2024 14:37:34 -0500 Subject: [PATCH 3/5] Update CHANGES.md --- CHANGES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5a68b0e380..4a2f5c441d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,7 +28,6 @@ * Toplevel: no longer set globals for toplevel initialization * Runtime: precompute constants used in `caml_lxm_next` (#1730) - ## Bug fixes * Runtime: fix parsing of unsigned integers (0u2147483648) (#1633, #1666) * Runtime: fix incorrect pos_in after unmarshalling From 4ab63ab3298f63b63bba2f969526ac8cf7232219 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 6 Nov 2024 21:45:16 +0100 Subject: [PATCH 4/5] Fix tests --- compiler/tests-check-prim/main.output | 3 --- runtime/js/prng.js | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/tests-check-prim/main.output b/compiler/tests-check-prim/main.output index b5d4c4d6b8..389673df28 100644 --- a/compiler/tests-check-prim/main.output +++ b/compiler/tests-check-prim/main.output @@ -177,9 +177,6 @@ caml_obj_is_block caml_obj_is_shared caml_obj_update_tag -From +prng.js: -caml_lxm_next - From +runtime_events.js: caml_custom_event_index caml_ml_runtime_events_pause diff --git a/runtime/js/prng.js b/runtime/js/prng.js index f5dc5ba984..2596b12517 100644 --- a/runtime/js/prng.js +++ b/runtime/js/prng.js @@ -1,11 +1,13 @@ //Provides: caml_lxm_M //Requires: caml_int64_of_string //Requires: caml_new_string +//Version: >= 5 var caml_lxm_M = caml_int64_of_string(caml_new_string("0xd1342543de82ef95")); //Provides: caml_lxm_daba //Requires: caml_int64_of_string //Requires: caml_new_string +//Version: >= 5 var caml_lxm_daba = caml_int64_of_string(caml_new_string("0xdaba0b6eb09322e3")); //Provides: caml_lxm_next @@ -19,6 +21,7 @@ var caml_lxm_daba = caml_int64_of_string(caml_new_string("0xdaba0b6eb09322e3")); //Requires: caml_ba_set_1 //Requires: caml_lxm_M //Requires: caml_lxm_daba +//Version: >= 5 function caml_lxm_next(v) { function shift_l(x, k) { return caml_int64_shift_left(x, k); From 3cd79de21a536fe688623c97ba68d1c235d71690 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 6 Nov 2024 21:47:28 +0100 Subject: [PATCH 5/5] Fix tests --- compiler/tests-check-prim/unix-unix.output | 3 --- compiler/tests-check-prim/unix-win32.output | 3 --- 2 files changed, 6 deletions(-) diff --git a/compiler/tests-check-prim/unix-unix.output b/compiler/tests-check-prim/unix-unix.output index 3d6399954e..b5f53629ce 100644 --- a/compiler/tests-check-prim/unix-unix.output +++ b/compiler/tests-check-prim/unix-unix.output @@ -286,9 +286,6 @@ caml_obj_is_block caml_obj_is_shared caml_obj_update_tag -From +prng.js: -caml_lxm_next - From +runtime_events.js: caml_custom_event_index caml_ml_runtime_events_pause diff --git a/compiler/tests-check-prim/unix-win32.output b/compiler/tests-check-prim/unix-win32.output index 9df6df3c02..04c38da719 100644 --- a/compiler/tests-check-prim/unix-win32.output +++ b/compiler/tests-check-prim/unix-win32.output @@ -251,9 +251,6 @@ caml_obj_is_block caml_obj_is_shared caml_obj_update_tag -From +prng.js: -caml_lxm_next - From +runtime_events.js: caml_custom_event_index caml_ml_runtime_events_pause