summaryrefslogtreecommitdiff
path: root/libguile/programs.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-02-01 10:50:45 +0100
committerAndy Wingo <wingo@pobox.com>2009-02-01 10:50:45 +0100
commitac47d5f6399c54bcb39a01bb0ade83a614d625b4 (patch)
tree218be79c6771477492f78ffdaebec67a6f43afec /libguile/programs.c
parent1f1ec13b5c459717b22030565e591f1f713ee39d (diff)
downloadguile-ac47d5f6399c54bcb39a01bb0ade83a614d625b4.tar.gz
avoid 8 words of allocation per lambda, whoooo
* libguile/objcodes.c (scm_bytecode_to_objcode): Check that the length of the vector matches the length embedded in the bytecode. * libguile/programs.c (scm_program_meta): Call through to scm_objcode_meta, instead of looking in the object table. Avoids consing up a program+objcode slice for the meta until the meta is actually called. * libguile/vm-i-loader.c (load-program): Step past the metadata too. * module/language/glil/compile-assembly.scm (make-meta): Just return the load-program form, or #f. (assoc-ref-or-acons, object-index-and-alist, make-object-table): Don't write the meta into the object table. (glil->assembly): Instead write the meta into the load-program form.
Diffstat (limited to 'libguile/programs.c')
-rw-r--r--libguile/programs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libguile/programs.c b/libguile/programs.c
index e9c093a2e..b6dd7c2a6 100644
--- a/libguile/programs.c
+++ b/libguile/programs.c
@@ -178,10 +178,15 @@ SCM_DEFINE (scm_program_meta, "program-meta", 1, 0, 0,
"")
#define FUNC_NAME s_scm_program_meta
{
- SCM objs;
+ SCM metaobj;
+
SCM_VALIDATE_PROGRAM (1, program);
- objs = SCM_PROGRAM_OBJTABLE (program);
- return scm_is_true (objs) ? scm_c_vector_ref (objs, 1) : SCM_BOOL_F;
+
+ metaobj = scm_objcode_meta (SCM_PROGRAM_OBJCODE (program));
+ if (scm_is_true (metaobj))
+ return scm_make_program (metaobj, SCM_BOOL_F, SCM_EOL);
+ else
+ return SCM_BOOL_F;
}
#undef FUNC_NAME