Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features/Changes
* Compiler/wasm: omit code pointer from closures when not used (#2059)
* Compiler: fix purity of comparison functions (again) (#2092)

# 6.2.0 (2025-07-30) - Lille

Expand Down
8 changes: 4 additions & 4 deletions compiler/tests-full/stdlib.cma.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@

//# unitInfo: Provides: Stdlib
//# unitInfo: Requires: CamlinternalFormatBasics
//# shape: Stdlib:[F(1),F(1),N,N,N,N,N,N,N,N,N,N,N,N,N,F(2)*,F(2)*,F(1)*,N,N,F(1)*,N,N,N,N,N,N,F(2)*,F(1),F(1)*,F(1)*,F(1),F(1)*,F(1),F(1),F(1),F(2),N,N,N,F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(1),F(2),F(2),F(2),F(4),F(4),F(2),F(2),F(2),F(2),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(3),F(1),F(1),F(4),F(4),F(2),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(2),N,F(1)*,F(2),F(1),F(1),F(1),F(4),F(1),N]
//# shape: Stdlib:[F(1),F(1),N,N,N,N,N,N,N,N,N,N,N,N,N,F(2),F(2),F(1)*,N,N,F(1)*,N,N,N,N,N,N,F(2)*,F(1),F(1)*,F(1)*,F(1),F(1)*,F(1),F(1),F(1),F(2),N,N,N,F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(1),F(3),F(1),F(1),F(2),F(2),F(2),F(4),F(4),F(2),F(2),F(2),F(2),F(1),F(1),F(1),F(1),F(2),F(1),F(1),F(3),F(1),F(1),F(4),F(4),F(2),F(1),F(1),F(1),F(2),F(1),F(1),F(1),F(1),F(2),N,F(1)*,F(2),F(1),F(1),F(1),F(4),F(1),N]
(function
(globalThis){
"use strict";
Expand Down Expand Up @@ -9077,7 +9077,7 @@

//# unitInfo: Provides: Stdlib__Int32
//# unitInfo: Requires: Stdlib, Stdlib__Sys
//# shape: Stdlib__Int32:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1)*,N,N,F(1)*,F(1)*,F(1),F(1)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*]
//# shape: Stdlib__Int32:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1),N,N,F(1)*,F(1),F(1),F(1)*,F(2)*,F(2)*,F(2),F(2),F(2),F(2)*,F(1)*]
(function
(globalThis){
"use strict";
Expand Down Expand Up @@ -9213,7 +9213,7 @@

//# unitInfo: Provides: Stdlib__Int64
//# unitInfo: Requires: Stdlib
//# shape: Stdlib__Int64:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1)*,N,N,F(1)*,F(1)*,F(1),F(1)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*]
//# shape: Stdlib__Int64:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1),N,N,F(1)*,F(1),F(1),F(1)*,F(2)*,F(2)*,F(2),F(2),F(2),F(2)*,F(1)*]
(function
(globalThis){
"use strict";
Expand Down Expand Up @@ -9362,7 +9362,7 @@

//# unitInfo: Provides: Stdlib__Nativeint
//# unitInfo: Requires: Stdlib, Stdlib__Sys
//# shape: Stdlib__Nativeint:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1)*,N,N,N,F(1)*,F(1)*,F(1),F(1)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(2)*,F(1)*]
//# shape: Stdlib__Nativeint:[N,N,N,F(2),F(2),F(1)*,F(1)*,F(1),N,N,N,F(1)*,F(1),F(1),F(1)*,F(2)*,F(2)*,F(2)*,F(2),F(2),F(2)*,F(1)*]
(function
(globalThis){
"use strict";
Expand Down
28 changes: 21 additions & 7 deletions runtime/js/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ function caml_compare_val(a, b, total) {
b = b[i];
}
}
//Provides: caml_compare mutable (const, const)

// May raise
//Provides: caml_compare (const, const)
//Requires: caml_compare_val
function caml_compare(a, b) {
return caml_compare_val(a, b, true);
Expand All @@ -265,32 +267,44 @@ function caml_int_compare(a, b) {
if (a === b) return 0;
return 1;
}
//Provides: caml_equal mutable (const, const)

// May raise
//Provides: caml_equal (const, const)
//Requires: caml_compare_val
function caml_equal(x, y) {
return +(caml_compare_val(x, y, false) === 0);
}
//Provides: caml_notequal mutable (const, const)

// May raise
//Provides: caml_notequal (const, const)
//Requires: caml_compare_val
function caml_notequal(x, y) {
return +(caml_compare_val(x, y, false) !== 0);
}
//Provides: caml_greaterequal mutable (const, const)

// May raise
//Provides: caml_greaterequal (const, const)
//Requires: caml_compare_val
function caml_greaterequal(x, y) {
return +(caml_compare_val(x, y, false) >= 0);
}
//Provides: caml_greaterthan mutable (const, const)

// May raise
//Provides: caml_greaterthan (const, const)
//Requires: caml_compare_val
function caml_greaterthan(x, y) {
return +(caml_compare_val(x, y, false) > 0);
}
//Provides: caml_lessequal mutable (const, const)

// May raise
//Provides: caml_lessequal (const, const)
//Requires: caml_compare_val
function caml_lessequal(x, y) {
return +(caml_compare_val(x, y, false) <= 0);
}
//Provides: caml_lessthan mutable (const, const)

// May raise
//Provides: caml_lessthan (const, const)
//Requires: caml_compare_val
function caml_lessthan(x, y) {
return +(caml_compare_val(x, y, false) < 0);
Expand Down
Loading