Commit 863fe4e0 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

add symb_instance_apply field for apply nodes, add functions to generate jmp_i...

add symb_instance_apply field for apply nodes, add functions to generate jmp_i and jsr_i instructions
parent 5f04c6dc
......@@ -248,6 +248,7 @@ InitPredefinedSymbols (void)
gBasicSymbols [fun_type] = PredefinedSymbol (fun_type, 2);
ApplySymbol = PredefinedSymbol (apply_symb, 2);
ApplySymbol->symb_instance_apply = 0;
gBasicSymbols [apply_symb] = ApplySymbol;
TupleSymbol = PredefinedSymbol (tuple_symb, 2); /* arity doesn't matter */
......
......@@ -192,6 +192,8 @@ InitParser (void)
#endif
ApplySymbol = NewSymbol (apply_symb);
ApplySymbol->symb_instance_apply = 0;
FailSymbol = NewSymbol (fail_symb);
clear_p_at_node_tree();
......
......@@ -620,6 +620,7 @@ enum {
#define Ijsr_eval "jsr_eval"
#define Ijsr_ap "jsr_ap"
#define Ijsr_i "jsr_i"
#define Ipop_a "pop_a"
#define Ipop_b "pop_b"
......@@ -652,8 +653,9 @@ enum {
#define Ijmp_eval "jmp_eval"
#define Ijmp_eval_upd "jmp_eval_upd"
#define Ijmp_ap "jmp_ap"
#define Ijmp_not_eqZ "jmp_not_eqZ"
#define Ijmp_ap_upd "jmp_ap_upd"
#define Ijmp_i "jmp_i"
#define Ijmp_not_eqZ "jmp_not_eqZ"
#define Ijmp_upd "jmp_upd"
#define Ihalt "halt"
......@@ -2175,6 +2177,12 @@ void GenJsrAp (int n_args)
put_arguments_n_b (n_args);
}
void GenJsrI (int n_args)
{
put_instruction_b (jsr_i);
put_arguments_n_b (n_args);
}
void GenJmpEval (void)
{
put_instruction (Ijmp_eval);
......@@ -2192,6 +2200,12 @@ void GenJmpApUpd (int n_args)
put_arguments_n_b (n_args);
}
void GenJmpI (int n_args)
{
put_instruction_b (jmp_i);
put_arguments_n_b (n_args);
}
void GenJmpNotEqZ (SymbValue val,Label tolab)
{
put_instruction_ (Ijmp_not_eqZ);
......
......@@ -95,9 +95,11 @@ void GenPushB (int offset);
void GenJsrEval (int offset);
void GenJsrAp (int n_args);
void GenJsrI (int n_args);
void GenJmpEval (void);
void GenJmpAp (int n_args);
void GenJmpApUpd (int n_args);
void GenJmpI (int n_args);
void GenJmpNotEqZ (SymbValue val,Label tolab);
void GenJmpUpd (Label tolab);
void GenPopA (int nr);
......
......@@ -138,6 +138,8 @@ STRUCT (symbol,Symbol) {
unsigned symb_tail_strictness:2; /* 0=lazy,1=strict */
};
#define symb_instance_apply symb_tail_strictness
#if STRICT_LISTS
# define symb_state_p symb_val.val_state_p
# define symb_unboxed_cons_p symb_val.val_unboxed_cons_p
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment