I've imported those changes into the branch
nwc10/feature/gc-header-shrink which might simply review for somebody
who feels confident to do it :-)
Cheers,
Moritz
On 02/06/2014 11:52 AM, Nicholas Clark wrote:
Attached is a rough cut at shrinking the GC header.
It's tidier than the working version, but it still has a lot of assert()s in
it, which aren't (yet) removed by the C pre-processor under --optimize
[However, none fail]
I'm also not very happy with adding a couple of non-inline functions:
commit b575e123dfc6ab49639fec28871247b8fe8bdeab
Author: Nicholas Clark <n...@ccl4.org>
Date: Wed Jan 29 21:41:26 2014 +0100
Encapsulate SC access through MVM_sc_{get,set}_{stable,obj}_sc()
Ideally these would be inline functions.
diff --git a/src/6model/sc.c b/src/6model/sc.c
index 3114bbd..93dc8a5 100644
--- a/src/6model/sc.c
+++ b/src/6model/sc.c
@@ -255,6 +255,16 @@ MVMuint64 MVM_sc_get_object_count(MVMThreadContext *tc,
MVMSerializationContext
return sc->body->num_objects;
}
+/* Gets an object's SC. */
+MVMSerializationContext * MVM_sc_get_obj_sc(MVMThreadContext *tc, MVMObject
*obj) {
+ return obj->header.sc;
+}
+
+/* Gets an STables's SC. */
+MVMSerializationContext * MVM_sc_get_stable_sc(MVMThreadContext *tc, MVMSTable
*st) {
+ return st->header.sc;
+}
+
/* Sets an object's SC. */
void MVM_sc_set_obj_sc(MVMThreadContext *tc, MVMObject *obj,
MVMSerializationContext *sc) {
MVM_ASSIGN_REF(tc, obj, obj->header.sc, sc);
[snip]
diff --git a/src/6model/sc.h b/src/6model/sc.h
index 7edc67d..e449d17 100644
--- a/src/6model/sc.h
+++ b/src/6model/sc.h
@@ -18,6 +18,8 @@ MVMObject * MVM_sc_get_code(MVMThreadContext *tc,
MVMSerializationContext *sc, M
void MVM_sc_set_code(MVMThreadContext *tc, MVMSerializationContext *sc,
MVMint64 idx, MVMObject *code);
void MVM_sc_set_code_list(MVMThreadContext *tc, MVMSerializationContext *sc,
MVMObject *code_list);
MVMuint64 MVM_sc_get_object_count(MVMThreadContext *tc,
MVMSerializationContext *sc);
+MVMSerializationContext * MVM_sc_get_obj_sc(MVMThreadContext *tc, MVMObject
*obj);
+MVMSerializationContext * MVM_sc_get_stable_sc(MVMThreadContext *tc, MVMSTable
*st);
void MVM_sc_set_obj_sc(MVMThreadContext *tc, MVMObject *obj,
MVMSerializationContext *sc);
void MVM_sc_set_stable_sc(MVMThreadContext *tc, MVMSTable *st,
MVMSerializationContext *sc);
MVMSerializationContext * MVM_sc_find_by_handle(MVMThreadContext *tc,
MVMString *handle);
but for now I needed them to hang the assertions off that prove that I'm not
doing anything (*too*) stupid.
Preliminary results [ie 1 run, on a shared machine :-)] suggests that it
reduces RSS size for compiling the setting by 4.8% (roughly what I expected)
and seemingly CPU time by 11% (more than I expected, but I guess all those L2
cache misses now saved were costing us)
Not tested on any 32 bit platform yet.
Not sure what to do next, but currently I'm somewhat sleep deprived after a
long night, to the point of not even being reliably able to operate a kettle,
so there may be errors in this.
Nicholas Clark