aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredbrain <redbrain@gcc.gnu.org>2012-03-23 23:46:21 +0000
committerredbrain <redbrain@gcc.gnu.org>2012-03-23 23:46:21 +0000
commit2130ccfe279908d7ebf2d31668d7f9d7f3b211f2 (patch)
treeb07f49801f6c0c9192f5fdd6eff76f052fdfe305
parentae01b2f4b028b3747db9747b1ec41cab56294628 (diff)
cleanup of file names
-rw-r--r--gcc/python/py-dot-pass-check1.c (renamed from gcc/python/py-stmt-pass-check1.c)0
-rw-r--r--gcc/python/py-dot-pass-const_fold.c (renamed from gcc/python/py-stmt-pass-const_fold.c)0
-rw-r--r--gcc/python/py-dot-pass-genericify.c (renamed from gcc/python/py-stmt-pass-lower.c)0
-rw-r--r--gcc/python/py-dot-pass-manager.c (renamed from gcc/python/py-stmt-pass-mangr.c)0
-rw-r--r--gcc/python/py-dot-pass-pretty_print.c (renamed from gcc/python/py-stmt-pass-pretty_print.c)0
-rw-r--r--gcc/python/py-dot-pass-translate.c (renamed from gcc/python/py-stmt-pass-translate.c)0
-rw-r--r--gcc/python/py-dot-pass-types.c (renamed from gcc/python/py-stmt-pass-types.c)0
-rw-r--r--gcc/python/py-il-dot.c (renamed from gcc/python/py-dot.c)0
-rw-r--r--gcc/python/py-il-dot.h (renamed from gcc/python/py-dot.h)0
-rw-r--r--gcc/python/py-pass-sys.h (renamed from gcc/python/py-tree.h)0
-rw-r--r--gcc/python/py-runtime.c (renamed from gcc/python/py-builtins.c)0
-rw-r--r--gcc/python/py-runtime.def0
-rw-r--r--gcc/python/py-runtime.h (renamed from gcc/python/py-builtins.h)0
-rw-r--r--libgpython/runtime/py-runtime.c87
14 files changed, 53 insertions, 34 deletions
diff --git a/gcc/python/py-stmt-pass-check1.c b/gcc/python/py-dot-pass-check1.c
index 43b69e37696..43b69e37696 100644
--- a/gcc/python/py-stmt-pass-check1.c
+++ b/gcc/python/py-dot-pass-check1.c
diff --git a/gcc/python/py-stmt-pass-const_fold.c b/gcc/python/py-dot-pass-const_fold.c
index 28ce7fa2280..28ce7fa2280 100644
--- a/gcc/python/py-stmt-pass-const_fold.c
+++ b/gcc/python/py-dot-pass-const_fold.c
diff --git a/gcc/python/py-stmt-pass-lower.c b/gcc/python/py-dot-pass-genericify.c
index 65a12d4e4e1..65a12d4e4e1 100644
--- a/gcc/python/py-stmt-pass-lower.c
+++ b/gcc/python/py-dot-pass-genericify.c
diff --git a/gcc/python/py-stmt-pass-mangr.c b/gcc/python/py-dot-pass-manager.c
index 917b08262b7..917b08262b7 100644
--- a/gcc/python/py-stmt-pass-mangr.c
+++ b/gcc/python/py-dot-pass-manager.c
diff --git a/gcc/python/py-stmt-pass-pretty_print.c b/gcc/python/py-dot-pass-pretty_print.c
index a2cfd0b6988..a2cfd0b6988 100644
--- a/gcc/python/py-stmt-pass-pretty_print.c
+++ b/gcc/python/py-dot-pass-pretty_print.c
diff --git a/gcc/python/py-stmt-pass-translate.c b/gcc/python/py-dot-pass-translate.c
index 3cd33ac90e5..3cd33ac90e5 100644
--- a/gcc/python/py-stmt-pass-translate.c
+++ b/gcc/python/py-dot-pass-translate.c
diff --git a/gcc/python/py-stmt-pass-types.c b/gcc/python/py-dot-pass-types.c
index 5d9c4937408..5d9c4937408 100644
--- a/gcc/python/py-stmt-pass-types.c
+++ b/gcc/python/py-dot-pass-types.c
diff --git a/gcc/python/py-dot.c b/gcc/python/py-il-dot.c
index 0e88d96992f..0e88d96992f 100644
--- a/gcc/python/py-dot.c
+++ b/gcc/python/py-il-dot.c
diff --git a/gcc/python/py-dot.h b/gcc/python/py-il-dot.h
index 88245cbb10f..88245cbb10f 100644
--- a/gcc/python/py-dot.h
+++ b/gcc/python/py-il-dot.h
diff --git a/gcc/python/py-tree.h b/gcc/python/py-pass-sys.h
index 17c9407b3a3..17c9407b3a3 100644
--- a/gcc/python/py-tree.h
+++ b/gcc/python/py-pass-sys.h
diff --git a/gcc/python/py-builtins.c b/gcc/python/py-runtime.c
index b1972d06e32..b1972d06e32 100644
--- a/gcc/python/py-builtins.c
+++ b/gcc/python/py-runtime.c
diff --git a/gcc/python/py-runtime.def b/gcc/python/py-runtime.def
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/gcc/python/py-runtime.def
diff --git a/gcc/python/py-builtins.h b/gcc/python/py-runtime.h
index 99253902fd3..99253902fd3 100644
--- a/gcc/python/py-builtins.h
+++ b/gcc/python/py-runtime.h
diff --git a/libgpython/runtime/py-runtime.c b/libgpython/runtime/py-runtime.c
index ce869f54cfb..b3ccc6e5afa 100644
--- a/libgpython/runtime/py-runtime.c
+++ b/libgpython/runtime/py-runtime.c
@@ -30,11 +30,11 @@ along with GCC; see the file COPYING3. If not see
unsigned char * __GPY_RR_GLOBL_STACK;
-#define GPY_STACK_SIZE_OFFSET 0
-#define GPY_STACK_DATA_OFFSET SIZEOF_INT
-#define GPY_STACK_PRIMTIVES_OFFSET SIZEOF_INT * 2
-#define GPY_STACK_CALL_OFFSET GPY_STACK_PRIMTIVES_OFFSET + sizeof (gpy_vector_t)
-
+#define GPY_STACK_SIZE_OFFSET 0
+#define GPY_STACK_DATA_OFFSET SIZEOF_INT
+#define GPY_STACK_PRIMTIVES_OFFSET SIZEOF_INT * 2
+#define GPY_STACK_CALL_OFFSET GPY_STACK_PRIMTIVES_OFFSET + sizeof (gpy_vector_t)
+#define GPY_STACK_RETURN_ADDR_OFFSET GPY_STACK_CALL_OFFSET + sizeof (gpy_vector_t)
/*
Runtime stack is the globl state for globals access which
will have read write lock eventually for concurrency
@@ -50,6 +50,8 @@ unsigned char * __GPY_RR_GLOBL_STACK;
-----------------
stack trace (gpy_vector_t)
----------------
+ return address (gpy_object_t *)
+ ----------------
possible more runtime data...
----------------
vector of globl symbols (gpy_object_t **)
@@ -57,11 +59,15 @@ unsigned char * __GPY_RR_GLOBL_STACK;
We will need to add more meta data to this for exceptions and calls etc
*/
-int __GPY_GLOBL_RR_STACK_SIZE = (sizeof (int) * 2) + (sizeof (gpy_vector_t) * 2);
+int __GPY_GLOBL_RR_STACK_SIZE =
+ (sizeof (int) * 2)
+ + (sizeof (gpy_vector_t) * 2)
+ + sizeof (gpy_object_t *);
int __GPY_GLOBL_RR_STACK_DATA_OFFSET = __GPY_GLOBL_RR_STACK_SIZE;
gpy_vector_t * __GPY_GLOBL_CALL_STACK;
gpy_vector_t * __GPY_GLOBL_PRIMTIVES;
+gpy_object_t * __GPY_GLOBL_RETURN_ADDR;
gpy_object_t ** __GPY_GLOBL_RR_STACK_POINTER;
void gpy_rr_init_primitives (void)
@@ -73,47 +79,60 @@ void gpy_rr_init_primitives (void)
void gpy_rr_init_runtime_stack (void)
{
- __GPY_RR_GLOBL_STACK = (unsigned char *)
- gpy_malloc (__GPY_GLOBL_RR_STACK_SIZE);
-
- unsigned char * ptr = __GPY_RR_GLOBL_STACK;
- int * int_slot = ((int*) ptr);
- int_slot[0] = __GPY_GLOBL_RR_STACK_SIZE;
- int_slot[1] = __GPY_GLOBL_RR_STACK_DATA_OFFSET;
-
- ptr += sizeof (int) * 2;
+ __GPY_RR_GLOBL_STACK = gpy_malloc (__GPY_GLOBL_RR_STACK_SIZE);
+
+ unsigned char * pointer = __GPY_GLOBL_RR_STACK;
+ *((int *) pointer) = __GPY_GLOBL_RR_STACK_SIZE;
+ pointer += sizeof (int);
+ *((int *) pointer) = __GPY_GLOBL_RR_STACK_DATA_OFFSET;
+ pointer += sizeof (int);
+
+ gpy_vector_t vec = *((gpy_vector_t *) pointer);
+ gpy_vec_init (&vec);
+ __GPY_GLOBL_PRIMITIVES = &vec;
+
+ pointer += sizeof (gpy_vector_t);
- gpy_vector_t * vec_slot = ((gpy_vector_t *) ptr);
- gpy_vec_init (&vec_slot[0]);
- gpy_vec_init (&vec_slot[1]);
+ vec = *((gpy_vector_t *) pointer);
+ gpy_vec_init (&vec);
+ __GPY_GLOBL_CALL_STACK = &vec;
- __GPY_GLOBL_PRIMTIVES = &vec_slot[0];
- __GPY_GLOBL_CALL_STACK = &vec_slot[1];
+ pointer += sizeof (gpy_vector_t);
+ *((gpy_object_t **) pointer) = NULL;
+ __GPY_GLOBL_RETURN_ADDR = *((gpy_object_t **) pointer);
- ptr += sizeof (gpy_vector_t) * 2;
- __GPY_GLOBL_RR_STACK_POINTER = (gpy_object_t**)ptr;
+ pointer += sizeof (gpy_object_t *);
+ __GPY_GLOBL_RR_STACK_POINTER = (gpy_object_t **) pointer;
}
/* remember to update the stack pointer's and the stack size */
void gpy_rr_extend_runtime_stack (int size)
{
__GPY_GLOBL_RR_STACK_SIZE += size;
- __GPY_GLOBL_RR_STACK = (unsigned char *)
- gpy_realloc (__GPY_GLOBL_RR_STACK, __GPY_GLOBL_RR_STACK_SIZE);
+ __GPY_GLOBL_RR_STACK = gpy_realloc (__GPY_GLOBL_RR_STACK,
+ __GPY_GLOBL_RR_STACK_SIZE);
+ unsigned char * pointer = __GPY_GLOBL_RR_STACK;
+ *((int *) pointer) = __GPY_GLOBL_RR_STACK_SIZE;
+ pointer += sizeof (int);
+ *((int *) pointer) = __GPY_GLOBL_RR_STACK_DATA_OFFSET;
+ pointer += sizeof (int);
+
+ gpy_vector_t vec = *((gpy_vector_t *) pointer);
+ gpy_vec_init (&vec);
+ __GPY_GLOBL_PRIMITIVES = &vec;
- unsigned char * ptr = __GPY_RR_GLOBL_STACK;
- int * int_slot = ((int*) ptr);
- int_slot[0] = __GPY_GLOBL_RR_STACK_SIZE;
- int_slot[1] = __GPY_GLOBL_RR_STACK_DATA_OFFSET;
+ pointer += sizeof (gpy_vector_t);
- ptr += sizeof (int) * 2;
+ vec = *((gpy_vector_t *) pointer);
+ gpy_vec_init (&vec);
+ __GPY_GLOBL_CALL_STACK = &vec;
- gpy_vector_t * vec_slot = ((gpy_vector_t *) ptr);
- __GPY_GLOBL_PRIMTIVES = &vec_slot[0];
- __GPY_GLOBL_CALL_STACK = &vec_slot[1];
+ pointer += sizeof (gpy_vector_t);
+ *((gpy_object_t **) pointer) = NULL;
+ __GPY_GLOBL_RETURN_ADDR = *((gpy_object_t **) pointer);
- ptr += sizeof (gpy_vector_t) * 2;
- __GPY_GLOBL_RR_STACK_POINTER = (gpy_object_t**)ptr;
+ pointer += sizeof (gpy_object_t *);
+ __GPY_GLOBL_RR_STACK_POINTER = (gpy_object_t **) pointer;
}
void gpy_rr_init_runtime (void)