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
2 changes: 1 addition & 1 deletion jscomp/core/lam_compile_primitive.ml
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ let translate loc
| Poffsetint n ->
E.int32_add (Ext_list.singleton_exn args) (E.small_int n)
| Poffsetref n ->
let v = (Js_of_lam_block.field Fld_na (Ext_list.singleton_exn args) 0l) in
let v = Js_of_lam_block.field Lambda.ref_field_info (Ext_list.singleton_exn args) 0l in
E.seq (E.assign v (E.int32_add v (E.small_int n))) E.unit
| Psequand -> (* TODO: rhs is possibly a tail call *)
begin match args with
Expand Down
4 changes: 2 additions & 2 deletions jscomp/stdlib-406/pervasives.ml
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ external snd : 'a * 'b -> 'b = "%field1"

type 'a ref = { mutable contents : 'a }
external ref : 'a -> 'a ref = "%makemutable"
external ( ! ) : 'a ref -> 'a = "%field0"
external ( := ) : 'a ref -> 'a -> unit = "%setfield0"
external ( ! ) : 'a ref -> 'a = "%bs_ref_field0"
external ( := ) : 'a ref -> 'a -> unit = "%bs_ref_setfield0"
external incr : int ref -> unit = "%incr"
external decr : int ref -> unit = "%decr"

Expand Down
4 changes: 2 additions & 2 deletions jscomp/stdlib-406/pervasives.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1179,12 +1179,12 @@ type 'a ref = { mutable contents : 'a }
external ref : 'a -> 'a ref = "%makemutable"
(** Return a fresh reference containing the given value. *)

external ( ! ) : 'a ref -> 'a = "%field0"
external ( ! ) : 'a ref -> 'a = "%bs_ref_field0"
(** [!r] returns the current contents of reference [r].
Equivalent to [fun r -> r.contents].
Unary operator at precedence level 11/11.*)

external ( := ) : 'a ref -> 'a -> unit = "%setfield0"
external ( := ) : 'a ref -> 'a -> unit = "%bs_ref_setfield0"
(** [r := a] stores the value of [a] in reference [r].
Equivalent to [fun r v -> r.contents <- v].
Right-associative operator at precedence level 1/11. *)
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/406_primitive_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function f(param) {
}
}

Mt.from_pair_suites("406_primitive_test", suites[0]);
Mt.from_pair_suites("406_primitive_test", suites[/* contents */0]);

exports.suites = suites;
exports.test_id = test_id;
Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/a_filename_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ var suites = /* record */[/* contents : [] */0];
var test_id = /* record */[/* contents */0];

