Skip to content
Draft
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
10 changes: 5 additions & 5 deletions src/frontend/bytecomp/bytecomp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open Types
open EvalUtil


let compile_and_exec_0 (env : environment) (ast : abstract_tree) : syntactic_value * environment option =
let compile_and_exec_0 (env : environment) (ast : abstract_tree) : syntactic_value =
let (ir, env) = Ir.transform_ast_0 env ast in
let instrs = Compiler.compile ir [] in
(*
Expand All @@ -23,7 +23,7 @@ let compile_environment (env : environment) : unit =
| PrimitiveClosure(parbr, env1, arity, astf) ->
begin
match compile_and_exec_0 env (Function(LabelMap.empty, parbr)) with
| (CompiledClosure(varloc_labmap, _, _, framesize, body, env1), _) ->
| CompiledClosure(varloc_labmap, _, _, framesize, body, env1) ->
if LabelMap.cardinal varloc_labmap = 0 then
loc := CompiledPrimitiveClosure(arity, [], framesize, body, env1, astf)
else
Expand All @@ -38,10 +38,10 @@ let compile_environment (env : environment) : unit =
)


let compile_and_exec_1 (env : environment) (ast : abstract_tree) : code_value * environment option =
let compile_and_exec_1 (env : environment) (ast : abstract_tree) : code_value =
let (ir, env) = Ir.transform_ast_1 env ast in
let instrs = Compiler.compile ir [] in
let (value, envopt) = Vm.exec_code env instrs in
let value = Vm.exec_code env instrs in
match value with
| CodeValue(cv) -> (cv, envopt)
| CodeValue(cv) -> cv
| _ -> report_bug_value "compile_and_exec_1: not a CodeValue(...)" value
Loading