2018-05-28 03:18:44 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
gb.jit.h
|
|
|
|
|
|
|
|
(c) 2018 Benoît Minisini <g4mba5@gmail.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GB_JIT_H
|
|
|
|
#define __GB_JIT_H
|
|
|
|
|
|
|
|
typedef
|
|
|
|
union {
|
|
|
|
int type;
|
|
|
|
struct { int type; double value; } PACKED _float;
|
|
|
|
struct { int type; float value; } PACKED _single;
|
|
|
|
struct { int type; int value; } PACKED _integer;
|
|
|
|
struct { int type; int64_t value; } PACKED _long;
|
|
|
|
struct { int type; char *addr; int len; } PACKED _string;
|
|
|
|
struct { int type; int val[2]; } PACKED _swap;
|
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
JIT_CONSTANT;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
VALUE **sp;
|
|
|
|
PCODE **pc;
|
|
|
|
void **cp;
|
|
|
|
void **op;
|
2018-06-01 14:40:07 +02:00
|
|
|
VALUE *ret;
|
2018-05-29 03:43:23 +02:00
|
|
|
void (*debug)(const char *fmt, ...);
|
2018-06-02 17:59:47 +02:00
|
|
|
PCODE *(*get_code)(int index);
|
2018-06-01 03:50:42 +02:00
|
|
|
void (*throw)(int code, ...) NORETURN;
|
2018-05-28 03:18:44 +02:00
|
|
|
void *(*get_static_addr)(int index);
|
|
|
|
void *(*get_dynamic_addr)(int index);
|
|
|
|
JIT_CONSTANT *(*get_constant)(int index);
|
2018-05-29 23:25:57 +02:00
|
|
|
void *(*get_class_ref)(int index);
|
2018-05-28 03:18:44 +02:00
|
|
|
void **subr_table;
|
|
|
|
const char *char_table;
|
2018-05-29 03:43:23 +02:00
|
|
|
void *(*unborrow)(VALUE *val);
|
2018-05-29 23:25:57 +02:00
|
|
|
void (*new)(void);
|
|
|
|
void (*push_array)(ushort code);
|
|
|
|
void (*pop_array)(ushort code);
|
2018-06-02 17:59:47 +02:00
|
|
|
void (*conv)(GB_VALUE *value, GB_TYPE type);
|
|
|
|
void (*push_unknown)(void);
|
|
|
|
void (*call_unknown)(ushort *pc, GB_VALUE *sp);
|
|
|
|
void (*pop_unknown)(void);
|
2018-06-05 11:43:39 +02:00
|
|
|
void (*enum_first)(ushort code, GB_VALUE *local, GB_VALUE *penum);
|
|
|
|
bool (*enum_next)(ushort code, GB_VALUE *local, GB_VALUE *penum);
|
2018-05-28 03:18:44 +02:00
|
|
|
}
|
|
|
|
JIT_INTERFACE;
|
|
|
|
|
|
|
|
#endif
|