Added spec:commit task to commit changes to spec/ruby sources.
[rbx.git] / shotgun / lib / subtend / nmethod.h
blobca95f453013d6877a4b1fc719bec8c7bbc8cba3a
1 #ifndef __NMETHOD_H__
2 #define __NMETHOD_H__
4 typedef rni_handle* (*nm_stub_ffi)(rni_handle*);
6 struct native_method {
7 #ifdef USE_CINVOKE
8 CInvFunction *prototype;
9 #endif
10 void *entry;
11 int args;
12 nm_stub_ffi stub;
15 typedef struct native_method native_method;
17 #define NMETHOD_FIELDS 7
19 #define nmethod_allocate(st) (object_memory_new_object_mature(st->om, st->global->nmethod, NMETHOD_FIELDS))
20 #define nmethod_get_data(obj) cmethod_get_bytecodes(obj)
21 #define nmethod_set_data(obj, data) cmethod_set_bytecodes(obj, data)
23 #define nmethod_get_args(obj) ((native_method*) BYTES_OF(nmethod_get_data((obj))))->args
24 #define nmethod_set_args(obj,val) (((native_method*) BYTES_OF(nmethod_get_data((nm))))->args = val)
26 #endif