function eq(loc, x, y) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
test_id[/* contents */0] = test_id[/* contents */0] + 1 | 0;
suites[/* contents */0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
loc + (" id " + String(test_id[/* contents */0])),
(function (param) {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites[0]
suites[/* contents */0]
];
return /* () */0;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ eq("File \"a_filename_test.ml\", line 73, characters 5-12", $$Array.map(Ext_file
"/a.txt"
]);

Mt.from_pair_suites("A_filename_test", suites[0]);
Mt.from_pair_suites("A_filename_test", suites[/* contents */0]);

exports.suites = suites;
exports.test_id = test_id;
Expand Down
4 changes: 2 additions & 2 deletions jscomp/test/ari_regress_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var h = /* record */[/* contents */0];

function g1(x, y) {
var u = x + y | 0;
h[0] = h[0] + 1 | 0;
h[/* contents */0] = h[/* contents */0] + 1 | 0;
return (function (xx, yy) {
return (xx + yy | 0) + u | 0;
});
Expand Down Expand Up @@ -63,7 +63,7 @@ var suites_001 = /* :: */[
"File \"ari_regress_test.ml\", line 20, characters 4-11",
(function (param) {
return /* Eq */Block.__(0, [
h[0],
h[/* contents */0],
1
]);
})
Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/arity_deopt.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ var suites = /* record */[/* contents : [] */0];
var test_id = /* record */[/* contents */0];

function eq(loc, x, y) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
test_id[/* contents */0] = test_id[/* contents */0] + 1 | 0;
suites[/* contents */0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
loc + (" id " + String(test_id[/* contents */0])),
(function (param) {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites[0]
suites[/* contents */0]
];
return /* () */0;
}
Expand Down Expand Up @@ -59,7 +59,7 @@ eq("File \"arity_deopt.ml\", line 48, characters 15-22", 6, (function (y, z) {
return (1 + y | 0) + z | 0;
})(2, 3));

Mt.from_pair_suites("Arity_deopt", suites[0]);
Mt.from_pair_suites("Arity_deopt", suites[/* contents */0]);

exports.suites = suites;
exports.test_id = test_id;
Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/array_subtle_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ var test_id = /* record */[/* contents */0];
function eq(loc, param) {
var y = param[1];
var x = param[0];
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
test_id[/* contents */0] = test_id[/* contents */0] + 1 | 0;
suites[/* contents */0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
loc + (" id " + String(test_id[/* contents */0])),
(function (param) {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites[0]
suites[/* contents */0]
];
return /* () */0;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ eq("File \"array_subtle_test.ml\", line 53, characters 6-13", /* tuple */[
1
]);

Mt.from_pair_suites("Array_subtle_test", suites[0]);
Mt.from_pair_suites("Array_subtle_test", suites[/* contents */0]);

exports.suites = suites;
exports.test_id = test_id;
Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/ast_abstract_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ var suites = /* record */[/* contents : [] */0];
var test_id = /* record */[/* contents */0];

function eq(loc, x, y) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
test_id[/* contents */0] = test_id[/* contents */0] + 1 | 0;
suites[/* contents */0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
loc + (" id " + String(test_id[/* contents */0])),
(function (param) {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites[0]
suites[/* contents */0]
];
return /* () */0;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ function zFromJs(param) {

}

Mt.from_pair_suites("Ast_abstract_test", suites[0]);
Mt.from_pair_suites("Ast_abstract_test", suites[/* contents */0]);

var jsMapperEraseType = /* JsMapperEraseType */0;

Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/ast_js_mapper_poly_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ var suites = /* record */[/* contents : [] */0];
var test_id = /* record */[/* contents */0];

function eq(loc, x, y) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
test_id[/* contents */0] = test_id[/* contents */0] + 1 | 0;
suites[/* contents */0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
loc + (" id " + String(test_id[/* contents */0])),
(function (param) {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites[0]
suites[/* contents */0]
];
return /* () */0;
}
Expand Down Expand Up @@ -256,7 +256,7 @@ eq("File \"ast_js_mapper_poly_test.ml\", line 89, characters 5-12", $$Array.map(
/* C5 */5
])), /* array */[undefined]));

Mt.from_pair_suites("Ast_js_mapper_poly_test", suites[0]);
Mt.from_pair_suites("Ast_js_mapper_poly_test", suites[/* contents */0]);

var $plus$great = $$Array.append;

Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/ast_mapper_defensive_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ var suites = /* record */[/* contents : [] */0];
var test_id = /* record */[/* contents */0];

function $$throw(loc, x) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
test_id[/* contents */0] = test_id[/* contents */0] + 1 | 0;
suites[/* contents */0] = /* :: */[
/* tuple */[
loc + (" id " + String(test_id[0])),
loc + (" id " + String(test_id[/* contents */0])),
(function (param) {
return /* ThrowAny */Block.__(7, [x]);
})
],
suites[0]
suites[/* contents */0]
];
return /* () */0;
}
Expand Down Expand Up @@ -85,7 +85,7 @@ $$throw("File \"ast_mapper_defensive_test.ml\", line 30, characters 15-22", (fun
return /* () */0;
}));

Mt.from_pair_suites("Ast_mapper_defensive_test", suites[0]);
Mt.from_pair_suites("Ast_mapper_defensive_test", suites[/* contents */0]);

exports.suites = suites;
exports.test_id = test_id;
Expand Down
6 changes: 3 additions & 3 deletions jscomp/test/basic_module_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var Mt_global = require("./mt_global.js");
var count = /* record */[/* contents */0];

function test(set) {
count[0] = Offset.$$Set.cardinal(set) + count[0] | 0;
count[/* contents */0] = Offset.$$Set.cardinal(set) + count[/* contents */0] | 0;
return /* () */0;
}

Expand All @@ -22,8 +22,8 @@ function eq(f, a, b) {
return Mt_global.collect_eq(test_id, suites, f, a, b);
}

eq("File \"basic_module_test.ml\", line 39, characters 12-19", count[0], 1);
eq("File \"basic_module_test.ml\", line 39, characters 12-19", count[/* contents */0], 1);

Mt.from_pair_suites("Basic_module_test", suites[0]);
Mt.from_pair_suites("Basic_module_test", suites[/* contents */0]);

/* Not a pure module */
42 changes: 21 additions & 21 deletions jscomp/test/bdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var nodeC = /* record */[/* contents */1];

var sz_1 = /* record */[/* contents */8191];

var htab = /* record */[/* contents */Caml_array.caml_make_vect(sz_1[0] + 1 | 0, /* [] */0)];
var htab = /* record */[/* contents */Caml_array.caml_make_vect(sz_1[/* contents */0] + 1 | 0, /* [] */0)];

var n_items = /* record */[/* contents */0];

Expand All @@ -44,7 +44,7 @@ function hashVal(x, y, v) {
}

function resize(newSize) {
var arr = htab[0];
var arr = htab[/* contents */0];
var newSz_1 = newSize - 1 | 0;
var newArr = Caml_array.caml_make_vect(newSize, /* [] */0);
var copyBucket = function (_bucket) {
Expand Down Expand Up @@ -74,37 +74,37 @@ function resize(newSize) {
}
};
};
for(var n = 0 ,n_finish = sz_1[0]; n <= n_finish; ++n){
for(var n = 0 ,n_finish = sz_1[/* contents */0]; n <= n_finish; ++n){
copyBucket(Caml_array.caml_array_get(arr, n));
}
htab[0] = newArr;
sz_1[0] = newSz_1;
htab[/* contents */0] = newArr;
sz_1[/* contents */0] = newSz_1;
return /* () */0;
}

function insert(idl, idh, v, ind, bucket, newNode) {
if (n_items[0] <= sz_1[0]) {
Caml_array.caml_array_set(htab[0], ind, /* :: */[
if (n_items[/* contents */0] <= sz_1[/* contents */0]) {
Caml_array.caml_array_set(htab[/* contents */0], ind, /* :: */[
newNode,
bucket
]);
n_items[0] = n_items[0] + 1 | 0;
n_items[/* contents */0] = n_items[/* contents */0] + 1 | 0;
return /* () */0;
} else {
resize((sz_1[0] + sz_1[0] | 0) + 2 | 0);
var ind$1 = hashVal(idl, idh, v) & sz_1[0];
return Caml_array.caml_array_set(htab[0], ind$1, /* :: */[
resize((sz_1[/* contents */0] + sz_1[/* contents */0] | 0) + 2 | 0);
var ind$1 = hashVal(idl, idh, v) & sz_1[/* contents */0];
return Caml_array.caml_array_set(htab[/* contents */0], ind$1, /* :: */[
newNode,
Caml_array.caml_array_get(htab[0], ind$1)
Caml_array.caml_array_get(htab[/* contents */0], ind$1)
]);
}
}

function resetUnique(param) {
sz_1[0] = 8191;
htab[0] = Caml_array.caml_make_vect(sz_1[0] + 1 | 0, /* [] */0);
n_items[0] = 0;
nodeC[0] = 1;
sz_1[/* contents */0] = 8191;
htab[/* contents */0] = Caml_array.caml_make_vect(sz_1[/* contents */0] + 1 | 0, /* [] */0);
n_items[/* contents */0] = 0;
nodeC[/* contents */0] = 1;
return /* () */0;
}

Expand All @@ -114,8 +114,8 @@ function mkNode(low, v, high) {
if (idl === idh) {
return low;
} else {
var ind = hashVal(idl, idh, v) & sz_1[0];
var bucket = Caml_array.caml_array_get(htab[0], ind);
var ind = hashVal(idl, idh, v) & sz_1[/* contents */0];
var bucket = Caml_array.caml_array_get(htab[/* contents */0], ind);
var _b = bucket;
while(true) {
var b = _b;
Expand All @@ -138,7 +138,7 @@ function mkNode(low, v, high) {
continue ;
}
} else {
var n_002 = (nodeC[0] = nodeC[0] + 1 | 0, nodeC[0]);
var n_002 = (nodeC[/* contents */0] = nodeC[/* contents */0] + 1 | 0, nodeC[/* contents */0]);
var n$1 = /* Node */[
low,
v,
Expand Down Expand Up @@ -328,8 +328,8 @@ function hwb(n) {
var seed = /* record */[/* contents */0];

function random(param) {
seed[0] = Caml_int32.imul(seed[0], 25173) + 17431 | 0;
return (seed[0] & 1) > 0;
seed[/* contents */0] = Caml_int32.imul(seed[/* contents */0], 25173) + 17431 | 0;
return (seed[/* contents */0] & 1) > 0;
}

function random_vars(n) {
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/block_alias_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ b("File \"block_alias_test.ml\", line 33, characters 5-12", Caml_obj.caml_equal(

eq("File \"block_alias_test.ml\", line 34, characters 6-13", v0, v1);

Mt.from_pair_suites("Block_alias_test", suites[0]);
Mt.from_pair_suites("Block_alias_test", suites[/* contents */0]);

var h = List.length;

Expand Down
Loading