[GHC] #11816: Refactor SymbolInfo out of Linker.c
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Type: task | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #11223 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- #11223 added a type `SymbolInfo` to `ObjectCode`. This is adding a larger memory overhead to the RTS then need by. `SymbolInfo` is used to determine if a symbol is weak or not. This information can be moved into it's own structure inside `ObjectCode` like a map. Since the majority of the symbols will not be weak this map should be fairly small. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Type: task | Status: new Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * component: Compiler => Runtime System (Linker) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Phyx- Type: task | Status: new Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * owner: => Phyx- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Phyx- Type: task | Status: patch Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Phab:D2184 Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * status: new => patch * differential: => Phab:D2184 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Phyx- Type: task | Status: closed Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Phab:D2184 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Phyx- Type: task | Status: closed Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Phab:D2184 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"37473722960a1066c3b45c94377ba08769b1375b/ghc" 37473722/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="37473722960a1066c3b45c94377ba08769b1375b" Refactored SymbolInfo to lower memory usage in RTS Previously as part of #11223 a new struct `SymbolInfo` was introduced to keep track it the weak symbol status of a symbol. This structure also kept a copy of the calculated address of the symbol which turns out was useful in ignoring non-weak zero-valued symbols. The information was kept in an array so it means for every symbol two extra bytes were kept even though the vast majority of symbols are non-weak and non-zero valued. This changes the array into a sparse map keeping this information only for the symbols that are weak or zero-valued. This allows for a reduction in the amount of information needed to be kept while giving up a small (negligable) hit in performance as this information now has to be looked up in hashmaps. Test Plan: ./validate on all platforms that use the runtime linker. For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is added to your validate file. Reviewers: simonmar, austin, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2184 GHC Trac Issues: #11816 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Phyx- Type: task | Status: closed Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Phab:D2184 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"079c1b8caed22db2be24f3304c56db56292670e1/ghc" 079c1b8c/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="079c1b8caed22db2be24f3304c56db56292670e1" Use useful names for Symbol Addr and Names in Linker.c Replace `char*` and `void*` with `SymbolName` and `SymbolAddr` in `Linker.c`. Gives some useful information about what the variables are used for and also normalizes the types used in Mac, Linux and Windows Test Plan: ./validate on all platforms that use the runtime linker. For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is added to your validate file. This is a continuation from D2184 Reviewers: austin, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2250 GHC Trac Issues: #11816 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11816: Refactor SymbolInfo out of Linker.c -------------------------------------+------------------------------------- Reporter: Phyx- | Owner: Phyx- Type: task | Status: closed Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.1 (Linker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11223 | Differential Rev(s): Phab:D2184 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"b948a1da7a3929160cb7cb8d6cf2fe79c3081d0a/ghc" b948a1d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="b948a1da7a3929160cb7cb8d6cf2fe79c3081d0a" Refactor the SymbolName and SymbolAddr types to be pointers Take the pointer notation out of the typedef such that it preserves the fact that these are pointers at the use site. Test Plan: ./validate on all platforms that use the runtime linker. For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is added to your validate file. Continuation of D2250 Reviewers: austin, bgamari, simonmar, erikd Reviewed By: erikd Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2302 GHC Trac Issues: #11816 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC