Commit db3de1a8 authored by John van Groningen's avatar John van Groningen

Merge branch 'add-packed-array-support-to-graphcopy' into 'master'

Support packed arrays in GraphCopy

See merge request !9
parents 2228eeb2 2d214027
......@@ -32,7 +32,7 @@ int is_using_desc_relative_to_array (void)
#endif
}
extern void *INT,*CHAR,*BOOL,*REAL,*__STRING__,*__ARRAY__;
extern void *INT,*INT32,*CHAR,*BOOL,*REAL,*REAL32,*__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. */
......
......@@ -122,6 +122,9 @@ for (;;){
} else if (elem_desc==(Int)&INT+2
#if ARCH_64
|| elem_desc==(Int)&REAL+2
#else
|| elem_desc==(Int)&INT32+2
|| elem_desc==(Int)&REAL32+2
#endif
){
if (heap_p+array_size>(Int*)stack_begin)
......@@ -130,7 +133,17 @@ for (;;){
copy (heap_p,node_p,array_size);
heap_p+=array_size;
break;
#if ! ARCH_64
#if ARCH_64
} else if (elem_desc==(Int)&INT32+2 || elem_desc==(Int)&REAL32+2){
array_size=(array_size+1)>>1;
if (heap_p+array_size>(Int*)stack_begin)
return NULL;
copy (heap_p,node_p,array_size);
heap_p+=array_size;
break;
#else
} else if (elem_desc==(Int)&REAL+2){
array_size<<=1;
......
......@@ -23,7 +23,7 @@
# define USE_DESC_RELATIVE_TO_ARRAY 1
#endif
extern void *INT,*CHAR,*BOOL,*REAL,*__STRING__,*__ARRAY__;
extern void *INT,*INT32,*CHAR,*BOOL,*REAL,*REAL32,*__STRING__,*__ARRAY__;
extern Int small_integers[],static_characters[];
/* 2 for callgraph profiling. In this case, we need to add a pointer argument
......@@ -110,10 +110,17 @@ void remove_forwarding_pointers_from_string (Int *string_p,Int *end_forwarding_p
} else if (elem_desc==(Int)&INT+2
#if ARCH_64
|| elem_desc==(Int)&REAL+2
#else
|| elem_desc==(Int)&INT32+2
|| elem_desc==(Int)&REAL32+2
#endif
){
string_p+=array_size;
#if ! ARCH_64
#if ARCH_64
} else if (elem_desc==(Int)&INT32+2 || elem_desc==(Int)&REAL32+2){
array_size=(array_size+1)>>1;
string_p+=array_size;
#else
} else if (elem_desc==(Int)&REAL+2){
array_size<<=1;
string_p+=array_size;
......
......@@ -170,6 +170,9 @@ for (;;){
} else if (elem_desc==(Int)&INT+2
#if ARCH_64
|| elem_desc==(Int)&REAL+2
#else
|| elem_desc==(Int)&INT32+2
|| elem_desc==(Int)&REAL32+2
#endif
){
n_free_words-=array_size;
......@@ -182,7 +185,21 @@ for (;;){
string_p+=array_size;
heap_p+=array_size;
break;
#if ! ARCH_64
#if ARCH_64
} else if (elem_desc==(Int)&INT32+2 || elem_desc==(Int)&REAL32+2){
array_size=(array_size+1)>>1;
n_free_words-=array_size;
if (n_free_words<0){
*last_heap_pa=heap_p+array_size+(stack_end-stack_begin);
return (Int*)((Int)string_p+1);
}
copy (heap_p,string_p,array_size);
string_p+=array_size;
heap_p+=array_size;
break;
#else
} else if (elem_desc==(Int)&REAL+2){
array_size<<=1;
......
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