Skip to content

Commit

Permalink
Add nativecall ops to interp.c; stub functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Mar 10, 2014
1 parent 5408eb1 commit ad99d7f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ OBJECTS = src/core/args@obj@ \
src/core/coerce@obj@ \
src/core/dll@obj@ \
src/core/ext@obj@ \
src/core/nativecall@obj@ \
src/core/continuation@obj@ \
src/core/intcache@obj@ \
src/gen/config@obj@ \
Expand Down Expand Up @@ -159,6 +160,7 @@ HEADERS = src/moar.h \
src/core/coerce.h \
src/core/dll.h \
src/core/ext.h \
src/core/nativecall.h \
src/core/continuation.h \
src/core/intcache.h \
src/io/io.h \
Expand Down
15 changes: 15 additions & 0 deletions src/core/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3967,6 +3967,21 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
MVM_args_assert_nameds_used(tc, ctx);
goto NEXT;
}
OP(nativecallbuild):
MVM_nativecall_build(tc, GET_REG(cur_op, 0).o, GET_REG(cur_op, 2).s,
GET_REG(cur_op, 4).s, GET_REG(cur_op, 6).s,
GET_REG(cur_op, 8).o, GET_REG(cur_op, 10).o);
cur_op += 12;
goto NEXT;
OP(nativecallinvoke):
GET_REG(cur_op, 0).o = MVM_nativecall_invoke(tc, GET_REG(cur_op, 2).o,
GET_REG(cur_op, 4).o, GET_REG(cur_op, 6).o);
cur_op += 8;
goto NEXT;
OP(nativecallrefresh):
MVM_nativecall_refresh(tc, GET_REG(cur_op, 0).o);
cur_op += 2;
goto NEXT;
#if MVM_CGOTO
OP_CALL_EXTOP: {
/* Bounds checking? Never heard of that. */
Expand Down
15 changes: 15 additions & 0 deletions src/core/nativecall.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "moar.h"

void MVM_nativecall_build(MVMThreadContext *tc, MVMObject *site, MVMString *lib,
MVMString *sym, MVMString *conv, MVMObject *arg_spec, MVMObject *ret_spec) {
MVM_exception_throw_adhoc(tc, "nativecallbuild NYI");
}

MVMObject * MVM_nativecall_invoke(MVMThreadContext *tc, MVMObject *ret_type,
MVMObject *site, MVMObject *args) {
MVM_exception_throw_adhoc(tc, "nativecallinvoke NYI");
}

void MVM_nativecall_refresh(MVMThreadContext *tc, MVMObject *cthingy) {
MVM_exception_throw_adhoc(tc, "nativecallrefresh NYI");
}
5 changes: 5 additions & 0 deletions src/core/nativecall.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void MVM_nativecall_build(MVMThreadContext *tc, MVMObject *site, MVMString *lib,
MVMString *sym, MVMString *conv, MVMObject *arg_spec, MVMObject *ret_spec);
MVMObject * MVM_nativecall_invoke(MVMThreadContext *tc, MVMObject *ret_type,
MVMObject *site, MVMObject *args);
void MVM_nativecall_refresh(MVMThreadContext *tc, MVMObject *cthingy);
1 change: 1 addition & 0 deletions src/moar.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ typedef double MVMnum64;
#include "core/coerce.h"
#include "core/dll.h"
#include "core/ext.h"
#include "core/nativecall.h"
#include "core/continuation.h"
#include "6model/reprs.h"
#include "6model/reprconv.h"
Expand Down

0 comments on commit ad99d7f

Please sign in to comment.