From: Mark Thom Date: Sat, 3 Feb 2018 00:10:57 +0000 (-0700) Subject: reverse builtin instructions X-Git-Tag: v0.8.110~585 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=23f81946c5ccaa95ef052e351b503ca209ed6873;p=scryer-prolog.git reverse builtin instructions --- diff --git a/src/prolog/builtins.rs b/src/prolog/builtins.rs index aa644bdd..dad17509 100644 --- a/src/prolog/builtins.rs +++ b/src/prolog/builtins.rs @@ -447,7 +447,7 @@ fn get_builtins(atom_tbl: TabledData) -> Code { get_current_block!(), query![put_value!(perm_v!(3), 1), put_unsafe_value!(4, 2), - put_value!(perm_v!(2), 3)], + put_value!(perm_v!(2), 3)], deallocate!(), jmp_execute!(3, 1), try_me_else!(5), // 304. @@ -491,8 +491,8 @@ fn get_builtins(atom_tbl: TabledData) -> Code { trust_me!(), allocate!(0), goto_call!(352, 0), // goto run_cleaners_without_handling/0, 352. - fail!(), deallocate!(), + fail!(), try_me_else!(10), // run_cleaners_with_handling/0, 340. allocate!(2), get_level!(perm_v!(1)), @@ -500,7 +500,7 @@ fn get_builtins(atom_tbl: TabledData) -> Code { get_cleaner_call!(), query![put_value!(perm_v!(2), 1), put_var!(temp_v!(4), 2), - put_constant!(Level::Shallow, atom!("true", atom_tbl), temp_v!(3))], + put_constant!(Level::Shallow, atom!("true", atom_tbl), temp_v!(3))], goto_call!(5, 3), // goto catch/3, 5. cut!(perm_v!(1)), deallocate!(), @@ -515,7 +515,7 @@ fn get_builtins(atom_tbl: TabledData) -> Code { query![put_value!(perm_v!(2), 1)], call_n!(1), cut!(perm_v!(1)), - deallocate!(), + deallocate!(), goto_execute!(352, 0), // goto run_cleaners_without_handling/0, 352. trust_me!(), proceed!(), diff --git a/src/prolog/io.rs b/src/prolog/io.rs index 1e7f1113..5d467db6 100644 --- a/src/prolog/io.rs +++ b/src/prolog/io.rs @@ -494,8 +494,6 @@ fn compile_decl<'a, 'b: 'a>(wam: &'a mut Machine, tl: &'b TopLevel, queue: &'b V return EvalSession::from(e); }; - print_code(&code); - if !code.is_empty() { if let Some(name) = tl.name() { wam.add_user_code(name, tl.arity(), code)