[commit: ghc] master: Linker.c: remove stablehash, which is no longer used (736ed65)

git at git.haskell.org git at git.haskell.org
Fri Oct 25 14:22:37 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/736ed65532d12a3d2d8c79a1dcce1004499bc740/ghc

>---------------------------------------------------------------

commit 736ed65532d12a3d2d8c79a1dcce1004499bc740
Author: Takano Akio <aljee at hyper.cx>
Date:   Sat Dec 29 11:47:22 2012 +0900

    Linker.c: remove stablehash, which is no longer used
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


>---------------------------------------------------------------

736ed65532d12a3d2d8c79a1dcce1004499bc740
 includes/rts/Linker.h |    3 ---
 rts/Linker.c          |   31 ++-----------------------------
 2 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/includes/rts/Linker.h b/includes/rts/Linker.h
index ecbefbb..ea4daeb 100644
--- a/includes/rts/Linker.h
+++ b/includes/rts/Linker.h
@@ -25,9 +25,6 @@ typedef char    pathchar;
 /* initialize the object linker */
 void initLinker( void );
 
-/* insert a stable symbol in the hash table */
-void insertStableSymbol(pathchar* obj_name, char* key, StgPtr data);
-
 /* insert a symbol in the hash table */
 void insertSymbol(pathchar* obj_name, char* key, void* data);
 
diff --git a/rts/Linker.c b/rts/Linker.c
index 116c924..74cac11 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -27,7 +27,6 @@
 #include "RtsUtils.h"
 #include "Trace.h"
 #include "StgPrimFloat.h" // for __int_encodeFloat etc.
-#include "Stable.h"
 #include "Proftimer.h"
 #include "GetEnv.h"
 
@@ -141,9 +140,6 @@
 /* Hash table mapping symbol names to Symbol */
 static /*Str*/HashTable *symhash;
 
-/* Hash table mapping symbol names to StgStablePtr */
-static /*Str*/HashTable *stablehash;
-
 /* List of currently loaded objects */
 ObjectCode *objects = NULL;     /* initially empty */
 
@@ -1139,7 +1135,6 @@ typedef struct _RtsSymbolVal {
       SymI_HasProto(stg_killThreadzh)                                   \
       SymI_HasProto(loadArchive)                                        \
       SymI_HasProto(loadObj)                                            \
-      SymI_HasProto(insertStableSymbol)                                 \
       SymI_HasProto(insertSymbol)                                       \
       SymI_HasProto(lookupSymbol)                                       \
       SymI_HasProto(stg_makeStablePtrzh)                                \
@@ -1540,7 +1535,6 @@ initLinker( void )
 #if defined(THREADED_RTS) && (defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO))
     initMutex(&dl_mutex);
 #endif
-    stablehash = allocStrHashTable();
     symhash = allocStrHashTable();
 
     /* populate the symbol table with stuff from the RTS */
@@ -1869,17 +1863,6 @@ error:
 }
 
 /* -----------------------------------------------------------------------------
- * insert a stable symbol in the hash table
- */
-
-void
-insertStableSymbol(pathchar* obj_name, char* key, StgPtr p)
-{
-  ghciInsertStrHashTable(obj_name, stablehash, key, getStablePtr(p));
-}
-
-
-/* -----------------------------------------------------------------------------
  * insert a symbol in the hash table
  */
 void
@@ -4974,8 +4957,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
 #ifdef i386_HOST_ARCH
       Elf_Addr  value;
 #endif
-      StgStablePtr stablePtr;
-      StgPtr stableVal;
 #ifdef arm_HOST_ARCH
       int is_target_thm=0, T=0;
 #endif
@@ -4998,16 +4979,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC,
 
          } else {
             symbol = strtab + sym.st_name;
-            stablePtr = (StgStablePtr)lookupHashTable(stablehash, (StgWord)symbol);
-            if (NULL == stablePtr) {
-              /* No, so look up the name in our global table. */
-              S_tmp = lookupSymbol( symbol );
-              S = (Elf_Addr)S_tmp;
-            } else {
-              stableVal = deRefStablePtr( stablePtr );
-              S_tmp = stableVal;
-              S = (Elf_Addr)S_tmp;
-            }
+            S_tmp = lookupSymbol( symbol );
+            S = (Elf_Addr)S_tmp;
          }
          if (!S) {
             errorBelch("%s: unknown symbol `%s'", oc->fileName, symbol);



More information about the ghc-commits mailing list