Commit 5e32682c authored by Camil Staps's avatar Camil Staps 🙂

Merge branch 'add-NO_PROFILE_GRAPH-to-graph_copy' into 'master'

add NO_PROFILE_GRAPH to graph_copy for ARM

See merge request !8
parents dfedc61f 855f8a75
......@@ -2,11 +2,11 @@
all: copy_graph_to_string.o copy_string_to_graph.o copy_graph_to_string_interface.o copy_string_to_graph_interface.o
copy_graph_to_string.o: copy_graph_to_string.c copy_graph_to_string_implementation.c remove_forwarding_pointers_from_graph_implementation.c
gcc -fomit-frame-pointer -O -c -DLINUX32 copy_graph_to_string.c
gcc -fomit-frame-pointer -O -c -DLINUX32 -DNO_PROFILE_GRAPH copy_graph_to_string.c
cp copy_graph_to_string.o "Clean System Files"/copy_graph_to_string.o
copy_string_to_graph.o: copy_string_to_graph.c
gcc -fomit-frame-pointer -O -c -DLINUX32 copy_string_to_graph.c
gcc -fomit-frame-pointer -O -c -DLINUX32 -DNO_PROFILE_GRAPH copy_string_to_graph.c
cp copy_string_to_graph.o "Clean System Files"/copy_string_to_graph.o
copy_string_to_graph.o: copy_string_to_graph.c copy_string_to_graph_implementation.c
......
......@@ -36,7 +36,9 @@ extern void *INT,*CHAR,*BOOL,*REAL,*__STRING__,*__ARRAY__;
/* 2 for callgraph profiling. When this is turned on, we need to ignore the
* last part of thunks, as it is used for the saved cost centre stack. */
#ifndef NO_PROFILE_GRAPH
extern int profile_type;
#endif
/*inline*/
static void copy (Int *dest_p,Int *source_p,Int n_words)
......@@ -53,22 +55,28 @@ Int *copy_graph_to_string (Int *node_p,void *begin_free_heap,void *end_free_heap
#endif
)
{
#ifndef NO_PROFILE_GRAPH
if (profile_type==2){
#define PROFILE_GRAPH
#include "copy_graph_to_string_implementation.c"
#undef PROFILE_GRAPH
} else {
# define PROFILE_GRAPH
# include "copy_graph_to_string_implementation.c"
# undef PROFILE_GRAPH
} else
#endif
{
#include "copy_graph_to_string_implementation.c"
}
}
void remove_forwarding_pointers_from_graph (Int *node_p,Int **stack_end)
{
#ifndef NO_PROFILE_GRAPH
if (profile_type==2){
#define PROFILE_GRAPH
#include "remove_forwarding_pointers_from_graph_implementation.c"
#undef PROFILE_GRAPH
} else {
# define PROFILE_GRAPH
# include "remove_forwarding_pointers_from_graph_implementation.c"
# undef PROFILE_GRAPH
} else
#endif
{
#include "remove_forwarding_pointers_from_graph_implementation.c"
}
}
......@@ -28,8 +28,10 @@ extern Int small_integers[],static_characters[];
/* 2 for callgraph profiling. In this case, we need to add a pointer argument
* to thunks pointing at the current cost centre. */
#ifndef NO_PROFILE_GRAPH
extern int profile_type;
extern void *profile_current_cost_centre;
#endif
/*inline*/
static void copy (Int *dest_p,Int *source_p,Int n_words)
......@@ -42,11 +44,14 @@ static void copy (Int *dest_p,Int *source_p,Int n_words)
Int *copy_string_to_graph (Int *string_p,void *begin_free_heap,void *end_free_heap,Int **last_heap_pa)
{
#ifndef NO_PROFILE_GRAPH
if (profile_type==2){
#define PROFILE_GRAPH
#include "copy_string_to_graph_implementation.c"
#undef PROFILE_GRAPH
} else {
# define PROFILE_GRAPH
# include "copy_string_to_graph_implementation.c"
# undef PROFILE_GRAPH
} else
#endif
{
#include "copy_string_to_graph_implementation.c"
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment