From f80c4a66ae219afa7bd4172441f4e94ba649c9d9 Mon Sep 17 00:00:00 2001 From: Crazycolorz5 Date: Sun, 20 Jan 2019 19:26:58 -0500 Subject: rts: Specialize hashing at call site rather than in struct. Separate word and string hash tables on the type level, and do not store the hashing function. Thus when a different hash function is desire it is provided upon accessing the table. This is worst case the same as before the change, and in the majority of cases is better. Also mark the functions for aggressive inlining to improve performance. {F1686506} Reviewers: bgamari, erikd, simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #13165 Differential Revision: https://phabricator.haskell.org/D4889 --- rts/LinkerInternals.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rts/LinkerInternals.h') diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h index 0f47b82761..8a8df50098 100644 --- a/rts/LinkerInternals.h +++ b/rts/LinkerInternals.h @@ -243,7 +243,7 @@ typedef struct _ObjectCode { /* Holds the list of symbols in the .o file which require extra information.*/ - HashTable *extraInfos; + StrHashTable *extraInfos; #if RTS_LINKER_USE_MMAP == 1 /* The m32 allocators used for allocating small sections and symbol extras @@ -304,12 +304,12 @@ void addSection (Section *s, SectionKind kind, SectionAlloc alloc, void* start, StgWord size, StgWord mapped_offset, void* mapped_start, StgWord mapped_size); -HsBool ghciLookupSymbolInfo(HashTable *table, +HsBool ghciLookupSymbolInfo(StrHashTable *table, const SymbolName* key, RtsSymbolInfo **result); int ghciInsertSymbolTable( pathchar* obj_name, - HashTable *table, + StrHashTable *table, const SymbolName* key, SymbolAddr* data, HsBool weak, @@ -318,7 +318,7 @@ int ghciInsertSymbolTable( /* lock-free version of lookupSymbol */ SymbolAddr* lookupSymbol_ (SymbolName* lbl); -extern /*Str*/HashTable *symhash; +extern StrHashTable *symhash; pathchar* resolveSymbolAddr (pathchar* buffer, int size, -- cgit v1.2.1