714b77a10d
[CONFIGURATION] * NEW: Add '.jit' directory to '.gitignore'. [COMPILER] * NEW: New '-j' option that disables just in time compilation. * NEW: JIT: Support for private functions calls. * NEW: JIT: Support for native arrays accessors. * BUG: JIT: Fix loop support. * NEW: JIT: Support for GOSUB. [GB.JIT] * NEW: GB_JIT_DEBUG is an environment variable that defines if JIT compilation debugging messages are printed. * NEW: GB_JIT_CFLAGS is an environment variable that defines the JIT compilation flags. The default is "-O3". * NEW: Support for native arrays accessors.
61 lines
1.8 KiB
C
61 lines
1.8 KiB
C
/***************************************************************************
|
|
|
|
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;
|
|
void (*debug)(const char *fmt, ...);
|
|
void (*throw)(int code, ...) NORETURN;
|
|
void *(*get_static_addr)(int index);
|
|
void *(*get_dynamic_addr)(int index);
|
|
JIT_CONSTANT *(*get_constant)(int index);
|
|
void *(*get_class_ref)(int index);
|
|
void **subr_table;
|
|
const char *char_table;
|
|
void *(*unborrow)(VALUE *val);
|
|
void (*new)(void);
|
|
void (*push_array)(ushort code);
|
|
void (*pop_array)(ushort code);
|
|
}
|
|
JIT_INTERFACE;
|
|
|
|
#endif
|