Commit b548b802 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl
Browse files

remove fields node_line and node_record_symbol (use node_push_symbol instead) from struct node

parent bf76bde9
......@@ -127,8 +127,6 @@ NewNodeIdNode (NodeIdP node_id)
node->node_arguments = NIL;
node->node_arity = 0;
node->node_line=-1;
return (node);
} /* NewNodeIdNode */
......@@ -194,8 +192,6 @@ NewSelectorNode (SymbolP symb, Args args, int arity)
node->node_symbol = symb;
node->node_arity = arity;
node->node_line=-1;
return (node);
} /* NewSelectorNode */
......@@ -216,8 +212,6 @@ NewNodeByKind (NodeKind nodeKind, SymbolP symb, Args args, int arity)
if (arity > MaxNodeArity)
StaticMessage (True, "<node>", "\"%S\" %s", symb, "Too many arguments (> 32)");
node->node_line=-1;
return (node);
} /* NewNodeByKind */
......@@ -253,8 +247,6 @@ NewIfNode (void)
then_else_info->if_else_node_defs = NIL;
then_else_info->if_else_strict_node_ids = NIL;
node->node_line=-1;
return (node);
} /* NewIfNode */
......
......@@ -2511,7 +2511,7 @@ SymbDef create_match_function (SymbolP constructor_symbol,int result_arity,int n
push_node->node_kind=PushNode;
push_node->node_arity=result_arity+n_dictionaries;
push_node->node_arguments=arg1;
push_node->node_record_symbol=constructor_symbol;
push_node->node_push_symbol=constructor_symbol;
push_node->node_number=0; /* if !=0 then unique */
last_node_id_p=&push_node->node_node_ids;
......@@ -2681,7 +2681,7 @@ SymbDef create_select_and_match_function (SymbolP constructor_symbol,int n_dicti
push_node->node_kind=PushNode;
push_node->node_arity=1+n_dictionaries;
push_node->node_arguments=arg1;
push_node->node_record_symbol=constructor_symbol;
push_node->node_push_symbol=constructor_symbol;
push_node->node_number=0; /* if !=0 then unique */
if (n_dictionaries==0){
......@@ -4279,8 +4279,8 @@ static int generate_code_for_push_node (NodeP node,int asp,int bsp,struct esc *e
GenPushRArgsU (asp-node_id_p->nid_a_index,a_size,b_size);
}
# ifdef DESTRUCTIVE_RECORD_UPDATES
else if (node->node_record_symbol->symb_kind==definition &&
node->node_record_symbol->symb_def->sdef_kind==RECORDTYPE &&
else if (node->node_push_symbol->symb_kind==definition &&
node->node_push_symbol->symb_def->sdef_kind==RECORDTYPE &&
(((node_id_p->nid_mark2 & NID_HAS_REFCOUNT_WITHOUT_UPDATES)!=0 &&
node_id_p->nid_number==-2)
# if BOXED_RECORDS
......
......@@ -4840,7 +4840,7 @@ static void FillUniqueNodeWithNode (NodeP update_node,int *asp_p,int *bsp_p,Code
switch (sdef->sdef_kind){
case CONSTRUCTOR:
if (push_node->node_record_symbol==node->node_symbol && push_node->node_arity==node_arity)
if (push_node->node_push_symbol==node->node_symbol && push_node->node_arity==node_arity)
bits[0]='0';
else
bits[0]='1';
......@@ -4857,7 +4857,7 @@ static void FillUniqueNodeWithNode (NodeP update_node,int *asp_p,int *bsp_p,Code
}
break;
case RECORDTYPE:
if (push_node->node_record_symbol==node->node_symbol && push_node->node_arity==node_arity)
if (push_node->node_push_symbol==node->node_symbol && push_node->node_arity==node_arity)
bits[0]='0';
else
bits[0]='1';
......@@ -4990,7 +4990,7 @@ static void FillUniqueNodeWithNode (NodeP update_node,int *asp_p,int *bsp_p,Code
}
#endif
if (push_node->node_record_symbol->symb_kind==cons_symb && push_node->node_arity==node_arity)
if (push_node->node_push_symbol->symb_kind==cons_symb && push_node->node_arity==node_arity)
bits[0]='0';
else
bits[0]='1';
......@@ -5000,7 +5000,7 @@ static void FillUniqueNodeWithNode (NodeP update_node,int *asp_p,int *bsp_p,Code
case tuple_symb:
node_arity=node->node_arity;
if (push_node->node_record_symbol->symb_kind==tuple_symb && push_node->node_arity==node_arity)
if (push_node->node_push_symbol->symb_kind==tuple_symb && push_node->node_arity==node_arity)
bits[0]='0';
else
bits[0]='1';
......
......@@ -1775,11 +1775,7 @@ static void generate_code_for_tail_call_modulo_cons (NodeP node_p,NodeId node_de
DetermineSizeOfArguments (root_node->node_arguments,&asize,&bsize);
#if STRICT_LISTS
if (asize+bsize>2 && push_node!=NULL && push_node->node_push_size>=asize+bsize){
#else
if (asize+bsize>2 && push_node!=NULL && push_node->node_line>=asize+bsize){
#endif
NodeIdListElementP node_id_list;
char bits[MaxNodeArity+2];
unsigned int a_bits,b_bits,a_size,b_size,a_size2,b_size2,arg_n;
......
......@@ -728,6 +728,9 @@ static Node copy_node (Node old,Bool lhs)
old_then_else_info = old->node_contents.contents_if;
new->node_contents.contents_if = new_then_else_info;
new_then_else_info->if_then_rules = NULL;
new_then_else_info->if_else_rules = NULL;
old_arg=old->node_arguments;
new_arg = CompAllocType (ArgS);
......@@ -1932,11 +1935,7 @@ static NodeP replace_node_by_unique_fill_node (NodeP node,NodeP push_node,int no
node->node_arguments=arg_p;
node->node_arity=1;
#if STRICT_LISTS
push_node->node_push_size=node_size;
#else
push_node->node_line=node_size;
#endif
--push_node->node_arguments->arg_node->node_node_id->nid_refcount;
push_node->node_number=1;
......
......@@ -110,7 +110,7 @@ static NodeP new_push_node (Symbol symbol,int arity,ArgP arguments)
push_node->node_kind=PushNode;
push_node->node_arity=arity;
push_node->node_arguments=arguments;
push_node->node_record_symbol=symbol;
push_node->node_push_symbol=symbol;
push_node->node_number=0; /* if !=0 then unique */
return push_node;
......
......@@ -6,7 +6,6 @@
Authors: Sjaak Smetsers & John van Groningen
At: University of Nijmegen, department of computing science
Version: 1.1
*/
#pragma segment statesgen
......@@ -2724,7 +2723,7 @@ static void DetermineStatesOfNodeAndDefs (Node root_node,NodeDefs node_defs,Stat
switch (node_id_state_p->state_type){
case RecordState:
set_push_node_id_states (node_ids,case_alt_node_p->node_record_symbol->symb_def->sdef_record_state.state_record_arguments);
set_push_node_id_states (node_ids,case_alt_node_p->node_push_symbol->symb_def->sdef_record_state.state_record_arguments);
break;
case TupleState:
set_push_node_id_states (node_ids,node_id_state_p->state_tuple_arguments);
......@@ -2733,7 +2732,7 @@ static void DetermineStatesOfNodeAndDefs (Node root_node,NodeDefs node_defs,Stat
{
Symbol symbol;
symbol=case_alt_node_p->node_record_symbol;
symbol=case_alt_node_p->node_push_symbol;
if (symbol->symb_kind==definition){
SymbDef sdef;
......
......@@ -356,11 +356,7 @@ STRUCT (node,Node){
struct arg * node_arguments;
union {
StateS su_state;
struct {
Symbol s_record_symbol; /* comparser,checker */
int s_line; /* size for PushNode if not STRICT_LISTS) */
} su_s;
StateS su_state;
struct {
struct node_def * u_node_defs; /* for CaseNode,DefaultNode and GuardNode */
#ifdef TRANSFORM_PATTERNS_BEFORE_STRICTNESS_ANALYSIS
......@@ -369,15 +365,17 @@ STRUCT (node,Node){
struct node_id_ref_count_list * u_node_id_ref_counts;
#endif
} su_u;
#if STRICT_LISTS
struct {
SymbolP push_symbol;
#if STRICT_LISTS
union {
NodeP pu_decons_node; /* if overloaded push */
int pu_size; /* if unique non overloaded push */
} push_pu;
} su_push; /* for PushNode */
#else
int push_size;
#endif
} su_push; /* for PushNode */
} node_su;
short node_arity;
......@@ -394,8 +392,6 @@ STRUCT (node,Node){
#endif
#define node_state node_su.su_state
#define node_record_symbol node_su.su_s.s_record_symbol
#define node_line node_su.su_s.s_line
#define node_node_defs node_su.su_u.u_node_defs
#define node_symbol node_contents.contents_symbol
#define node_node_id node_contents.contents_node_id
......@@ -412,10 +408,12 @@ STRUCT (node,Node){
#define node_else_strict_node_ids node_contents.contents_if->if_else_strict_node_ids
#define node_if_scope node_contents.contents_if->if_local_scope
#define node_push_symbol node_su.su_push.push_symbol
#if STRICT_LISTS
# define node_push_symbol node_su.su_push.push_symbol
# define node_decons_node node_su.su_push.push_pu.pu_decons_node
# define node_push_size node_su.su_push.push_pu.pu_size
#else
# define node_push_size node_su.su_push.push_size
#endif
STRUCT (arg,Arg){
......
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