Author: nickg
Date: Fri Jan 13 09:19:12 2006
New Revision: 11151
Modified:
branches/nci/include/parrot/nci.h
branches/nci/src/classes/bound_nci.pmc
branches/nci/src/classes/compiler.pmc
branches/nci/src/classes/nci.pmc
branches/nci/src/nci.c
Log:
NCI #9. Update compiler.pmc to call the NCI backend correctly.
The active backend is currently manually selected in nci.c.
Need to understand bound_nci to appreciate how it needs adapting.
Modified: branches/nci/include/parrot/nci.h
==============================================================================
--- branches/nci/include/parrot/nci.h (original)
+++ branches/nci/include/parrot/nci.h Fri Jan 13 09:19:12 2006
@@ -36,6 +36,9 @@ struct nci_vtable {
};
+extern struct nci_vtable nci_builtin_vtable, nci_ffcall_vtable;
+extern struct nci_vtable *nci_vtable_ptr;
+
INTVAL Parrot_get_nci_I(Interp *interpreter, struct call_state *st, int n);
FLOATVAL Parrot_get_nci_N(Interp *interpreter, struct call_state *st, int n);
STRING* Parrot_get_nci_S(Interp *interpreter, struct call_state *st, int n);
Modified: branches/nci/src/classes/bound_nci.pmc
==============================================================================
--- branches/nci/src/classes/bound_nci.pmc (original)
+++ branches/nci/src/classes/bound_nci.pmc Fri Jan 13 09:19:12 2006
@@ -47,6 +47,10 @@ Set the bound object live.
*/
void set_pmc(PMC *obj) {
+
+ /* Need to understand and ensure that this class works */
+ assert (0);
+
PMC_pmc_val(SELF) = obj;
if (!PMC_IS_NULL(obj))
PObj_custom_mark_SET(SELF);
Modified: branches/nci/src/classes/compiler.pmc
==============================================================================
--- branches/nci/src/classes/compiler.pmc (original)
+++ branches/nci/src/classes/compiler.pmc Fri Jan 13 09:19:12 2006
@@ -37,9 +37,10 @@ C<Eval> PMC with a new PackFile attached
*/
void* invoke (void * code_ptr) {
- Parrot_csub_t func = (Parrot_csub_t)D2FPTR(PMC_data(SELF));
INTERP->current_cont = NULL;
- func(INTERP, SELF);
+
+ nci_vtable_ptr->nci_invoke (INTERP, SELF);
+
return code_ptr;
}
}
Modified: branches/nci/src/classes/nci.pmc
==============================================================================
--- branches/nci/src/classes/nci.pmc (original)
+++ branches/nci/src/classes/nci.pmc Fri Jan 13 09:19:12 2006
@@ -25,10 +25,6 @@ The caller has to preserve registers if
#include "parrot/parrot.h"
#include "parrot/method_util.h"
-
-extern struct nci_vtable nci_builtin_vtable, nci_ffcall_vtable;
-struct nci_vtable *nci_vtable_ptr = &nci_builtin_vtable;
-
pmclass NCI need_ext {
/*
Modified: branches/nci/src/nci.c
==============================================================================
--- branches/nci/src/nci.c (original)
+++ branches/nci/src/nci.c Fri Jan 13 09:19:12 2006
@@ -2,6 +2,9 @@
#include "parrot/nci.h"
+/* For now, this selects the active backend */
+struct nci_vtable *nci_vtable_ptr = &nci_ffcall_vtable;
+
INTVAL
Parrot_get_nci_I(Interp *interpreter, struct call_state *st, int n)
{