summaryrefslogtreecommitdiff
path: root/rts/Profiling.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-08-16 19:01:05 -0400
committerBen Gamari <ben@smart-cactus.org>2017-08-16 19:02:28 -0400
commita8da0de27e600211f04601ac737c329d6603c700 (patch)
tree26d759439b11dab3925d9c4723a5c76054f1dacc /rts/Profiling.c
parent6e9c8eb9885f894eed7e01a074ee7d83b251b1b1 (diff)
downloadhaskell-a8da0de27e600211f04601ac737c329d6603c700.tar.gz
Speed up compilation of profiling stubs
Here we encode the cost centre list as static data. This means that the initialization stubs are small functions which should be easy for GCC to compile, even with optimization. Fixes #7960. Test Plan: Test profiling Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #7960 Differential Revision: https://phabricator.haskell.org/D3853
Diffstat (limited to 'rts/Profiling.c')
-rw-r--r--rts/Profiling.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rts/Profiling.c b/rts/Profiling.c
index 9523572887..803f86befc 100644
--- a/rts/Profiling.c
+++ b/rts/Profiling.c
@@ -307,6 +307,25 @@ endProfiling ( void )
}
}
+
+/*
+ These are used in the C stubs produced by the code generator
+ to register code.
+ */
+void registerCcList(CostCentre **cc_list)
+{
+ for (CostCentre **i = cc_list; *i != NULL; i++) {
+ REGISTER_CC(*i);
+ }
+}
+
+void registerCcsList(CostCentreStack **cc_list)
+{
+ for (CostCentreStack **i = cc_list; *i != NULL; i++) {
+ REGISTER_CCS(*i);
+ }
+}
+
/* -----------------------------------------------------------------------------
Set CCCS when entering a function.