Skip to content

Commit a3f5103

Browse files
committed
WIP: compute return_values
1 parent 71cab5c commit a3f5103

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

compiler/lib/driver.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ let inline profile p =
6363

6464
let specialize_1 (p, info) =
6565
if debug () then Format.eprintf "Specialize...@.";
66-
let return_values = Code.Var.Map.empty in
66+
let return_values = Code.return_values p in
6767
Specialize.f
6868
~shape:(fun f -> Flow.the_shape_of ~return_values ~pure:Pure_fun.empty info f)
6969
~update_def:(fun x expr -> Flow.Info.update_def info x expr)

compiler/tests-full/shapes.cma.expected.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@
6262
? f(a0)
6363
: runtime.caml_call_gen(f, [a0]);
6464
}
65-
function caml_call2(f, a0, a1){
66-
return (f.l >= 0 ? f.l : f.l = f.length) === 2
67-
? f(a0, a1)
68-
: runtime.caml_call_gen(f, [a0, a1]);
69-
}
7065
var
7166
global_data = runtime.caml_get_global_data(),
7267
Shapes_M2 = global_data.Shapes__M2,
@@ -83,7 +78,7 @@
8378
};
8479
}
8580
var
86-
x = /*<<compiler/tests-full/m3.ml:3:8>>*/ caml_call2(f(0), 0, 0),
81+
x = /*<<compiler/tests-full/m3.ml:3:8>>*/ f(0)(0, 0),
8782
Shapes_M3 = /*<<compiler/tests-full/m3.ml:3:18>>*/ [0, f, x];
8883
runtime.caml_register_global(3, Shapes_M3, "Shapes__M3");
8984
return;

0 commit comments

Comments
 (0)