2012-05-23 21:26:15 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
2018-05-26 16:50:00 +02:00
|
|
|
gbx_jit.h
|
2012-05-23 21:26:15 +02:00
|
|
|
|
2018-05-26 16:50:00 +02:00
|
|
|
(c) 2018 Benoît Minisini <g4mba5@gmail.com>
|
2012-05-23 21:26:15 +02:00
|
|
|
|
|
|
|
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 __GBX_JIT_H
|
|
|
|
#define __GBX_JIT_H
|
|
|
|
|
|
|
|
#include "gbx_class.h"
|
|
|
|
#include "gbx_type.h"
|
|
|
|
#include "gbx_value.h"
|
|
|
|
#include "gbx_stack.h"
|
|
|
|
#include "gbx_object.h"
|
|
|
|
#include "gbx_exec.h"
|
|
|
|
|
2018-05-26 16:50:00 +02:00
|
|
|
typedef
|
|
|
|
void (*JIT_FUNC)(uchar nparam);
|
2012-05-23 21:26:15 +02:00
|
|
|
|
2019-04-04 22:58:06 +02:00
|
|
|
enum { JIT_NOT_COMPILED = 0, JIT_COMPILING = 1, JIT_COMPILED = 2};
|
|
|
|
|
2018-08-11 07:53:02 +02:00
|
|
|
#ifndef __GBX_JIT_C
|
|
|
|
extern bool JIT_disabled;
|
|
|
|
#endif
|
|
|
|
|
2019-03-11 16:34:50 +01:00
|
|
|
void JIT_compile(ARCHIVE *arch);
|
2018-05-29 03:43:23 +02:00
|
|
|
void JIT_debug(const char *fmt, ...);
|
2019-03-13 12:59:14 +01:00
|
|
|
bool JIT_exec(bool ret_on_stack);
|
2018-07-02 19:37:37 +02:00
|
|
|
PCODE *JIT_get_code(FUNCTION *func);
|
2018-05-28 03:18:44 +02:00
|
|
|
CLASS_CONST *JIT_get_constant(int index);
|
2018-05-29 23:25:57 +02:00
|
|
|
void *JIT_get_class_ref(int index);
|
2018-08-22 09:30:27 +02:00
|
|
|
void JIT_call_unknown(PCODE *pc, VALUE **psp);
|
2012-05-23 21:26:15 +02:00
|
|
|
|
2019-03-11 16:34:50 +01:00
|
|
|
void JIT_abort(void);
|
2021-06-05 14:29:58 +02:00
|
|
|
void JIT_init(void);
|
2018-06-01 03:50:42 +02:00
|
|
|
void JIT_exit(void);
|
|
|
|
|
2018-06-09 22:42:35 +02:00
|
|
|
bool JIT_can_compile(ARCHIVE *arch);
|
|
|
|
|
2018-08-18 15:28:19 +02:00
|
|
|
void JIT_load_class(CLASS *class);
|
2019-06-11 22:32:12 +02:00
|
|
|
void JIT_load_class_without_init(CLASS *class);
|
2018-08-18 15:28:19 +02:00
|
|
|
|
2020-04-06 04:40:47 +02:00
|
|
|
void JIT_add_string_local(GB_STRING *src, GB_STRING val);
|
|
|
|
void JIT_add_string_global(char **pstr, GB_STRING val);
|
|
|
|
|
2012-05-23 21:26:15 +02:00
|
|
|
#endif
|