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

only use hashtable for inlining from abc files of system modules

parent 30f20ecc
...@@ -122,9 +122,9 @@ NodeDefs NewNodeDef (NodeId nid,Node node) ...@@ -122,9 +122,9 @@ NodeDefs NewNodeDef (NodeId nid,Node node)
void InitChecker (void) void InitChecker (void)
{ {
StartSymbol = NewSymbol (newsymbol); StartSymbol = NewSymbol (newsymbol);
StartSymbol -> symb_ident = PutStringInHashTable ("Start", SymbolIdTable); StartSymbol -> symb_ident = NewIdent ("Start");
system_seq_id = PutStringInHashTable ("seq", SymbolIdTable); system_seq_id = NewIdent ("seq");
OpenDefinitionModules = NIL; OpenDefinitionModules = NIL;
} }
......
...@@ -2599,7 +2599,7 @@ SymbDef CreateUpdateFunction (ArgS *record_arg,ArgS *first_field_arg,Node node ...@@ -2599,7 +2599,7 @@ SymbDef CreateUpdateFunction (ArgS *record_arg,ArgS *first_field_arg,Node node
} else } else
strict_record_state_p = &record_state; strict_record_state_p = &record_state;
update_function_ident=PutStringInHashTable (update_function_name,SymbolIdTable); update_function_ident=NewIdent (update_function_name);
update_function_sdef=MakeNewSymbolDefinition (CurrentModule,update_function_ident,n_arguments,IMPRULE); update_function_sdef=MakeNewSymbolDefinition (CurrentModule,update_function_ident,n_arguments,IMPRULE);
update_function_sdef->sdef_number=next_def_number++; update_function_sdef->sdef_number=next_def_number++;
...@@ -2773,7 +2773,7 @@ SymbDef create_select_function (Symbol selector_symbol,int selector_kind) ...@@ -2773,7 +2773,7 @@ SymbDef create_select_function (Symbol selector_symbol,int selector_kind)
sprintf (select_function_name,"_sel%d",next_update_function_n); sprintf (select_function_name,"_sel%d",next_update_function_n);
++next_update_function_n; ++next_update_function_n;
select_function_ident=PutStringInHashTable (select_function_name,SymbolIdTable); select_function_ident=NewIdent (select_function_name);
select_function_sdef=MakeNewSymbolDefinition (CurrentModule,select_function_ident,1,IMPRULE); select_function_sdef=MakeNewSymbolDefinition (CurrentModule,select_function_ident,1,IMPRULE);
U5 (select_function_sdef, sdef_number=next_def_number++, U5 (select_function_sdef, sdef_number=next_def_number++,
...@@ -2862,7 +2862,7 @@ static SymbDef create_match_function_sdef (void) ...@@ -2862,7 +2862,7 @@ static SymbDef create_match_function_sdef (void)
sprintf (match_function_name,"_match%d",next_match_function_n); sprintf (match_function_name,"_match%d",next_match_function_n);
++next_match_function_n; ++next_match_function_n;
match_function_ident=PutStringInHashTable (match_function_name,SymbolIdTable); match_function_ident=NewIdent (match_function_name);
match_function_sdef=MakeNewSymbolDefinition (CurrentModule,match_function_ident,1,IMPRULE); match_function_sdef=MakeNewSymbolDefinition (CurrentModule,match_function_ident,1,IMPRULE);
U5 (match_function_sdef, sdef_number=next_def_number++, U5 (match_function_sdef, sdef_number=next_def_number++,
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
# include "dbprint.h" # include "dbprint.h"
# endif # endif
static void *gSymbIdEnv;
static IdentP gBasicTypeIdents [Nr_Of_Basic_Types], gIfIdent; static IdentP gBasicTypeIdents [Nr_Of_Basic_Types], gIfIdent;
static SymbolP static SymbolP
...@@ -38,13 +36,13 @@ NewPredefinedTypeSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr ...@@ -38,13 +36,13 @@ NewPredefinedTypeSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr
symbol = NewSymbol (symbolKind); symbol = NewSymbol (symbolKind);
ident = PutStringInHashTable (symbolName, TypeSymbolIdTable); ident = NewIdent (symbolName);
ident->ident_symbol = symbol; ident->ident_symbol = symbol;
ident->ident_environ= (char*)gSymbIdEnv; ident->ident_environ= NULL;
*identPtr = ident; *identPtr = ident;
return (symbol); return (symbol);
} /* NewPredefinedSymbol */ }
static SymbolP static SymbolP
NewPredefinedSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr) NewPredefinedSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr)
...@@ -54,9 +52,9 @@ NewPredefinedSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr) ...@@ -54,9 +52,9 @@ NewPredefinedSymbol (SymbKind symbolKind, char *symbolName, IdentP *identPtr)
symbol = NewSymbol (symbolKind); symbol = NewSymbol (symbolKind);
ident = PutStringInHashTable (symbolName, SymbolIdTable); ident = NewIdent (symbolName);
ident->ident_symbol = symbol; ident->ident_symbol = symbol;
ident->ident_environ= (char*)gSymbIdEnv; ident->ident_environ= NULL;
*identPtr = ident; *identPtr = ident;
return (symbol); return (symbol);
......
...@@ -1008,7 +1008,7 @@ static Symbol new_rule_symbol (char *function_name) ...@@ -1008,7 +1008,7 @@ static Symbol new_rule_symbol (char *function_name)
Symbol function_symbol; Symbol function_symbol;
Ident function_ident; Ident function_ident;
function_ident=PutStringInHashTable (function_name,SymbolIdTable); function_ident=NewIdent (function_name);
function_sdef=MakeNewSymbolDefinition (CurrentModule,function_ident,0,IMPRULE); function_sdef=MakeNewSymbolDefinition (CurrentModule,function_ident,0,IMPRULE);
function_sdef->sdef_ancestor = ~next_def_number; function_sdef->sdef_ancestor = ~next_def_number;
......
extern IdentP NewIdent (char *name);
extern IdentP PutStringInHashTable (char *string, TableKind tabkind); extern IdentP PutStringInHashTable (char *string, TableKind tabkind);
extern void InitScanner (void); extern void InitScanner (void);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
# include "sizes.h" # include "sizes.h"
static IdentP static IdentP
NewIdent (TableKind tableKind, char *name) NewIdentInTable (TableKind tableKind, char *name)
{ {
IdentP ident; IdentP ident;
...@@ -39,7 +39,7 @@ NewIdent (TableKind tableKind, char *name) ...@@ -39,7 +39,7 @@ NewIdent (TableKind tableKind, char *name)
ident->ident_mark = 0; ident->ident_mark = 0;
return (ident); return (ident);
} /* NewIdent */ }
#define CompAllocString(size) ((char*)CompAlloc(size)) #define CompAllocString(size) ((char*)CompAlloc(size))
...@@ -58,6 +58,24 @@ AllocString (char *string, short length) ...@@ -58,6 +58,24 @@ AllocString (char *string, short length)
return (newString); return (newString);
} /* AllocString */ } /* AllocString */
IdentP
NewIdent (char *name)
{
IdentP ident;
ident = CompAllocType (struct ident);
ident->ident_name = AllocString (name,strlen (name));
ident->ident_table = LastSystemModuleTable;
ident->ident_next = NULL;
ident->ident_environ = NULL;
ident->ident_symbol = NULL;
ident->ident_mark = 0;
return ident;
}
# define kIdentStringTableSizeBits 10 # define kIdentStringTableSizeBits 10
# define kIdentStringTableSize ((1 << kIdentStringTableSizeBits) - 1) # define kIdentStringTableSize ((1 << kIdentStringTableSizeBits) - 1)
...@@ -129,7 +147,7 @@ PutIdentStringInTable (IdentStringP identString, TableKind tableKind) ...@@ -129,7 +147,7 @@ PutIdentStringInTable (IdentStringP identString, TableKind tableKind)
if (ident == NIL) if (ident == NIL)
{ {
ident = NewIdent (tableKind, identString->string); ident = NewIdentInTable (tableKind, identString->string);
ident->ident_next = identString->ident; ident->ident_next = identString->ident;
......
...@@ -105,7 +105,7 @@ typedef struct record_state_descr { ...@@ -105,7 +105,7 @@ typedef struct record_state_descr {
} *RecordStateDescr; } *RecordStateDescr;
typedef enum { typedef enum {
SymbolIdTable, TypeSymbolIdTable, FirstSystemModuleTable, LastSystemModuleTable=0x7fff FirstSystemModuleTable, LastSystemModuleTable=0x7fff
} TableKind; } TableKind;
typedef union symb_value { typedef union symb_value {
......
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