gambas-source-code/main/lib/jit/jit.h
gambas c671adfd6b Work continues on new JIT system.
[INTERPRETER]
* OPT: String searching (Instr, RInstr and Replace) has been made about 4x faster by searching the first occurence with memchr() and memrchr().

[GB.FORM.TERMINAL]
* BUG: Fix warning messages.

[GB.JIT]
* BUG: Fix byte, short and boolean pushing and popping routines.
* BUG: Fix string values referencing.
* BUG: Fix optional argument management.
* NEW: Optimization of bits management subroutines.

[GB.QT4]
* BUG: Delay hooks initialization, because now socket notifiers must not be used before creating the event loop.

[GB.QT5]
* BUG: Delay hooks initialization, because now socket notifiers must not be used before creating the event loop.
2018-06-11 18:56:39 +02:00

87 lines
2.1 KiB
C

/***************************************************************************
jit.h
(c) 2000-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 __JIT_H
#define __JIT_H
#define __GB_COMMON_CASE_H
#include "gb_common.h"
#include "gb_str.h"
#include "gb_pcode.h"
#include "gb_reserved.h"
#include "gbx_type.h"
#include "gbx_class.h"
#include "main.h"
#define T_UNKNOWN 17
#undef TYPE_is_pure_object
#define TYPE_is_pure_object(_type) ((_type) > T_UNKNOWN)
#undef TYPE_is_object
#define TYPE_is_object(_type) ((_type) == T_OBJECT || TYPE_is_pure_object(_type))
#define TYPEID(_type) (TYPE_is_pure_object(_type) ? T_OBJECT : (_type))
enum
{
CALL_UNKNOWN,
CALL_PRIVATE
};
#ifndef __GBC_JIT_C
EXTERN char *JIT_prefix;
EXTERN CLASS *JIT_class;
EXTERN bool JIT_last_print_is_label;
#endif
// jit.c
char *JIT_translate(const char *name, const char *from);
void JIT_section(const char *str);
void JIT_print(const char *fmt, ...);
void JIT_vprint(const char *fmt, va_list args);
const char *JIT_get_type(TYPE type);
const char *JIT_get_gtype(TYPE type);
const char *JIT_get_ctype(TYPE type);
TYPE JIT_ctype_to_type(CTYPE ctype);
const char *JIT_get_default_value(TYPE type);
void JIT_panic(const char *fmt, ...) NORETURN;
int JIT_get_code_size(FUNCTION *func);
int JIT_find_symbol(CLASS *class, const char *name);
void JIT_load_class(CLASS *class);
// jit_translate.c
bool JIT_translate_body(FUNCTION *func, int index);
#endif