[Git][ghc/ghc][wip/con-info-ghc-debug] Info table rather than closure

Matthew Pickering gitlab at gitlab.haskell.org
Thu Nov 12 14:45:15 UTC 2020



Matthew Pickering pushed to branch wip/con-info-ghc-debug at Glasgow Haskell Compiler / GHC


Commits:
d7068676 by Matthew Pickering at 2020-11-06T17:02:05+00:00
Info table rather than closure

- - - - -


3 changed files:

- includes/rts/IPE.h
- rts/IPE.c
- rts/PrimOps.cmm


Changes:

=====================================
includes/rts/IPE.h
=====================================
@@ -14,4 +14,4 @@
 #pragma once
 
 void registerInfoProvList(InfoProvEnt **cc_list);
-InfoProvEnt * lookupIPE(StgClosure *info);
\ No newline at end of file
+InfoProvEnt * lookupIPE(StgInfoTable *info);
\ No newline at end of file


=====================================
rts/IPE.c
=====================================
@@ -69,18 +69,17 @@ void registerInfoProvList(InfoProvEnt **ent_list)
 
 // MP: TODO: This should not be a linear search, need to improve
 // the IPE_LIST structure
-InfoProvEnt * lookupIPE(StgClosure *clos)
+InfoProvEnt * lookupIPE(StgInfoTable *info)
 {
-    StgInfoTable * info;
-    info = GET_INFO(clos);
     InfoProvEnt *ip, *next;
-    //printf("%p\n", info);
+//    printf("%p\n", info);
     //printf("%p\n\n", clos);
     for (ip = IPE_LIST; ip != NULL; ip = next) {
+//        printf("%p\n", ip->info);
         if (ip->info == info) {
             //printf("Found %p\n", ip->info);
             return ip;
         }
         next = ip->link;
     }
-}
\ No newline at end of file
+}


=====================================
rts/PrimOps.cmm
=====================================
@@ -2412,7 +2412,9 @@ stg_closureSizzezh (P_ clos)
 stg_whereFromzh (P_ clos)
 {
     P_ ipe;
-    (ipe) = foreign "C" lookupIPE(UNTAG(clos) "ptr");
+    W_ info;
+    info = GET_INFO(UNTAG(clos));
+    (ipe) = foreign "C" lookupIPE(info "ptr");
     return (ipe);
 }
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d706867646ba4702a4069b413d7b6b37d66324b7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d706867646ba4702a4069b413d7b6b37d66324b7
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201112/077ad298/attachment-0001.html>


More information about the ghc-commits mailing list