├── .gitignore ├── libjit ├── include │ ├── Makefile.am │ ├── jit │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── jit-arch-arm.h │ │ ├── jit-meta.h │ │ ├── jit-dump.h │ │ ├── jit-init.h │ │ ├── jit-arch-x86.h │ │ ├── jit.h │ │ ├── jit-opcode-compat.h │ │ ├── jit-vmem.h │ │ ├── jit-arch-generic.h │ │ ├── jit-unwind.h │ │ ├── jit-block.h │ │ ├── jit-dynamic.h │ │ ├── jit-defs.h.in │ │ ├── jit-context.h │ │ ├── jit-apply.h │ │ ├── jit-except.h │ │ ├── jit-arch-x86-64.h │ │ ├── jit-util.h │ │ ├── jit-common.h │ │ ├── jit-memory.h │ │ ├── jit-elf.h │ │ ├── jit-function.h │ │ ├── jit-value.h │ │ ├── jit-walk.h │ │ ├── jit-objmodel-private.h │ │ ├── jit-debugger.h │ │ ├── jit-objmodel.h │ │ ├── jit-type.h │ │ ├── jit-insn.h │ │ ├── jit-plus.h │ │ ├── Makefile.in │ │ └── Makefile │ ├── Makefile.in │ └── Makefile └── jit │ ├── libs │ └── libjit.a │ └── .gitignore ├── Makefile ├── bench ├── bench.sh ├── out.txt └── mandelbrot.bf ├── README.md └── src ├── bf-jit.h └── bf-jit.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.out 3 | bf-jit 4 | -------------------------------------------------------------------------------- /libjit/include/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = jit 3 | -------------------------------------------------------------------------------- /libjit/include/jit/.gitignore: -------------------------------------------------------------------------------- 1 | jit-arch.h 2 | jit-defs.h 3 | jit-opcode.h 4 | -------------------------------------------------------------------------------- /libjit/jit/libs/libjit.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngsankha/bf-jit/master/libjit/jit/libs/libjit.a -------------------------------------------------------------------------------- /libjit/jit/.gitignore: -------------------------------------------------------------------------------- 1 | jit-apply-rules.h 2 | jit-interp-labels.h 3 | jit-interp-opcode.c 4 | jit-interp-opcode.h 5 | jit-opcode.c 6 | *.inc 7 | *.slc 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | LIBJIT_PATH = libjit 2 | LIBJIT_INCLUDE_PATH = $(LIBJIT_PATH)/include 3 | LIBJIT_LIB_PATH = $(LIBJIT_PATH)/jit/libs 4 | LIBJIT_AR = $(LIBJIT_LIB_PATH)/libjit.a 5 | 6 | CC = gcc 7 | LD = gcc 8 | CCOPT = -g -O0 9 | CCFLAGS = -c $(CCOPT) 10 | LDFLAGS = -lpthread -lm -ldl -lrt 11 | 12 | all: bf-jit 13 | 14 | bf-jit: bf-jit.o 15 | $(LD) $^ $(LIBJIT_AR) $(LDFLAGS) -o $@ 16 | 17 | bf-jit.o: src/bf-jit.c 18 | $(CC) -I$(LIBJIT_INCLUDE_PATH) -I. $(CCFLAGS) $^ -o $@ 19 | 20 | clean: 21 | rm -rf *.o bf-jit 22 | 23 | 24 | -------------------------------------------------------------------------------- /bench/bench.sh: -------------------------------------------------------------------------------- 1 | echo "Building mandelbrot.c ..." 2 | gcc -o mandelbrot-unopt.out mandelbrot.c 3 | echo "Building mandelbrot.c (optimized) ..." 4 | gcc -O3 -o mandelbrot-opt.out mandelbrot.c 5 | echo "Running Mandelbrot C (Unoptimized) ..." 6 | time ./mandelbrot-unopt.out > out.txt 7 | echo "Running Mandelbrot C (Optimized) ..." 8 | time ./mandelbrot-opt.out > out.txt 9 | echo "Running Mandelbrot Brainf*ck (Interpreter) ..." 10 | time bf mandelbrot.bf > out.txt 11 | echo "Running Mandelbrot Brainf*ck (JIT) ..." 12 | time ./../bf-jit mandelbrot.bf > out.txt 13 | 14 | -------------------------------------------------------------------------------- /libjit/include/jit/Makefile.am: -------------------------------------------------------------------------------- 1 | ARCH_HEADER = jit-arch-@JIT_ARCH@.h 2 | 3 | BUILT_SOURCES = jit-arch.h jit-opcode.h 4 | 5 | libjitincludedir = $(includedir)/jit 6 | dist_libjitinclude_HEADERS = \ 7 | jit.h \ 8 | jit-apply.h \ 9 | jit-block.h \ 10 | jit-common.h \ 11 | jit-context.h \ 12 | jit-debugger.h \ 13 | jit-defs.h \ 14 | jit-dump.h \ 15 | jit-dynamic.h \ 16 | jit-elf.h \ 17 | jit-except.h \ 18 | jit-function.h \ 19 | jit-init.h \ 20 | jit-insn.h \ 21 | jit-intrinsic.h \ 22 | jit-memory.h \ 23 | jit-meta.h \ 24 | jit-objmodel.h \ 25 | jit-objmodel-private.h \ 26 | jit-opcode-compat.h \ 27 | jit-opcode.h \ 28 | jit-plus.h \ 29 | jit-type.h \ 30 | jit-unwind.h \ 31 | jit-util.h \ 32 | jit-value.h \ 33 | jit-vmem.h \ 34 | jit-walk.h 35 | 36 | nodist_libjitinclude_HEADERS = \ 37 | jit-arch.h 38 | 39 | noinst_HEADERS = jit-arch-generic.h jit-arch-x86.h jit-arch-x86-64.h 40 | 41 | DISTCLEANFILES = jit-arch.h jit-defs.h jit-opcode.h 42 | 43 | jit-arch.h: $(ARCH_HEADER) 44 | rm -f $@ 45 | $(LN_S) $(srcdir)/$(ARCH_HEADER) $@ 46 | 47 | jit-opcode.h: $(top_srcdir)/jit/jit-opcodes.ops 48 | $(top_builddir)/tools/gen-ops -H $(top_srcdir)/jit/jit-opcodes.ops >jit-opcode.h 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Brainf*ck JIT 2 | 3 | A JIT compiler for Brainf*ck programs made using LibJIT. 4 | 5 | It does very naive optimizations right now, like folding of multiple same instructions into one. 6 | 7 | Blog post about the same is [here](http://thelimbeck.wordpress.com/2013/12/31/a-brainfck-jit/). 8 | 9 | ## Build Instructions 10 | 11 | * Download and build [LibJIT](http://www.gnu.org/software/libjit/). I have a compiled version for my own system (Linux 32-bit) in the repo itself, you can use that. 12 | * Update the `LIBJIT_PATH` variable in the `Makefile` if you are using your own LibJIT binaries. 13 | * Run `make`. 14 | 15 | ## Benchmarks 16 | 17 | The `bench` folder has a `bench.sh` script that tests the Mandelbrot program with different implementations. The results on my system are: 18 | 19 | ``` 20 | Implementation Time 21 | ---------------------------------------- 22 | Mandelbrot (C Unoptimized) 22.343s 23 | Mandelbrot (C Optimized) 1.241s 24 | Mandelbrot (BF Interpreter) 8.304s 25 | Mandelbrot (BF JIT) 1.609s 26 | ``` 27 | 28 | The unoptimized JIT is 5x faster than the optimizing interpreter and almost at par with the optimized C code. 29 | -------------------------------------------------------------------------------- /src/bf-jit.h: -------------------------------------------------------------------------------- 1 | #ifndef BF_JIT 2 | 3 | #define BF_JIT 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | struct bf_loop { 10 | jit_label_t start; 11 | jit_label_t stop; 12 | struct bf_loop *parent; 13 | }; 14 | typedef struct bf_loop *bf_loop_t; 15 | 16 | typedef struct ops { 17 | char token; 18 | int count; 19 | } ops; 20 | 21 | void loop_start(jit_function_t, bf_loop_t*); 22 | void loop_stop(jit_function_t, bf_loop_t*); 23 | jit_function_t bf_compile(jit_context_t, FILE*); 24 | void emitOpcodes(jit_function_t, jit_value_t, ops*); 25 | void emitIncrement(jit_function_t, jit_value_t, ops*); 26 | void emitDecrement(jit_function_t, jit_value_t, ops*); 27 | void emitIncrementPtr(jit_function_t, jit_value_t, ops*); 28 | void emitDecrementPtr(jit_function_t, jit_value_t, ops*); 29 | jit_type_t ubyte_ptr; 30 | 31 | #define OPTIMIZE_TOKEN(x) if(unit->token == x) \ 32 | unit->count++; \ 33 | else { \ 34 | emitOpcodes(function, ptr, unit); \ 35 | unit->token = x; \ 36 | unit->count = 1; \ 37 | } \ 38 | break; 39 | 40 | #endif -------------------------------------------------------------------------------- /libjit/include/jit/jit-arch-arm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-arch-arm.h - Architecture-specific definitions. 3 | * 4 | * Copyright (C) 2006 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_ARCH_ARM_H 22 | #define _JIT_ARCH_ARM_H 23 | 24 | /* 25 | * If defined _JIT_ARCH_GET_CURRENT_FRAME() macro assigns the current frame 26 | * pointer to the supplied argument that has to be a void pointer. 27 | */ 28 | #if defined(__GNUC__) 29 | #define _JIT_ARCH_GET_CURRENT_FRAME(f) \ 30 | do { \ 31 | register void *__f asm("fp"); \ 32 | f = __f; \ 33 | } while(0) 34 | #else 35 | #undef _JIT_ARCH_GET_CURRENT_FRAME 36 | #endif 37 | 38 | #endif /* _JIT_ARCH_ARM_H */ 39 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-meta.h - Manipulate lists of metadata values. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_META_H 22 | #define _JIT_META_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct _jit_meta *jit_meta_t; 31 | 32 | int jit_meta_set 33 | (jit_meta_t *list, int type, void *data, 34 | jit_meta_free_func free_data, jit_function_t pool_owner) JIT_NOTHROW; 35 | void *jit_meta_get(jit_meta_t list, int type) JIT_NOTHROW; 36 | void jit_meta_free(jit_meta_t *list, int type) JIT_NOTHROW; 37 | void jit_meta_destroy(jit_meta_t *list) JIT_NOTHROW; 38 | 39 | #ifdef __cplusplus 40 | }; 41 | #endif 42 | 43 | #endif /* _JIT_META_H */ 44 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-dump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-dump.h - Functions for dumping JIT structures, for debugging. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_DUMP_H 22 | #define _JIT_DUMP_H 23 | 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | void jit_dump_type(FILE *stream, jit_type_t type) JIT_NOTHROW; 32 | void jit_dump_value 33 | (FILE *stream, jit_function_t func, 34 | jit_value_t value, const char *prefix) JIT_NOTHROW; 35 | void jit_dump_insn 36 | (FILE *stream, jit_function_t func, jit_insn_t insn) JIT_NOTHROW; 37 | void jit_dump_function 38 | (FILE *stream, jit_function_t func, const char *name) JIT_NOTHROW; 39 | 40 | #ifdef __cplusplus 41 | }; 42 | #endif 43 | 44 | #endif /* _JIT_DUMP_H */ 45 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-init.h - Initialization routines for the JIT. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_INIT_H 22 | #define _JIT_INIT_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | void jit_init(void) JIT_NOTHROW; 31 | 32 | int jit_uses_interpreter(void) JIT_NOTHROW; 33 | 34 | int jit_supports_threads(void) JIT_NOTHROW; 35 | 36 | int jit_supports_virtual_memory(void) JIT_NOTHROW; 37 | 38 | int jit_supports_closures(void); 39 | 40 | unsigned int jit_get_closure_size(void); 41 | unsigned int jit_get_closure_alignment(void); 42 | unsigned int jit_get_trampoline_size(void); 43 | unsigned int jit_get_trampoline_alignment(void); 44 | 45 | #ifdef __cplusplus 46 | }; 47 | #endif 48 | 49 | #endif /* _JIT_INIT_H */ 50 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-arch-x86.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-arch-x86.h - Architecture-specific definitions. 3 | * 4 | * Copyright (C) 2006 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_ARCH_X86_H 22 | #define _JIT_ARCH_X86_H 23 | 24 | /* 25 | * If defined _JIT_ARCH_GET_CURRENT_FRAME() macro assigns the current frame 26 | * pointer to the supplied argument that has to be a void pointer. 27 | */ 28 | #if defined(__GNUC__) 29 | #define _JIT_ARCH_GET_CURRENT_FRAME(f) \ 30 | do { \ 31 | register void *__f asm("ebp"); \ 32 | f = __f; \ 33 | } while(0) 34 | #elif defined(_MSC_VER) && defined(_M_IX86) 35 | #define _JIT_ARCH_GET_CURRENT_FRAME(f) \ 36 | do { \ 37 | void *__ptr; \ 38 | __asm \ 39 | { \ 40 | __asm mov dword ptr __ptr, ebp \ 41 | } \ 42 | (f) = __ptr; \ 43 | } while(0) 44 | #else 45 | #undef _JIT_ARCH_GET_CURRENT_FRAME 46 | #endif 47 | 48 | #endif /* _JIT_ARCH_X86_H */ 49 | -------------------------------------------------------------------------------- /libjit/include/jit/jit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit.h - General definitions for JIT back-ends. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_H 22 | #define _JIT_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | #ifdef __cplusplus 51 | }; 52 | #endif 53 | 54 | #endif /* _JIT_H */ 55 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-opcode-compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-opcode-compat.h - Definition of obsolete opcodes for compatibility 3 | * reasons. 4 | * 5 | * Copyright (C) 2011 Southern Storm Software, Pty Ltd. 6 | * 7 | * The libjit library is free software: you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation, either version 2.1 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * The libjit library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with the libjit library. If not, see 19 | * . 20 | */ 21 | 22 | #ifndef _JIT_OPCODE_COMPAT_H 23 | #define _JIT_OPCODE_COMPAT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* 30 | * Some obsolete opcodes that have been removed because they are duplicates 31 | * of other opcodes. 32 | */ 33 | #define JIT_OP_FEQ_INV JIT_OP_FEQ 34 | #define JIT_OP_FNE_INV JIT_OP_FNE 35 | #define JIT_OP_DEQ_INV JIT_OP_DEQ 36 | #define JIT_OP_DNE_INV JIT_OP_DNE 37 | #define JIT_OP_NFEQ_INV JIT_OP_NFEQ 38 | #define JIT_OP_NFNE_INV JIT_OP_NFNE 39 | #define JIT_OP_BR_FEQ_INV JIT_OP_BR_FEQ 40 | #define JIT_OP_BR_FNE_INV JIT_OP_BR_FNE 41 | #define JIT_OP_BR_DEQ_INV JIT_OP_BR_DEQ 42 | #define JIT_OP_BR_DNE_INV JIT_OP_BR_DNE 43 | #define JIT_OP_BR_NFEQ_INV JIT_OP_BR_NFEQ 44 | #define JIT_OP_BR_NFNE_INV JIT_OP_BR_NFNE 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* _JIT_VMEM_H */ 51 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-vmem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-vmem.h - Virtual memory routines. 3 | * 4 | * Copyright (C) 2011 Aleksey Demakov 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_VMEM_H 22 | #define _JIT_VMEM_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef enum { 31 | JIT_PROT_NONE, 32 | JIT_PROT_READ, 33 | JIT_PROT_READ_WRITE, 34 | JIT_PROT_EXEC_READ, 35 | JIT_PROT_EXEC_READ_WRITE, 36 | } jit_prot_t; 37 | 38 | 39 | void jit_vmem_init(void); 40 | 41 | jit_uint jit_vmem_page_size(void); 42 | jit_nuint jit_vmem_round_up(jit_nuint value); 43 | jit_nuint jit_vmem_round_down(jit_nuint value); 44 | 45 | void *jit_vmem_reserve(jit_uint size); 46 | void *jit_vmem_reserve_committed(jit_uint size, jit_prot_t prot); 47 | int jit_vmem_release(void *addr, jit_uint size); 48 | 49 | int jit_vmem_commit(void *addr, jit_uint size, jit_prot_t prot); 50 | int jit_vmem_decommit(void *addr, jit_uint size); 51 | 52 | int jit_vmem_protect(void *addr, jit_uint size, jit_prot_t prot); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* _JIT_VMEM_H */ 59 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-arch-generic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-arch-generic.h - Architecture-specific definitions. 3 | * 4 | * Copyright (C) 2006 Southern Storm Software, Pty Ltd. 5 | * 6 | * This file is part of the libjit library. 7 | * 8 | * The libjit library is free software: you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation, either version 2.1 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * The libjit library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with the libjit library. If not, see 20 | * . 21 | */ 22 | 23 | #ifndef _JIT_ARCH_GENERIC_H 24 | #define _JIT_ARCH_GENERIC_H 25 | 26 | /* 27 | * If defined _JIT_ARCH_GET_CURRENT_FRAME() macro assigns the current frame 28 | * pointer to the supplied argument that has to be a void pointer. 29 | */ 30 | #undef _JIT_ARCH_GET_CURRENT_FRAME 31 | 32 | /* 33 | * If defined _JIT_ARCH_GET_NEXT_FRAME() assigns the frame address following 34 | * the frame supplied as second arg to the value supplied as first argument. 35 | */ 36 | #undef _JIT_ARCH_GET_NEXT_FRAME 37 | 38 | /* 39 | * If defined _JIT_ARCH_GET_RETURN_ADDRESS() assigns the return address of 40 | * the frame supplied as second arg to the value supplied as first argument. 41 | */ 42 | #undef _JIT_ARCH_GET_RETURN_ADDRESS 43 | 44 | /* 45 | * If defined _JIT_ARCH_GET_CURRENT_RETURN() assigns the return address of 46 | * the current to the supplied argument. 47 | */ 48 | #define _JIT_ARCH_GET_CURRENT_RETURN 49 | 50 | #endif /* _JIT_ARCH_GENERIC_H */ 51 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-unwind.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-unwind.h - Routines for performing stack unwinding. 3 | * 4 | * Copyright (C) 2008 Southern Storm Software, Pty Ltd. 5 | * 6 | * This file is part of the libjit library. 7 | * 8 | * The libjit library is free software: you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation, either version 2.1 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * The libjit library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with the libjit library. If not, see 20 | * . 21 | */ 22 | 23 | #ifndef _JIT_UNWIND_H 24 | #define _JIT_UNWIND_H 25 | 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | typedef struct 34 | { 35 | void *frame; 36 | void *cache; 37 | jit_context_t context; 38 | #ifdef _JIT_ARCH_UNWIND_DATA 39 | _JIT_ARCH_UNWIND_DATA 40 | #endif 41 | } jit_unwind_context_t; 42 | 43 | int jit_unwind_init(jit_unwind_context_t *unwind, jit_context_t context); 44 | void jit_unwind_free(jit_unwind_context_t *unwind); 45 | 46 | int jit_unwind_next(jit_unwind_context_t *unwind); 47 | int jit_unwind_next_pc(jit_unwind_context_t *unwind); 48 | void *jit_unwind_get_pc(jit_unwind_context_t *unwind); 49 | 50 | int jit_unwind_jump(jit_unwind_context_t *unwind, void *pc); 51 | 52 | jit_function_t jit_unwind_get_function(jit_unwind_context_t *unwind); 53 | unsigned int jit_unwind_get_offset(jit_unwind_context_t *unwind); 54 | 55 | #ifdef __cplusplus 56 | }; 57 | #endif 58 | 59 | #endif /* _JIT_UNWIND_H */ 60 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-block.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-block.h - Functions for manipulating blocks. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_BLOCK_H 22 | #define _JIT_BLOCK_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | jit_function_t jit_block_get_function(jit_block_t block) JIT_NOTHROW; 31 | jit_context_t jit_block_get_context(jit_block_t block) JIT_NOTHROW; 32 | jit_label_t jit_block_get_label(jit_block_t block) JIT_NOTHROW; 33 | jit_label_t jit_block_get_next_label(jit_block_t block, 34 | jit_label_t label) JIT_NOTHROW; 35 | jit_block_t jit_block_next(jit_function_t func, 36 | jit_block_t previous) JIT_NOTHROW; 37 | jit_block_t jit_block_previous(jit_function_t func, 38 | jit_block_t previous) JIT_NOTHROW; 39 | jit_block_t jit_block_from_label(jit_function_t func, 40 | jit_label_t label) JIT_NOTHROW; 41 | int jit_block_set_meta(jit_block_t block, int type, void *data, 42 | jit_meta_free_func free_data) JIT_NOTHROW; 43 | void *jit_block_get_meta(jit_block_t block, int type) JIT_NOTHROW; 44 | void jit_block_free_meta(jit_block_t block, int type) JIT_NOTHROW; 45 | int jit_block_is_reachable(jit_block_t block) JIT_NOTHROW; 46 | int jit_block_ends_in_dead(jit_block_t block) JIT_NOTHROW; 47 | int jit_block_current_is_dead(jit_function_t func) JIT_NOTHROW; 48 | 49 | #ifdef __cplusplus 50 | }; 51 | #endif 52 | 53 | #endif /* _JIT_BLOCK_H */ 54 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-dynamic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-dynamic.h - Managing dynamic libraries and cross-language invocation. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_DYNAMIC_H 22 | #define _JIT_DYNAMIC_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Dynamic library routines. 32 | */ 33 | typedef void *jit_dynlib_handle_t; 34 | jit_dynlib_handle_t jit_dynlib_open(const char *name) JIT_NOTHROW; 35 | void jit_dynlib_close(jit_dynlib_handle_t handle) JIT_NOTHROW; 36 | void *jit_dynlib_get_symbol 37 | (jit_dynlib_handle_t handle, const char *symbol) JIT_NOTHROW; 38 | const char *jit_dynlib_get_suffix(void) JIT_NOTHROW; 39 | void jit_dynlib_set_debug(int flag) JIT_NOTHROW; 40 | 41 | /* 42 | * C++ name mangling definitions. 43 | */ 44 | #define JIT_MANGLE_PUBLIC 0x0001 45 | #define JIT_MANGLE_PROTECTED 0x0002 46 | #define JIT_MANGLE_PRIVATE 0x0003 47 | #define JIT_MANGLE_STATIC 0x0008 48 | #define JIT_MANGLE_VIRTUAL 0x0010 49 | #define JIT_MANGLE_CONST 0x0020 50 | #define JIT_MANGLE_EXPLICIT_THIS 0x0040 51 | #define JIT_MANGLE_IS_CTOR 0x0080 52 | #define JIT_MANGLE_IS_DTOR 0x0100 53 | #define JIT_MANGLE_BASE 0x0200 54 | char *jit_mangle_global_function 55 | (const char *name, jit_type_t signature, int form) JIT_NOTHROW; 56 | char *jit_mangle_member_function 57 | (const char *class_name, const char *name, 58 | jit_type_t signature, int form, int flags) JIT_NOTHROW; 59 | 60 | #ifdef __cplusplus 61 | }; 62 | #endif 63 | 64 | #endif /* _JIT_DYNAMIC_H */ 65 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-defs.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-defs.h - Define the primitive numeric types for use by the JIT. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_DEFS_H 22 | #define _JIT_DEFS_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #ifdef _MSC_VER 29 | #define JIT_EXPORT_DATA extern __declspec(dllimport) 30 | #else 31 | #define JIT_EXPORT_DATA extern 32 | #endif 33 | 34 | @JIT_INT64_INCLUDE@ 35 | 36 | typedef @JITINT8@ jit_sbyte; 37 | typedef @JITUINT8@ jit_ubyte; 38 | typedef @JITINT16@ jit_short; 39 | typedef unsigned @JITINT16@ jit_ushort; 40 | typedef @JITINT32@ jit_int; 41 | typedef unsigned @JITINT32@ jit_uint; 42 | typedef @JITNATIVEINT@ jit_nint; 43 | typedef unsigned @JITNATIVEINT@ jit_nuint; 44 | #if defined(__cplusplus) && defined(__GNUC__) 45 | typedef @JITINT64CXX@ jit_long; 46 | typedef unsigned @JITINT64CXX@ jit_ulong; 47 | #else 48 | typedef @JITINT64@ jit_long; 49 | typedef unsigned @JITINT64@ jit_ulong; 50 | #endif 51 | typedef @JITFLOAT32@ jit_float32; 52 | typedef @JITFLOAT64@ jit_float64; 53 | typedef @JITNATIVEFLOAT@ jit_nfloat; 54 | typedef void *jit_ptr; 55 | 56 | #define @JITNATIVEINTDEFINE@ 1 57 | @JITNFLOATISDOUBLE@ 58 | 59 | #if defined(__cplusplus) && defined(__GNUC__) 60 | #define JIT_NOTHROW @JITTHROWIDIOM@ 61 | #else 62 | #define JIT_NOTHROW 63 | #endif 64 | 65 | #define jit_min_int (((jit_int)1) << (sizeof(jit_int) * 8 - 1)) 66 | #define jit_max_int ((jit_int)(~jit_min_int)) 67 | #define jit_max_uint ((jit_uint)(~((jit_uint)0))) 68 | #define jit_min_long (((jit_long)1) << (sizeof(jit_long) * 8 - 1)) 69 | #define jit_max_long ((jit_long)(~jit_min_long)) 70 | #define jit_max_ulong ((jit_ulong)(~((jit_ulong)0))) 71 | 72 | #ifdef __cplusplus 73 | }; 74 | #endif 75 | 76 | #endif /* _JIT_DEFS_H */ 77 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-context.h - Functions for manipulating JIT contexts. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_CONTEXT_H 22 | #define _JIT_CONTEXT_H 23 | 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | jit_context_t jit_context_create(void) JIT_NOTHROW; 32 | void jit_context_destroy(jit_context_t context) JIT_NOTHROW; 33 | 34 | void jit_context_build_start(jit_context_t context) JIT_NOTHROW; 35 | void jit_context_build_end(jit_context_t context) JIT_NOTHROW; 36 | 37 | void jit_context_set_on_demand_driver( 38 | jit_context_t context, 39 | jit_on_demand_driver_func driver) JIT_NOTHROW; 40 | 41 | void jit_context_set_memory_manager( 42 | jit_context_t context, 43 | jit_memory_manager_t manager) JIT_NOTHROW; 44 | 45 | int jit_context_set_meta 46 | (jit_context_t context, int type, void *data, 47 | jit_meta_free_func free_data) JIT_NOTHROW; 48 | int jit_context_set_meta_numeric 49 | (jit_context_t context, int type, jit_nuint data) JIT_NOTHROW; 50 | void *jit_context_get_meta(jit_context_t context, int type) JIT_NOTHROW; 51 | jit_nuint jit_context_get_meta_numeric 52 | (jit_context_t context, int type) JIT_NOTHROW; 53 | void jit_context_free_meta(jit_context_t context, int type) JIT_NOTHROW; 54 | 55 | /* 56 | * Standard meta values for builtin configurable options. 57 | */ 58 | #define JIT_OPTION_CACHE_LIMIT 10000 59 | #define JIT_OPTION_CACHE_PAGE_SIZE 10001 60 | #define JIT_OPTION_PRE_COMPILE 10002 61 | #define JIT_OPTION_DONT_FOLD 10003 62 | #define JIT_OPTION_POSITION_INDEPENDENT 10004 63 | #define JIT_OPTION_CACHE_MAX_PAGE_FACTOR 10005 64 | 65 | #ifdef __cplusplus 66 | }; 67 | #endif 68 | 69 | #endif /* _JIT_CONTEXT_H */ 70 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-apply.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-apply.h - Dynamic invocation and closure support functions. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * This file is part of the libjit library. 7 | * 8 | * The libjit library is free software: you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation, either version 2.1 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * The libjit library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with the libjit library. If not, see 20 | * . 21 | */ 22 | 23 | #ifndef _JIT_APPLY_H 24 | #define _JIT_APPLY_H 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* 33 | * Prototype for closure functions. 34 | */ 35 | typedef void (*jit_closure_func)(jit_type_t signature, void *result, 36 | void **args, void *user_data); 37 | 38 | /* 39 | * Opaque type for accessing vararg parameters on closures. 40 | */ 41 | typedef struct jit_closure_va_list *jit_closure_va_list_t; 42 | 43 | /* 44 | * External function declarations. 45 | */ 46 | void jit_apply(jit_type_t signature, void *func, 47 | void **args, unsigned int num_fixed_args, 48 | void *return_value); 49 | void jit_apply_raw(jit_type_t signature, void *func, 50 | void *args, void *return_value); 51 | int jit_raw_supported(jit_type_t signature); 52 | 53 | void *jit_closure_create(jit_context_t context, jit_type_t signature, 54 | jit_closure_func func, void *user_data); 55 | 56 | jit_nint jit_closure_va_get_nint(jit_closure_va_list_t va); 57 | jit_nuint jit_closure_va_get_nuint(jit_closure_va_list_t va); 58 | jit_long jit_closure_va_get_long(jit_closure_va_list_t va); 59 | jit_ulong jit_closure_va_get_ulong(jit_closure_va_list_t va); 60 | jit_float32 jit_closure_va_get_float32(jit_closure_va_list_t va); 61 | jit_float64 jit_closure_va_get_float64(jit_closure_va_list_t va); 62 | jit_nfloat jit_closure_va_get_nfloat(jit_closure_va_list_t va); 63 | void *jit_closure_va_get_ptr(jit_closure_va_list_t va); 64 | void jit_closure_va_get_struct(jit_closure_va_list_t va, void *buf, jit_type_t type); 65 | 66 | #ifdef __cplusplus 67 | }; 68 | #endif 69 | 70 | #endif /* _JIT_APPLY_H */ 71 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-except.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-except.h - Exception handling functions. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_EXCEPT_H 22 | #define _JIT_EXCEPT_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Builtin exception type codes, and result values for intrinsic functions. 32 | */ 33 | #define JIT_RESULT_OK (1) 34 | #define JIT_RESULT_OVERFLOW (0) 35 | #define JIT_RESULT_ARITHMETIC (-1) 36 | #define JIT_RESULT_DIVISION_BY_ZERO (-2) 37 | #define JIT_RESULT_COMPILE_ERROR (-3) 38 | #define JIT_RESULT_OUT_OF_MEMORY (-4) 39 | #define JIT_RESULT_NULL_REFERENCE (-5) 40 | #define JIT_RESULT_NULL_FUNCTION (-6) 41 | #define JIT_RESULT_CALLED_NESTED (-7) 42 | #define JIT_RESULT_OUT_OF_BOUNDS (-8) 43 | #define JIT_RESULT_UNDEFINED_LABEL (-9) 44 | #define JIT_RESULT_MEMORY_FULL (-10000) 45 | 46 | /* 47 | * Exception handling function for builtin exceptions. 48 | */ 49 | typedef void *(*jit_exception_func)(int exception_type); 50 | 51 | /* 52 | * External function declarations. 53 | */ 54 | void *jit_exception_get_last(void); 55 | void *jit_exception_get_last_and_clear(void); 56 | void jit_exception_set_last(void *object); 57 | void jit_exception_clear_last(void); 58 | void jit_exception_throw(void *object); 59 | void jit_exception_builtin(int exception_type); 60 | jit_exception_func jit_exception_set_handler(jit_exception_func handler); 61 | jit_exception_func jit_exception_get_handler(void); 62 | jit_stack_trace_t jit_exception_get_stack_trace(void); 63 | unsigned int jit_stack_trace_get_size(jit_stack_trace_t trace); 64 | jit_function_t jit_stack_trace_get_function(jit_context_t context, 65 | jit_stack_trace_t trace, 66 | unsigned int posn); 67 | void *jit_stack_trace_get_pc(jit_stack_trace_t trace, unsigned int posn); 68 | unsigned int jit_stack_trace_get_offset(jit_context_t context, 69 | jit_stack_trace_t trace, 70 | unsigned int posn); 71 | void jit_stack_trace_free(jit_stack_trace_t trace); 72 | 73 | #ifdef __cplusplus 74 | }; 75 | #endif 76 | 77 | #endif /* _JIT_EXCEPT_H */ 78 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-arch-x86-64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-arch-x86.h - Architecture-specific definitions. 3 | * 4 | * Copyright (C) 2008 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_ARCH_X86_64_H 22 | #define _JIT_ARCH_X86_64_H 23 | 24 | /* 25 | * The frame header structure for X86_64 26 | */ 27 | typedef struct _jit_arch_frame _jit_arch_frame_t; 28 | struct _jit_arch_frame 29 | { 30 | _jit_arch_frame_t *next_frame; 31 | void *return_address; 32 | }; 33 | 34 | /* 35 | * If defined _JIT_ARCH_GET_CURRENT_FRAME() macro assigns the current frame 36 | * pointer to the supplied argument that has to be a void pointer. 37 | */ 38 | #if defined(__GNUC__) 39 | #define _JIT_ARCH_GET_CURRENT_FRAME(f) \ 40 | do { \ 41 | register void *__f asm("rbp"); \ 42 | f = __f; \ 43 | } while(0) 44 | #elif defined(_MSC_VER) && defined(_M_IX86) 45 | #define _JIT_ARCH_GET_CURRENT_FRAME(f) \ 46 | do { \ 47 | void *__ptr; \ 48 | __asm \ 49 | { \ 50 | __asm mov qword ptr __ptr, rbp \ 51 | } \ 52 | (f) = __ptr; \ 53 | } while(0) 54 | #else 55 | #undef _JIT_ARCH_GET_CURRENT_FRAME 56 | #endif 57 | 58 | /* 59 | * If defined _JIT_ARCH_GET_NEXT_FRAME() assigns the frame address following 60 | * the frame supplied as second arg to the value supplied as first argument. 61 | */ 62 | #define _JIT_ARCH_GET_NEXT_FRAME(n, f) \ 63 | do { \ 64 | (n) = (void *)((f) ? ((_jit_arch_frame_t *)(f))->next_frame : 0); \ 65 | } while(0) 66 | 67 | /* 68 | * If defined _JIT_ARCH_GET_RETURN_ADDRESS() assigns the return address of 69 | * the frame supplied as second arg to the value supplied as first argument. 70 | */ 71 | #define _JIT_ARCH_GET_RETURN_ADDRESS(r, f) \ 72 | do { \ 73 | (r) = (void *)((f) ? ((_jit_arch_frame_t *)(f))->return_address : 0); \ 74 | } while(0) 75 | 76 | /* 77 | * If defined _JIT_ARCH_GET_CURRENT_RETURN() assigns the return address of 78 | * the current to the supplied argument. 79 | */ 80 | #define _JIT_ARCH_GET_CURRENT_RETURN(r) \ 81 | do { \ 82 | void *__frame; \ 83 | _JIT_ARCH_GET_CURRENT_FRAME(__frame); \ 84 | _JIT_ARCH_GET_RETURN_ADDRESS((r), __frame); \ 85 | } while(0) 86 | 87 | #endif /* _JIT_ARCH_X86_64_H */ 88 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-util.h - Utility functions. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_UTIL_H 22 | #define _JIT_UTIL_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Memory allocation routines. 32 | */ 33 | void *jit_malloc(unsigned int size) JIT_NOTHROW; 34 | void *jit_calloc(unsigned int num, unsigned int size) JIT_NOTHROW; 35 | void *jit_realloc(void *ptr, unsigned int size) JIT_NOTHROW; 36 | void jit_free(void *ptr) JIT_NOTHROW; 37 | 38 | #define jit_new(type) ((type *)jit_malloc(sizeof(type))) 39 | #define jit_cnew(type) ((type *)jit_calloc(1, sizeof(type))) 40 | 41 | /* 42 | * Memory set/copy/compare routines. 43 | */ 44 | void *jit_memset(void *dest, int ch, unsigned int len) JIT_NOTHROW; 45 | void *jit_memcpy(void *dest, const void *src, unsigned int len) JIT_NOTHROW; 46 | void *jit_memmove(void *dest, const void *src, unsigned int len) JIT_NOTHROW; 47 | int jit_memcmp(const void *s1, const void *s2, unsigned int len) JIT_NOTHROW; 48 | void *jit_memchr(const void *str, int ch, unsigned int len) JIT_NOTHROW; 49 | 50 | /* 51 | * String routines. 52 | */ 53 | unsigned int jit_strlen(const char *str) JIT_NOTHROW; 54 | char *jit_strcpy(char *dest, const char *src) JIT_NOTHROW; 55 | char *jit_strcat(char *dest, const char *src) JIT_NOTHROW; 56 | char *jit_strncpy(char *dest, const char *src, unsigned int len) JIT_NOTHROW; 57 | char *jit_strdup(const char *str) JIT_NOTHROW; 58 | char *jit_strndup(const char *str, unsigned int len) JIT_NOTHROW; 59 | int jit_strcmp(const char *str1, const char *str2) JIT_NOTHROW; 60 | int jit_strncmp 61 | (const char *str1, const char *str2, unsigned int len) JIT_NOTHROW; 62 | int jit_stricmp(const char *str1, const char *str2) JIT_NOTHROW; 63 | int jit_strnicmp 64 | (const char *str1, const char *str2, unsigned int len) JIT_NOTHROW; 65 | char *jit_strchr(const char *str, int ch) JIT_NOTHROW; 66 | char *jit_strrchr(const char *str, int ch) JIT_NOTHROW; 67 | int jit_sprintf(char *str, const char *format, ...) JIT_NOTHROW; 68 | int jit_snprintf 69 | (char *str, unsigned int len, const char *format, ...) JIT_NOTHROW; 70 | 71 | #ifdef __cplusplus 72 | }; 73 | #endif 74 | 75 | #endif /* _JIT_UTIL_H */ 76 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-common.h - Common type definitions that are used by the JIT. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_COMMON_H 22 | #define _JIT_COMMON_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Opaque structure that represents a context. 32 | */ 33 | typedef struct _jit_context *jit_context_t; 34 | 35 | /* 36 | * Opaque structure that represents a function. 37 | */ 38 | typedef struct _jit_function *jit_function_t; 39 | 40 | /* 41 | * Opaque structure that represents a block. 42 | */ 43 | typedef struct _jit_block *jit_block_t; 44 | 45 | /* 46 | * Opaque structure that represents an instruction. 47 | */ 48 | typedef struct _jit_insn *jit_insn_t; 49 | 50 | /* 51 | * Opaque structure that represents a value. 52 | */ 53 | typedef struct _jit_value *jit_value_t; 54 | 55 | /* 56 | * Opaque structure that represents a type descriptor. 57 | */ 58 | typedef struct _jit_type *jit_type_t; 59 | 60 | /* 61 | * Opaque type that represents an exception stack trace. 62 | */ 63 | typedef struct jit_stack_trace *jit_stack_trace_t; 64 | 65 | /* 66 | * Block label identifier. 67 | */ 68 | typedef jit_nuint jit_label_t; 69 | 70 | /* 71 | * Value that represents an undefined label. 72 | */ 73 | #define jit_label_undefined ((jit_label_t)~((jit_uint)0)) 74 | 75 | /* 76 | * Value that represents an undefined offset. 77 | */ 78 | #define JIT_NO_OFFSET (~((unsigned int)0)) 79 | 80 | /* 81 | * Function that is used to free user-supplied metadata. 82 | */ 83 | typedef void (*jit_meta_free_func)(void *data); 84 | 85 | /* 86 | * Function that is used to compile a function on demand. 87 | * Returns zero if the compilation process failed for some reason. 88 | */ 89 | typedef int (*jit_on_demand_func)(jit_function_t func); 90 | 91 | /* 92 | * Function that is used to control on demand compilation. 93 | * Typically, it should take care of the context locking and unlocking, 94 | * calling function's on demand compiler, and final compilation. 95 | */ 96 | typedef void *(*jit_on_demand_driver_func)(jit_function_t func); 97 | 98 | #ifdef __cplusplus 99 | }; 100 | #endif 101 | 102 | #endif /* _JIT_COMMON_H */ 103 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-memory.h - Memory management. 3 | * 4 | * Copyright (C) 2012 Aleksey Demakov 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_MEMORY_H 22 | #define _JIT_MEMORY_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Result values for "_jit_cache_start_function" and "_jit_cache_end_function". 32 | */ 33 | #define JIT_MEMORY_OK 0 /* Function is OK */ 34 | #define JIT_MEMORY_RESTART 1 /* Restart is required */ 35 | #define JIT_MEMORY_TOO_BIG 2 /* Function is too big for the cache */ 36 | #define JIT_MEMORY_ERROR 3 /* Other error */ 37 | 38 | 39 | /* TODO: the proper place for this is jit-def.h and it's going to depend on the platform. */ 40 | typedef unsigned int jit_size_t; 41 | 42 | typedef void *jit_memory_context_t; 43 | typedef void *jit_function_info_t; 44 | 45 | typedef struct jit_memory_manager const* jit_memory_manager_t; 46 | 47 | struct jit_memory_manager 48 | { 49 | jit_memory_context_t (*create)(jit_context_t context); 50 | void (*destroy)(jit_memory_context_t memctx); 51 | 52 | jit_function_info_t (*find_function_info)(jit_memory_context_t memctx, void *pc); 53 | jit_function_t (*get_function)(jit_memory_context_t memctx, jit_function_info_t info); 54 | void * (*get_function_start)(jit_memory_context_t memctx, jit_function_info_t info); 55 | void * (*get_function_end)(jit_memory_context_t memctx, jit_function_info_t info); 56 | 57 | jit_function_t (*alloc_function)(jit_memory_context_t memctx); 58 | void (*free_function)(jit_memory_context_t memctx, jit_function_t func); 59 | 60 | int (*start_function)(jit_memory_context_t memctx, jit_function_t func); 61 | int (*end_function)(jit_memory_context_t memctx, int result); 62 | int (*extend_limit)(jit_memory_context_t memctx, int count); 63 | 64 | void * (*get_limit)(jit_memory_context_t memctx); 65 | void * (*get_break)(jit_memory_context_t memctx); 66 | void (*set_break)(jit_memory_context_t memctx, void *brk); 67 | 68 | void * (*alloc_trampoline)(jit_memory_context_t memctx); 69 | void (*free_trampoline)(jit_memory_context_t memctx, void *ptr); 70 | 71 | void * (*alloc_closure)(jit_memory_context_t memctx); 72 | void (*free_closure)(jit_memory_context_t memctx, void *ptr); 73 | 74 | void * (*alloc_data)(jit_memory_context_t memctx, jit_size_t size, jit_size_t align); 75 | }; 76 | 77 | jit_memory_manager_t jit_default_memory_manager(void) JIT_NOTHROW; 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* _JIT_MEMORY_H */ 84 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-elf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * - Routines to read and write ELF-format binaries. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_ELF_H 22 | #define _JIT_ELF_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Opaque types that represent a loaded ELF binary in read or write mode. 32 | */ 33 | typedef struct jit_readelf *jit_readelf_t; 34 | typedef struct jit_writeelf *jit_writeelf_t; 35 | 36 | /* 37 | * Flags for "jit_readelf_open". 38 | */ 39 | #define JIT_READELF_FLAG_FORCE (1 << 0) /* Force file to load */ 40 | #define JIT_READELF_FLAG_DEBUG (1 << 1) /* Print debugging information */ 41 | 42 | /* 43 | * Result codes from "jit_readelf_open". 44 | */ 45 | #define JIT_READELF_OK 0 /* File was opened successfully */ 46 | #define JIT_READELF_CANNOT_OPEN 1 /* Could not open the file */ 47 | #define JIT_READELF_NOT_ELF 2 /* Not an ELF-format binary */ 48 | #define JIT_READELF_WRONG_ARCH 3 /* Wrong architecture for local system */ 49 | #define JIT_READELF_BAD_FORMAT 4 /* ELF file, but badly formatted */ 50 | #define JIT_READELF_MEMORY 5 /* Insufficient memory to load the file */ 51 | 52 | /* 53 | * External function declarations. 54 | */ 55 | int jit_readelf_open 56 | (jit_readelf_t *readelf, const char *filename, int flags) JIT_NOTHROW; 57 | void jit_readelf_close(jit_readelf_t readelf) JIT_NOTHROW; 58 | const char *jit_readelf_get_name(jit_readelf_t readelf) JIT_NOTHROW; 59 | void *jit_readelf_get_symbol 60 | (jit_readelf_t readelf, const char *name) JIT_NOTHROW; 61 | void *jit_readelf_get_section 62 | (jit_readelf_t readelf, const char *name, jit_nuint *size) JIT_NOTHROW; 63 | void *jit_readelf_get_section_by_type 64 | (jit_readelf_t readelf, jit_int type, jit_nuint *size) JIT_NOTHROW; 65 | void *jit_readelf_map_vaddr 66 | (jit_readelf_t readelf, jit_nuint vaddr) JIT_NOTHROW; 67 | unsigned int jit_readelf_num_needed(jit_readelf_t readelf) JIT_NOTHROW; 68 | const char *jit_readelf_get_needed 69 | (jit_readelf_t readelf, unsigned int index) JIT_NOTHROW; 70 | void jit_readelf_add_to_context 71 | (jit_readelf_t readelf, jit_context_t context) JIT_NOTHROW; 72 | int jit_readelf_resolve_all 73 | (jit_context_t context, int print_failures) JIT_NOTHROW; 74 | int jit_readelf_register_symbol 75 | (jit_context_t context, const char *name, 76 | void *value, int after) JIT_NOTHROW; 77 | 78 | jit_writeelf_t jit_writeelf_create(const char *library_name) JIT_NOTHROW; 79 | void jit_writeelf_destroy(jit_writeelf_t writeelf) JIT_NOTHROW; 80 | int jit_writeelf_write 81 | (jit_writeelf_t writeelf, const char *filename) JIT_NOTHROW; 82 | int jit_writeelf_add_function 83 | (jit_writeelf_t writeelf, jit_function_t func, 84 | const char *name) JIT_NOTHROW; 85 | int jit_writeelf_add_needed 86 | (jit_writeelf_t writeelf, const char *library_name) JIT_NOTHROW; 87 | int jit_writeelf_write_section 88 | (jit_writeelf_t writeelf, const char *name, jit_int type, 89 | const void *buf, unsigned int len, int discardable) JIT_NOTHROW; 90 | 91 | #ifdef __cplusplus 92 | }; 93 | #endif 94 | 95 | #endif /* _JIT_ELF_H */ 96 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-function.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-function.h - Functions for manipulating functions blocks. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_FUNCTION_H 22 | #define _JIT_FUNCTION_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Optimization levels */ 31 | #define JIT_OPTLEVEL_NONE 0 32 | #define JIT_OPTLEVEL_NORMAL 1 33 | 34 | jit_function_t jit_function_create 35 | (jit_context_t context, jit_type_t signature) JIT_NOTHROW; 36 | jit_function_t jit_function_create_nested 37 | (jit_context_t context, jit_type_t signature, 38 | jit_function_t parent) JIT_NOTHROW; 39 | void jit_function_abandon(jit_function_t func) JIT_NOTHROW; 40 | jit_context_t jit_function_get_context(jit_function_t func) JIT_NOTHROW; 41 | jit_type_t jit_function_get_signature(jit_function_t func) JIT_NOTHROW; 42 | int jit_function_set_meta 43 | (jit_function_t func, int type, void *data, 44 | jit_meta_free_func free_data, int build_only) JIT_NOTHROW; 45 | void *jit_function_get_meta(jit_function_t func, int type) JIT_NOTHROW; 46 | void jit_function_free_meta(jit_function_t func, int type) JIT_NOTHROW; 47 | jit_function_t jit_function_next 48 | (jit_context_t context, jit_function_t prev) JIT_NOTHROW; 49 | jit_function_t jit_function_previous 50 | (jit_context_t context, jit_function_t prev) JIT_NOTHROW; 51 | jit_block_t jit_function_get_entry(jit_function_t func) JIT_NOTHROW; 52 | jit_block_t jit_function_get_current(jit_function_t func) JIT_NOTHROW; 53 | jit_function_t jit_function_get_nested_parent(jit_function_t func) JIT_NOTHROW; 54 | int jit_function_compile(jit_function_t func) JIT_NOTHROW; 55 | int jit_function_is_compiled(jit_function_t func) JIT_NOTHROW; 56 | void jit_function_set_recompilable(jit_function_t func) JIT_NOTHROW; 57 | void jit_function_clear_recompilable(jit_function_t func) JIT_NOTHROW; 58 | int jit_function_is_recompilable(jit_function_t func) JIT_NOTHROW; 59 | int jit_function_compile_entry(jit_function_t func, void **entry_point) JIT_NOTHROW; 60 | void jit_function_setup_entry(jit_function_t func, void *entry_point) JIT_NOTHROW; 61 | void *jit_function_to_closure(jit_function_t func) JIT_NOTHROW; 62 | jit_function_t jit_function_from_closure 63 | (jit_context_t context, void *closure) JIT_NOTHROW; 64 | jit_function_t jit_function_from_pc 65 | (jit_context_t context, void *pc, void **handler) JIT_NOTHROW; 66 | void *jit_function_to_vtable_pointer(jit_function_t func) JIT_NOTHROW; 67 | jit_function_t jit_function_from_vtable_pointer 68 | (jit_context_t context, void *vtable_pointer) JIT_NOTHROW; 69 | void jit_function_set_on_demand_compiler 70 | (jit_function_t func, jit_on_demand_func on_demand) JIT_NOTHROW; 71 | jit_on_demand_func jit_function_get_on_demand_compiler(jit_function_t func) JIT_NOTHROW; 72 | int jit_function_apply 73 | (jit_function_t func, void **args, void *return_area); 74 | int jit_function_apply_vararg 75 | (jit_function_t func, jit_type_t signature, void **args, void *return_area); 76 | void jit_function_set_optimization_level 77 | (jit_function_t func, unsigned int level) JIT_NOTHROW; 78 | unsigned int jit_function_get_optimization_level 79 | (jit_function_t func) JIT_NOTHROW; 80 | unsigned int jit_function_get_max_optimization_level(void) JIT_NOTHROW; 81 | jit_label_t jit_function_reserve_label(jit_function_t func) JIT_NOTHROW; 82 | int jit_function_labels_equal(jit_function_t func, jit_label_t label, jit_label_t label2); 83 | 84 | #ifdef __cplusplus 85 | }; 86 | #endif 87 | 88 | #endif /* _JIT_FUNCTION_H */ 89 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-value.h - Functions for manipulating temporary values. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_VALUE_H 22 | #define _JIT_VALUE_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Full struction that can hold a constant of any type. 32 | */ 33 | typedef struct 34 | { 35 | jit_type_t type; 36 | union 37 | { 38 | void *ptr_value; 39 | jit_int int_value; 40 | jit_uint uint_value; 41 | jit_nint nint_value; 42 | jit_nuint nuint_value; 43 | jit_long long_value; 44 | jit_ulong ulong_value; 45 | jit_float32 float32_value; 46 | jit_float64 float64_value; 47 | jit_nfloat nfloat_value; 48 | 49 | } un; 50 | 51 | } jit_constant_t; 52 | 53 | /* 54 | * External function declarations. 55 | */ 56 | jit_value_t jit_value_create(jit_function_t func, jit_type_t type) JIT_NOTHROW; 57 | jit_value_t jit_value_create_nint_constant 58 | (jit_function_t func, jit_type_t type, jit_nint const_value) JIT_NOTHROW; 59 | jit_value_t jit_value_create_long_constant 60 | (jit_function_t func, jit_type_t type, jit_long const_value) JIT_NOTHROW; 61 | jit_value_t jit_value_create_float32_constant 62 | (jit_function_t func, jit_type_t type, 63 | jit_float32 const_value) JIT_NOTHROW; 64 | jit_value_t jit_value_create_float64_constant 65 | (jit_function_t func, jit_type_t type, 66 | jit_float64 const_value) JIT_NOTHROW; 67 | jit_value_t jit_value_create_nfloat_constant 68 | (jit_function_t func, jit_type_t type, 69 | jit_nfloat const_value) JIT_NOTHROW; 70 | jit_value_t jit_value_create_constant 71 | (jit_function_t func, const jit_constant_t *const_value) JIT_NOTHROW; 72 | jit_value_t jit_value_get_param 73 | (jit_function_t func, unsigned int param) JIT_NOTHROW; 74 | jit_value_t jit_value_get_struct_pointer(jit_function_t func) JIT_NOTHROW; 75 | int jit_value_is_temporary(jit_value_t value) JIT_NOTHROW; 76 | int jit_value_is_local(jit_value_t value) JIT_NOTHROW; 77 | int jit_value_is_constant(jit_value_t value) JIT_NOTHROW; 78 | int jit_value_is_parameter(jit_value_t value) JIT_NOTHROW; 79 | void jit_value_ref(jit_function_t func, jit_value_t value) JIT_NOTHROW; 80 | void jit_value_set_volatile(jit_value_t value) JIT_NOTHROW; 81 | int jit_value_is_volatile(jit_value_t value) JIT_NOTHROW; 82 | void jit_value_set_addressable(jit_value_t value) JIT_NOTHROW; 83 | int jit_value_is_addressable(jit_value_t value) JIT_NOTHROW; 84 | jit_type_t jit_value_get_type(jit_value_t value) JIT_NOTHROW; 85 | jit_function_t jit_value_get_function(jit_value_t value) JIT_NOTHROW; 86 | jit_block_t jit_value_get_block(jit_value_t value) JIT_NOTHROW; 87 | jit_context_t jit_value_get_context(jit_value_t value) JIT_NOTHROW; 88 | jit_constant_t jit_value_get_constant(jit_value_t value) JIT_NOTHROW; 89 | jit_nint jit_value_get_nint_constant(jit_value_t value) JIT_NOTHROW; 90 | jit_long jit_value_get_long_constant(jit_value_t value) JIT_NOTHROW; 91 | jit_float32 jit_value_get_float32_constant(jit_value_t value) JIT_NOTHROW; 92 | jit_float64 jit_value_get_float64_constant(jit_value_t value) JIT_NOTHROW; 93 | jit_nfloat jit_value_get_nfloat_constant(jit_value_t value) JIT_NOTHROW; 94 | int jit_value_is_true(jit_value_t value) JIT_NOTHROW; 95 | int jit_constant_convert 96 | (jit_constant_t *result, const jit_constant_t *value, 97 | jit_type_t type, int overflow_check) JIT_NOTHROW; 98 | 99 | #ifdef __cplusplus 100 | }; 101 | #endif 102 | 103 | #endif /* _JIT_VALUE_H */ 104 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-walk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-walk.h - Functions for walking stack frames. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_WALK_H 22 | #define _JIT_WALK_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Get the frame address for a frame which is "n" levels up the stack. 32 | * A level value of zero indicates the current frame. 33 | */ 34 | void *_jit_get_frame_address(void *start, unsigned int n); 35 | #if defined(__GNUC__) 36 | # define jit_get_frame_address(n) \ 37 | (_jit_get_frame_address(jit_get_current_frame(), (n))) 38 | #else 39 | # define jit_get_frame_address(n) (_jit_get_frame_address(0, (n))) 40 | #endif 41 | 42 | /* 43 | * Get the frame address for the current frame. May be more efficient 44 | * than using "jit_get_frame_address(0)". 45 | * 46 | * Note: some gcc vestions have broken __builtin_frame_address() so use 47 | * _JIT_ARCH_GET_CURRENT_FRAME() if available. 48 | */ 49 | #if defined(__GNUC__) 50 | # define JIT_FAST_GET_CURRENT_FRAME 1 51 | # if defined(_JIT_ARCH_GET_CURRENT_FRAME) 52 | # define jit_get_current_frame() \ 53 | ({ \ 54 | void *address; \ 55 | _JIT_ARCH_GET_CURRENT_FRAME(address); \ 56 | address; \ 57 | }) 58 | # else 59 | # define jit_get_current_frame() (__builtin_frame_address(0)) 60 | # endif 61 | #else 62 | # define JIT_FAST_GET_CURRENT_FRAME 0 63 | # define jit_get_current_frame() (jit_get_frame_address(0)) 64 | #endif 65 | 66 | /* 67 | * Get the next frame up the stack from a specified frame. 68 | * Returns NULL if it isn't possible to retrieve the next frame. 69 | */ 70 | void *_jit_get_next_frame_address(void *frame); 71 | #if defined(__GNUC__) && defined(_JIT_ARCH_GET_NEXT_FRAME) 72 | # define jit_get_next_frame_address(frame) \ 73 | ({ \ 74 | void *address; \ 75 | _JIT_ARCH_GET_NEXT_FRAME(address, (frame)); \ 76 | address; \ 77 | }) 78 | #else 79 | # define jit_get_next_frame_address(frame) \ 80 | (_jit_get_next_frame_address(frame)) 81 | #endif 82 | 83 | /* 84 | * Get the return address for a specific frame. 85 | */ 86 | void *_jit_get_return_address(void *frame, void *frame0, void *return0); 87 | #if defined(__GNUC__) 88 | # if defined(_JIT_ARCH_GET_RETURN_ADDRESS) 89 | # define jit_get_return_address(frame) \ 90 | ({ \ 91 | void *address; \ 92 | _JIT_ARCH_GET_RETURN_ADDRESS(address, (frame)); \ 93 | address; \ 94 | }) 95 | # else 96 | # define jit_get_return_address(frame) \ 97 | (_jit_get_return_address \ 98 | ((frame), \ 99 | __builtin_frame_address(0), \ 100 | __builtin_return_address(0))) 101 | # endif 102 | #else 103 | # define jit_get_return_address(frame) \ 104 | (_jit_get_return_address((frame), 0, 0)) 105 | #endif 106 | 107 | /* 108 | * Get the return address for the current frame. May be more efficient 109 | * than using "jit_get_return_address(0)". 110 | */ 111 | #if defined(__GNUC__) 112 | # if defined(_JIT_ARCH_GET_CURRENT_RETURN) 113 | # define jit_get_current_return() \ 114 | ({ \ 115 | void *address; \ 116 | _JIT_ARCH_GET_CURRENT_RETURN(address); \ 117 | address; \ 118 | }) 119 | # else 120 | # define jit_get_current_return() (__builtin_return_address(0)) 121 | # endif 122 | #else 123 | # define jit_get_current_return() \ 124 | (jit_get_return_address(jit_get_current_frame())) 125 | #endif 126 | 127 | /* 128 | * Declare a stack crawl mark variable. The address of this variable 129 | * can be passed to "jit_frame_contains_crawl_mark" to determine 130 | * if a frame contains the mark. 131 | */ 132 | typedef struct { void * volatile mark; } jit_crawl_mark_t; 133 | #define jit_declare_crawl_mark(name) jit_crawl_mark_t name = {0} 134 | 135 | /* 136 | * Determine if the stack frame just above "frame" contains a 137 | * particular crawl mark. 138 | */ 139 | int jit_frame_contains_crawl_mark(void *frame, jit_crawl_mark_t *mark); 140 | 141 | #ifdef __cplusplus 142 | }; 143 | #endif 144 | 145 | #endif /* _JIT_WALK_H */ 146 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-objmodel-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-objmodel-private.h - Private object model definitions. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_OBJMODEL_PRIVATE_H 22 | #define _JIT_OBJMODEL_PRIVATE_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Internal structure of an object model handler. 32 | */ 33 | struct jit_objmodel 34 | { 35 | /* 36 | * Size of this structure, for versioning. 37 | */ 38 | unsigned int size; 39 | 40 | /* 41 | * Reserved fields that can be used by the handler to store its state. 42 | */ 43 | void *reserved0; 44 | void *reserved1; 45 | void *reserved2; 46 | void *reserved3; 47 | 48 | /* 49 | * Operations on object models. 50 | */ 51 | void (*destroy_model)(jit_objmodel_t model); 52 | jitom_class_t (*get_class_by_name)(jit_objmodel_t model, const char *name); 53 | 54 | /* 55 | * Operations on object model classes. 56 | */ 57 | char *(*class_get_name)(jit_objmodel_t model, jitom_class_t klass); 58 | int (*class_get_modifiers)(jit_objmodel_t model, jitom_class_t klass); 59 | jit_type_t (*class_get_type)(jit_objmodel_t model, jitom_class_t klass); 60 | jit_type_t (*class_get_value_type) 61 | (jit_objmodel_t model, jitom_class_t klass); 62 | jitom_class_t (*class_get_primary_super) 63 | (jit_objmodel_t model, jitom_class_t klass); 64 | jitom_class_t *(*class_get_all_supers) 65 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num); 66 | jitom_class_t *(*class_get_interfaces) 67 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num); 68 | jitom_field_t *(*class_get_fields) 69 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num); 70 | jitom_method_t *(*class_get_methods) 71 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num); 72 | jit_value_t (*class_new) 73 | (jit_objmodel_t model, jitom_class_t klass, 74 | jitom_method_t ctor, jit_function_t func, 75 | jit_value_t *args, unsigned int num_args, int flags); 76 | jit_value_t (*class_new_value) 77 | (jit_objmodel_t model, jitom_class_t klass, 78 | jitom_method_t ctor, jit_function_t func, 79 | jit_value_t *args, unsigned int num_args, int flags); 80 | int (*class_delete) 81 | (jit_objmodel_t model, jitom_class_t klass, jit_value_t obj_value); 82 | int (*class_add_ref) 83 | (jit_objmodel_t model, jitom_class_t klass, jit_value_t obj_value); 84 | 85 | /* 86 | * Operations on object model fields. 87 | */ 88 | char *(*field_get_name) 89 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field); 90 | jit_type_t (*field_get_type) 91 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field); 92 | int (*field_get_modifiers) 93 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field); 94 | jit_value_t (*field_load) 95 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field, 96 | jit_function_t func, jit_value_t obj_value); 97 | jit_value_t (*field_load_address) 98 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field, 99 | jit_function_t func, jit_value_t obj_value); 100 | int (*field_store) 101 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field, 102 | jit_function_t func, jit_value_t obj_value, jit_value_t value); 103 | 104 | /* 105 | * Operations on object model methods. 106 | */ 107 | char *(*method_get_name) 108 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method); 109 | jit_type_t (*method_get_type) 110 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method); 111 | int (*method_get_modifiers) 112 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method); 113 | jit_value_t (*method_invoke) 114 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method, 115 | jit_function_t func, jit_value_t *args, 116 | unsigned int num_args, int flags); 117 | jit_value_t (*method_invoke_virtual) 118 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method, 119 | jit_function_t func, jit_value_t *args, 120 | unsigned int num_args, int flags); 121 | 122 | }; 123 | 124 | #ifdef __cplusplus 125 | }; 126 | #endif 127 | 128 | #endif /* _JIT_OBJMODEL_PRIVATE_H */ 129 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-debugger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-debugger.h - Helper routines for single-step debugging of programs. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_DEBUGGER_H 22 | #define _JIT_DEBUGGER_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct jit_debugger *jit_debugger_t; 31 | typedef jit_nint jit_debugger_thread_id_t; 32 | typedef jit_nint jit_debugger_breakpoint_id_t; 33 | 34 | typedef struct jit_debugger_event 35 | { 36 | int type; 37 | jit_debugger_thread_id_t thread; 38 | jit_function_t function; 39 | jit_nint data1; 40 | jit_nint data2; 41 | jit_debugger_breakpoint_id_t id; 42 | jit_stack_trace_t trace; 43 | 44 | } jit_debugger_event_t; 45 | 46 | #define JIT_DEBUGGER_TYPE_QUIT 0 47 | #define JIT_DEBUGGER_TYPE_HARD_BREAKPOINT 1 48 | #define JIT_DEBUGGER_TYPE_SOFT_BREAKPOINT 2 49 | #define JIT_DEBUGGER_TYPE_USER_BREAKPOINT 3 50 | #define JIT_DEBUGGER_TYPE_ATTACH_THREAD 4 51 | #define JIT_DEBUGGER_TYPE_DETACH_THREAD 5 52 | 53 | typedef struct jit_debugger_breakpoint_info 54 | { 55 | int flags; 56 | jit_debugger_thread_id_t thread; 57 | jit_function_t function; 58 | jit_nint data1; 59 | jit_nint data2; 60 | 61 | } *jit_debugger_breakpoint_info_t; 62 | 63 | #define JIT_DEBUGGER_FLAG_THREAD (1 << 0) 64 | #define JIT_DEBUGGER_FLAG_FUNCTION (1 << 1) 65 | #define JIT_DEBUGGER_FLAG_DATA1 (1 << 2) 66 | #define JIT_DEBUGGER_FLAG_DATA2 (1 << 3) 67 | 68 | #define JIT_DEBUGGER_DATA1_FIRST 10000 69 | #define JIT_DEBUGGER_DATA1_LINE 10000 70 | #define JIT_DEBUGGER_DATA1_ENTER 10001 71 | #define JIT_DEBUGGER_DATA1_LEAVE 10002 72 | #define JIT_DEBUGGER_DATA1_THROW 10003 73 | 74 | typedef void (*jit_debugger_hook_func) 75 | (jit_function_t func, jit_nint data1, jit_nint data2); 76 | 77 | int jit_debugging_possible(void) JIT_NOTHROW; 78 | 79 | jit_debugger_t jit_debugger_create(jit_context_t context) JIT_NOTHROW; 80 | void jit_debugger_destroy(jit_debugger_t dbg) JIT_NOTHROW; 81 | 82 | jit_context_t jit_debugger_get_context(jit_debugger_t dbg) JIT_NOTHROW; 83 | jit_debugger_t jit_debugger_from_context(jit_context_t context) JIT_NOTHROW; 84 | 85 | jit_debugger_thread_id_t jit_debugger_get_self(jit_debugger_t dbg) JIT_NOTHROW; 86 | jit_debugger_thread_id_t jit_debugger_get_thread 87 | (jit_debugger_t dbg, const void *native_thread) JIT_NOTHROW; 88 | int jit_debugger_get_native_thread 89 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread, 90 | void *native_thread) JIT_NOTHROW; 91 | void jit_debugger_set_breakable 92 | (jit_debugger_t dbg, const void *native_thread, int flag) JIT_NOTHROW; 93 | 94 | void jit_debugger_attach_self 95 | (jit_debugger_t dbg, int stop_immediately) JIT_NOTHROW; 96 | void jit_debugger_detach_self(jit_debugger_t dbg) JIT_NOTHROW; 97 | 98 | int jit_debugger_wait_event 99 | (jit_debugger_t dbg, jit_debugger_event_t *event, 100 | jit_int timeout) JIT_NOTHROW; 101 | 102 | jit_debugger_breakpoint_id_t jit_debugger_add_breakpoint 103 | (jit_debugger_t dbg, jit_debugger_breakpoint_info_t info) JIT_NOTHROW; 104 | void jit_debugger_remove_breakpoint 105 | (jit_debugger_t dbg, jit_debugger_breakpoint_id_t id) JIT_NOTHROW; 106 | void jit_debugger_remove_all_breakpoints(jit_debugger_t dbg) JIT_NOTHROW; 107 | 108 | int jit_debugger_is_alive 109 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread) JIT_NOTHROW; 110 | int jit_debugger_is_running 111 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread) JIT_NOTHROW; 112 | void jit_debugger_run 113 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread) JIT_NOTHROW; 114 | void jit_debugger_step 115 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread) JIT_NOTHROW; 116 | void jit_debugger_next 117 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread) JIT_NOTHROW; 118 | void jit_debugger_finish 119 | (jit_debugger_t dbg, jit_debugger_thread_id_t thread) JIT_NOTHROW; 120 | 121 | void jit_debugger_break(jit_debugger_t dbg) JIT_NOTHROW; 122 | 123 | void jit_debugger_quit(jit_debugger_t dbg) JIT_NOTHROW; 124 | 125 | jit_debugger_hook_func jit_debugger_set_hook 126 | (jit_context_t context, jit_debugger_hook_func hook); 127 | 128 | #ifdef __cplusplus 129 | }; 130 | #endif 131 | 132 | #endif /* _JIT_DEBUGGER_H */ 133 | -------------------------------------------------------------------------------- /src/bf-jit.c: -------------------------------------------------------------------------------- 1 | #include "bf-jit.h" 2 | 3 | void loop_start(jit_function_t function, bf_loop_t *loop) { 4 | bf_loop_t newloop = (bf_loop_t)jit_malloc(sizeof(struct bf_loop)); 5 | newloop->start = jit_label_undefined; 6 | newloop->stop = jit_label_undefined; 7 | newloop->parent = *loop; 8 | jit_insn_label(function, &newloop->start); 9 | *loop = newloop; 10 | } 11 | 12 | void loop_stop(jit_function_t function, bf_loop_t *loop) { 13 | bf_loop_t curloop = *loop; 14 | if (curloop == NULL) return; 15 | jit_insn_branch(function, &curloop->start); 16 | jit_insn_label(function, &curloop->stop); 17 | *loop = curloop->parent; 18 | } 19 | 20 | jit_function_t bf_compile(jit_context_t cx, FILE *fp) { 21 | jit_type_t params[1], putchar_params[1], signature, putchar_sig, getchar_sig; 22 | jit_value_t ptr, uptr, ubyte, tmp; 23 | bf_loop_t loop = NULL; 24 | 25 | ubyte_ptr = jit_type_create_pointer(jit_type_ubyte, 1); 26 | params[0] = ubyte_ptr; 27 | putchar_params[0] = jit_type_ubyte; 28 | signature = jit_type_create_signature(jit_abi_cdecl, jit_type_void, params, 1, 1); 29 | putchar_sig = jit_type_create_signature(jit_abi_cdecl, jit_type_ubyte, putchar_params, 1, 1); 30 | getchar_sig = jit_type_create_signature(jit_abi_cdecl, jit_type_ubyte, NULL, 0, 1); 31 | jit_function_t function = jit_function_create(cx, signature); 32 | ptr = jit_value_get_param(function, 0); 33 | uptr = jit_value_create_nint_constant(function, ubyte_ptr, 1); 34 | ubyte = jit_value_create_nint_constant(function, jit_type_ubyte, 1); 35 | 36 | ops *unit = (ops*)malloc(sizeof(ops)); 37 | unit->count = 0; 38 | int first = 1; 39 | 40 | while(!feof(fp)) { 41 | char c = fgetc(fp); 42 | if (first) { 43 | unit->token = c; 44 | first = 0; 45 | } 46 | switch(c) { 47 | case '>': 48 | OPTIMIZE_TOKEN('>') 49 | case '<': 50 | OPTIMIZE_TOKEN('<') 51 | case '+': 52 | OPTIMIZE_TOKEN('+') 53 | case '-': 54 | OPTIMIZE_TOKEN('-') 55 | case '.': 56 | emitOpcodes(function, ptr, unit); 57 | unit->token = '.'; 58 | tmp = jit_insn_load_relative(function, ptr, 0, jit_type_ubyte); 59 | jit_insn_call_native(function, "putchar", putchar, putchar_sig, &tmp, 1, JIT_CALL_NOTHROW); 60 | break; 61 | case ',': 62 | emitOpcodes(function, ptr, unit); 63 | unit->token = ','; 64 | jit_insn_call_native(function, "getchar", getchar, getchar_sig, NULL, 0, JIT_CALL_NOTHROW); 65 | jit_insn_store_relative(function, ptr, 0, tmp); 66 | break; 67 | case '[': 68 | emitOpcodes(function, ptr, unit); 69 | unit->token = '['; 70 | loop_start(function, &loop); 71 | tmp = jit_insn_load_relative(function, ptr, 0, jit_type_ubyte); 72 | jit_insn_branch_if_not(function, tmp, &loop->stop); 73 | break; 74 | case ']': 75 | emitOpcodes(function, ptr, unit); 76 | unit->token = ']'; 77 | loop_stop(function, &loop); 78 | break; 79 | } 80 | } 81 | 82 | jit_insn_return(function, NULL); 83 | jit_function_compile(function); 84 | 85 | return function; 86 | } 87 | 88 | void emitOpcodes(jit_function_t function, jit_value_t ptr, ops *unit) { 89 | switch(unit->token) { 90 | case '>': 91 | emitIncrementPtr(function, ptr, unit); 92 | break; 93 | case '<': 94 | emitDecrementPtr(function, ptr, unit); 95 | break; 96 | case '+': 97 | emitIncrement(function, ptr, unit); 98 | break; 99 | case '-': 100 | emitDecrement(function, ptr, unit); 101 | break; 102 | } 103 | } 104 | 105 | void emitIncrement(jit_function_t function, jit_value_t ptr, ops *unit) { 106 | jit_value_t tmp = jit_insn_load_relative(function, ptr, 0, jit_type_ubyte); 107 | jit_value_t numbyte = jit_value_create_nint_constant(function, jit_type_ubyte, unit->count); 108 | tmp = jit_insn_add(function, tmp, numbyte); 109 | tmp = jit_insn_convert(function, tmp, jit_type_ubyte, 0); 110 | jit_insn_store_relative(function, ptr, 0, tmp); 111 | } 112 | 113 | void emitDecrement(jit_function_t function, jit_value_t ptr, ops *unit) { 114 | jit_value_t tmp = jit_insn_load_relative(function, ptr, 0, jit_type_ubyte); 115 | jit_value_t numbyte = jit_value_create_nint_constant(function, jit_type_ubyte, unit->count); 116 | tmp = jit_insn_sub(function, tmp, numbyte); 117 | tmp = jit_insn_convert(function, tmp, jit_type_ubyte, 0); 118 | jit_insn_store_relative(function, ptr, 0, tmp); 119 | } 120 | 121 | void emitIncrementPtr(jit_function_t function, jit_value_t ptr, ops *unit) { 122 | jit_value_t numbyte = jit_value_create_nint_constant(function, ubyte_ptr, unit->count); 123 | jit_value_t tmp = jit_insn_add(function, ptr, numbyte); 124 | jit_insn_store(function, ptr, tmp); 125 | } 126 | 127 | void emitDecrementPtr(jit_function_t function, jit_value_t ptr, ops *unit) { 128 | jit_value_t numbyte = jit_value_create_nint_constant(function, ubyte_ptr, unit->count); 129 | jit_value_t tmp = jit_insn_sub(function, ptr, numbyte); 130 | jit_insn_store(function, ptr, tmp); 131 | } 132 | 133 | int main(int argc, char const *argv[]) { 134 | jit_context_t cx = jit_context_create(); 135 | 136 | char *data = calloc(50000, sizeof(char)); 137 | jit_ptr arg1; 138 | void *args[1]; 139 | 140 | FILE *fp = fopen(argv[1], "rb"); 141 | jit_function_t function = bf_compile(cx, fp); 142 | fclose(fp); 143 | jit_context_build_end(cx); 144 | arg1 = data; 145 | args[0] = &arg1; 146 | jit_function_apply(function, args, NULL); 147 | jit_context_destroy(cx); 148 | return 0; 149 | } -------------------------------------------------------------------------------- /bench/out.txt: -------------------------------------------------------------------------------- 1 | AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDEGFFEEEEDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 2 | AAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDEEEFGIIGFFEEEDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBB 3 | AAAAAAAAA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FFEEEDDDDDDDDDCCCCCCCCCCBBBBBBBBBBBBBBBBBB 46 | AAAAAAAAAAAABBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDEEEEEFFGHIMTKLZOGFEEDDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBB 47 | AAAAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDEEEEFFFI KHGGGHGEDDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBB 48 | AAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDEEEFGIIGFFEEEDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBB 49 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-objmodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-objmodel.h - Interfaces for pluggable object models. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_OBJMODEL_H 22 | #define _JIT_OBJMODEL_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Opaque types that describe object model elements. 32 | */ 33 | typedef struct jit_objmodel *jit_objmodel_t; 34 | typedef struct jitom_class *jitom_class_t; 35 | typedef struct jitom_field *jitom_field_t; 36 | typedef struct jitom_method *jitom_method_t; 37 | 38 | /* 39 | * Modifier flags that describe an item's properties. 40 | */ 41 | #define JITOM_MODIFIER_ACCESS_MASK 0x0007 42 | #define JITOM_MODIFIER_PUBLIC 0x0000 43 | #define JITOM_MODIFIER_PRIVATE 0x0001 44 | #define JITOM_MODIFIER_PROTECTED 0x0002 45 | #define JITOM_MODIFIER_PACKAGE 0x0003 46 | #define JITOM_MODIFIER_PACKAGE_OR_PROTECTED 0x0004 47 | #define JITOM_MODIFIER_PACKAGE_AND_PROTECTED 0x0005 48 | #define JITOM_MODIFIER_OTHER1 0x0006 49 | #define JITOM_MODIFIER_OTHER2 0x0007 50 | #define JITOM_MODIFIER_STATIC 0x0008 51 | #define JITOM_MODIFIER_VIRTUAL 0x0010 52 | #define JITOM_MODIFIER_NEW_SLOT 0x0020 53 | #define JITOM_MODIFIER_ABSTRACT 0x0040 54 | #define JITOM_MODIFIER_LITERAL 0x0080 55 | #define JITOM_MODIFIER_CTOR 0x0100 56 | #define JITOM_MODIFIER_STATIC_CTOR 0x0200 57 | #define JITOM_MODIFIER_DTOR 0x0400 58 | #define JITOM_MODIFIER_INTERFACE 0x0800 59 | #define JITOM_MODIFIER_VALUE 0x1000 60 | #define JITOM_MODIFIER_FINAL 0x2000 61 | #define JITOM_MODIFIER_DELETE 0x4000 62 | #define JITOM_MODIFIER_REFERENCE_COUNTED 0x8000 63 | 64 | /* 65 | * Type tags that are used to mark instances of object model classes. 66 | */ 67 | #define JITOM_TYPETAG_CLASS 11000 /* Object reference */ 68 | #define JITOM_TYPETAG_VALUE 11001 /* Inline stack value */ 69 | 70 | /* 71 | * Operations on object models. 72 | */ 73 | void jitom_destroy_model(jit_objmodel_t model) JIT_NOTHROW; 74 | jitom_class_t jitom_get_class_by_name 75 | (jit_objmodel_t model, const char *name) JIT_NOTHROW; 76 | 77 | /* 78 | * Operations on object model classes. 79 | */ 80 | char *jitom_class_get_name 81 | (jit_objmodel_t model, jitom_class_t klass) JIT_NOTHROW; 82 | int jitom_class_get_modifiers 83 | (jit_objmodel_t model, jitom_class_t klass) JIT_NOTHROW; 84 | jit_type_t jitom_class_get_type 85 | (jit_objmodel_t model, jitom_class_t klass) JIT_NOTHROW; 86 | jit_type_t jitom_class_get_value_type 87 | (jit_objmodel_t model, jitom_class_t klass) JIT_NOTHROW; 88 | jitom_class_t jitom_class_get_primary_super 89 | (jit_objmodel_t model, jitom_class_t klass) JIT_NOTHROW; 90 | jitom_class_t *jitom_class_get_all_supers 91 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num) JIT_NOTHROW; 92 | jitom_class_t *jitom_class_get_interfaces 93 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num) JIT_NOTHROW; 94 | jitom_field_t *jitom_class_get_fields 95 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num) JIT_NOTHROW; 96 | jitom_method_t *jitom_class_get_methods 97 | (jit_objmodel_t model, jitom_class_t klass, unsigned int *num) JIT_NOTHROW; 98 | jit_value_t jitom_class_new 99 | (jit_objmodel_t model, jitom_class_t klass, 100 | jitom_method_t ctor, jit_function_t func, 101 | jit_value_t *args, unsigned int num_args, int flags) JIT_NOTHROW; 102 | jit_value_t jitom_class_new_value 103 | (jit_objmodel_t model, jitom_class_t klass, 104 | jitom_method_t ctor, jit_function_t func, 105 | jit_value_t *args, unsigned int num_args, int flags) JIT_NOTHROW; 106 | int jitom_class_delete 107 | (jit_objmodel_t model, jitom_class_t klass, 108 | jit_value_t obj_value) JIT_NOTHROW; 109 | int jitom_class_add_ref 110 | (jit_objmodel_t model, jitom_class_t klass, 111 | jit_value_t obj_value) JIT_NOTHROW; 112 | 113 | /* 114 | * Operations on object model fields. 115 | */ 116 | char *jitom_field_get_name 117 | (jit_objmodel_t model, jitom_class_t klass, 118 | jitom_field_t field) JIT_NOTHROW; 119 | jit_type_t jitom_field_get_type 120 | (jit_objmodel_t model, jitom_class_t klass, 121 | jitom_field_t field) JIT_NOTHROW; 122 | int jitom_field_get_modifiers 123 | (jit_objmodel_t model, jitom_class_t klass, 124 | jitom_field_t field) JIT_NOTHROW; 125 | jit_value_t jitom_field_load 126 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field, 127 | jit_function_t func, jit_value_t obj_value) JIT_NOTHROW; 128 | jit_value_t jitom_field_load_address 129 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field, 130 | jit_function_t func, jit_value_t obj_value) JIT_NOTHROW; 131 | int jitom_field_store 132 | (jit_objmodel_t model, jitom_class_t klass, jitom_field_t field, 133 | jit_function_t func, jit_value_t obj_value, jit_value_t value) JIT_NOTHROW; 134 | 135 | /* 136 | * Operations on object model methods. 137 | */ 138 | char *jitom_method_get_name 139 | (jit_objmodel_t model, jitom_class_t klass, 140 | jitom_method_t method) JIT_NOTHROW; 141 | jit_type_t jitom_method_get_type 142 | (jit_objmodel_t model, jitom_class_t klass, 143 | jitom_method_t method) JIT_NOTHROW; 144 | int jitom_method_get_modifiers 145 | (jit_objmodel_t model, jitom_class_t klass, 146 | jitom_method_t method) JIT_NOTHROW; 147 | jit_value_t jitom_method_invoke 148 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method, 149 | jit_function_t func, jit_value_t *args, 150 | unsigned int num_args, int flags) JIT_NOTHROW; 151 | jit_value_t jitom_method_invoke_virtual 152 | (jit_objmodel_t model, jitom_class_t klass, jitom_method_t method, 153 | jit_function_t func, jit_value_t *args, 154 | unsigned int num_args, int flags) JIT_NOTHROW; 155 | 156 | /* 157 | * Manipulate types that represent objects and inline values. 158 | */ 159 | jit_type_t jitom_type_tag_as_class 160 | (jit_type_t type, jit_objmodel_t model, 161 | jitom_class_t klass, int incref) JIT_NOTHROW; 162 | jit_type_t jitom_type_tag_as_value 163 | (jit_type_t type, jit_objmodel_t model, 164 | jitom_class_t klass, int incref) JIT_NOTHROW; 165 | int jitom_type_is_class(jit_type_t type) JIT_NOTHROW; 166 | int jitom_type_is_value(jit_type_t type) JIT_NOTHROW; 167 | jit_objmodel_t jitom_type_get_model(jit_type_t type) JIT_NOTHROW; 168 | jitom_class_t jitom_type_get_class(jit_type_t type) JIT_NOTHROW; 169 | 170 | #ifdef __cplusplus 171 | }; 172 | #endif 173 | 174 | #endif /* _JIT_OBJMODEL_H */ 175 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-type.h - Functions for manipulating type descriptors. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_TYPE_H 22 | #define _JIT_TYPE_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Pre-defined type descriptors. 32 | */ 33 | JIT_EXPORT_DATA jit_type_t const jit_type_void; 34 | JIT_EXPORT_DATA jit_type_t const jit_type_sbyte; 35 | JIT_EXPORT_DATA jit_type_t const jit_type_ubyte; 36 | JIT_EXPORT_DATA jit_type_t const jit_type_short; 37 | JIT_EXPORT_DATA jit_type_t const jit_type_ushort; 38 | JIT_EXPORT_DATA jit_type_t const jit_type_int; 39 | JIT_EXPORT_DATA jit_type_t const jit_type_uint; 40 | JIT_EXPORT_DATA jit_type_t const jit_type_nint; 41 | JIT_EXPORT_DATA jit_type_t const jit_type_nuint; 42 | JIT_EXPORT_DATA jit_type_t const jit_type_long; 43 | JIT_EXPORT_DATA jit_type_t const jit_type_ulong; 44 | JIT_EXPORT_DATA jit_type_t const jit_type_float32; 45 | JIT_EXPORT_DATA jit_type_t const jit_type_float64; 46 | JIT_EXPORT_DATA jit_type_t const jit_type_nfloat; 47 | JIT_EXPORT_DATA jit_type_t const jit_type_void_ptr; 48 | 49 | /* 50 | * Type descriptors for the system "char", "int", "long", etc types. 51 | * These are defined to one of the above values. 52 | */ 53 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_bool; 54 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_char; 55 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_schar; 56 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_uchar; 57 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_short; 58 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_ushort; 59 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_int; 60 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_uint; 61 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_long; 62 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_ulong; 63 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_longlong; 64 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_ulonglong; 65 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_float; 66 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_double; 67 | JIT_EXPORT_DATA jit_type_t const jit_type_sys_long_double; 68 | 69 | /* 70 | * Type kinds that may be returned by "jit_type_get_kind". 71 | */ 72 | #define JIT_TYPE_INVALID -1 73 | #define JIT_TYPE_VOID 0 74 | #define JIT_TYPE_SBYTE 1 75 | #define JIT_TYPE_UBYTE 2 76 | #define JIT_TYPE_SHORT 3 77 | #define JIT_TYPE_USHORT 4 78 | #define JIT_TYPE_INT 5 79 | #define JIT_TYPE_UINT 6 80 | #define JIT_TYPE_NINT 7 81 | #define JIT_TYPE_NUINT 8 82 | #define JIT_TYPE_LONG 9 83 | #define JIT_TYPE_ULONG 10 84 | #define JIT_TYPE_FLOAT32 11 85 | #define JIT_TYPE_FLOAT64 12 86 | #define JIT_TYPE_NFLOAT 13 87 | #define JIT_TYPE_MAX_PRIMITIVE JIT_TYPE_NFLOAT 88 | #define JIT_TYPE_STRUCT 14 89 | #define JIT_TYPE_UNION 15 90 | #define JIT_TYPE_SIGNATURE 16 91 | #define JIT_TYPE_PTR 17 92 | #define JIT_TYPE_FIRST_TAGGED 32 93 | 94 | /* 95 | * Special tag types. 96 | */ 97 | #define JIT_TYPETAG_NAME 10000 98 | #define JIT_TYPETAG_STRUCT_NAME 10001 99 | #define JIT_TYPETAG_UNION_NAME 10002 100 | #define JIT_TYPETAG_ENUM_NAME 10003 101 | #define JIT_TYPETAG_CONST 10004 102 | #define JIT_TYPETAG_VOLATILE 10005 103 | #define JIT_TYPETAG_REFERENCE 10006 104 | #define JIT_TYPETAG_OUTPUT 10007 105 | #define JIT_TYPETAG_RESTRICT 10008 106 | #define JIT_TYPETAG_SYS_BOOL 10009 107 | #define JIT_TYPETAG_SYS_CHAR 10010 108 | #define JIT_TYPETAG_SYS_SCHAR 10011 109 | #define JIT_TYPETAG_SYS_UCHAR 10012 110 | #define JIT_TYPETAG_SYS_SHORT 10013 111 | #define JIT_TYPETAG_SYS_USHORT 10014 112 | #define JIT_TYPETAG_SYS_INT 10015 113 | #define JIT_TYPETAG_SYS_UINT 10016 114 | #define JIT_TYPETAG_SYS_LONG 10017 115 | #define JIT_TYPETAG_SYS_ULONG 10018 116 | #define JIT_TYPETAG_SYS_LONGLONG 10019 117 | #define JIT_TYPETAG_SYS_ULONGLONG 10020 118 | #define JIT_TYPETAG_SYS_FLOAT 10021 119 | #define JIT_TYPETAG_SYS_DOUBLE 10022 120 | #define JIT_TYPETAG_SYS_LONGDOUBLE 10023 121 | 122 | /* 123 | * ABI types for function signatures. 124 | */ 125 | typedef enum 126 | { 127 | jit_abi_cdecl, /* Native C calling conventions */ 128 | jit_abi_vararg, /* Native C with optional variable arguments */ 129 | jit_abi_stdcall, /* Win32 STDCALL (same as cdecl if not Win32) */ 130 | jit_abi_fastcall /* Win32 FASTCALL (same as cdecl if not Win32) */ 131 | 132 | } jit_abi_t; 133 | 134 | /* 135 | * External function declarations. 136 | */ 137 | jit_type_t jit_type_copy(jit_type_t type) JIT_NOTHROW; 138 | void jit_type_free(jit_type_t type) JIT_NOTHROW; 139 | jit_type_t jit_type_create_struct 140 | (jit_type_t *fields, unsigned int num_fields, int incref) JIT_NOTHROW; 141 | jit_type_t jit_type_create_union 142 | (jit_type_t *fields, unsigned int num_fields, int incref) JIT_NOTHROW; 143 | jit_type_t jit_type_create_signature 144 | (jit_abi_t abi, jit_type_t return_type, jit_type_t *params, 145 | unsigned int num_params, int incref) JIT_NOTHROW; 146 | jit_type_t jit_type_create_pointer(jit_type_t type, int incref) JIT_NOTHROW; 147 | jit_type_t jit_type_create_tagged 148 | (jit_type_t type, int kind, void *data, 149 | jit_meta_free_func free_func, int incref) JIT_NOTHROW; 150 | int jit_type_set_names 151 | (jit_type_t type, char **names, unsigned int num_names) JIT_NOTHROW; 152 | void jit_type_set_size_and_alignment 153 | (jit_type_t type, jit_nint size, jit_nint alignment) JIT_NOTHROW; 154 | void jit_type_set_offset 155 | (jit_type_t type, unsigned int field_index, jit_nuint offset) JIT_NOTHROW; 156 | int jit_type_get_kind(jit_type_t type) JIT_NOTHROW; 157 | jit_nuint jit_type_get_size(jit_type_t type) JIT_NOTHROW; 158 | jit_nuint jit_type_get_alignment(jit_type_t type) JIT_NOTHROW; 159 | unsigned int jit_type_num_fields(jit_type_t type) JIT_NOTHROW; 160 | jit_type_t jit_type_get_field 161 | (jit_type_t type, unsigned int field_index) JIT_NOTHROW; 162 | jit_nuint jit_type_get_offset 163 | (jit_type_t type, unsigned int field_index) JIT_NOTHROW; 164 | const char *jit_type_get_name(jit_type_t type, unsigned int index) JIT_NOTHROW; 165 | #define JIT_INVALID_NAME (~((unsigned int)0)) 166 | unsigned int jit_type_find_name(jit_type_t type, const char *name) JIT_NOTHROW; 167 | unsigned int jit_type_num_params(jit_type_t type) JIT_NOTHROW; 168 | jit_type_t jit_type_get_return(jit_type_t type) JIT_NOTHROW; 169 | jit_type_t jit_type_get_param 170 | (jit_type_t type, unsigned int param_index) JIT_NOTHROW; 171 | jit_abi_t jit_type_get_abi(jit_type_t type) JIT_NOTHROW; 172 | jit_type_t jit_type_get_ref(jit_type_t type) JIT_NOTHROW; 173 | jit_type_t jit_type_get_tagged_type(jit_type_t type) JIT_NOTHROW; 174 | void jit_type_set_tagged_type 175 | (jit_type_t type, jit_type_t underlying, int incref) JIT_NOTHROW; 176 | int jit_type_get_tagged_kind(jit_type_t type) JIT_NOTHROW; 177 | void *jit_type_get_tagged_data(jit_type_t type) JIT_NOTHROW; 178 | void jit_type_set_tagged_data 179 | (jit_type_t type, void *data, jit_meta_free_func free_func) JIT_NOTHROW; 180 | int jit_type_is_primitive(jit_type_t type) JIT_NOTHROW; 181 | int jit_type_is_struct(jit_type_t type) JIT_NOTHROW; 182 | int jit_type_is_union(jit_type_t type) JIT_NOTHROW; 183 | int jit_type_is_signature(jit_type_t type) JIT_NOTHROW; 184 | int jit_type_is_pointer(jit_type_t type) JIT_NOTHROW; 185 | int jit_type_is_tagged(jit_type_t type) JIT_NOTHROW; 186 | jit_nuint jit_type_best_alignment(void) JIT_NOTHROW; 187 | jit_type_t jit_type_normalize(jit_type_t type) JIT_NOTHROW; 188 | jit_type_t jit_type_remove_tags(jit_type_t type) JIT_NOTHROW; 189 | jit_type_t jit_type_promote_int(jit_type_t type) JIT_NOTHROW; 190 | int jit_type_return_via_pointer(jit_type_t type) JIT_NOTHROW; 191 | int jit_type_has_tag(jit_type_t type, int kind) JIT_NOTHROW; 192 | 193 | #ifdef __cplusplus 194 | }; 195 | #endif 196 | 197 | #endif /* _JIT_TYPE_H */ 198 | -------------------------------------------------------------------------------- /bench/mandelbrot.bf: -------------------------------------------------------------------------------- 1 | +++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++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<<<<<<<<<<[<<<<<<< 140 | <<]>>>>[-]+>>>>>[>>>>>>>>>]>+<]]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>> 141 | -<<[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+>>>>>>[>>>>>> 142 | >>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++ 143 | +[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<< 144 | <<<<<]]>>>] -------------------------------------------------------------------------------- /libjit/include/jit/jit-insn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-insn.h - Functions for manipulating instructions. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_INSN_H 22 | #define _JIT_INSN_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* 31 | * Descriptor for an intrinsic function. 32 | */ 33 | typedef struct 34 | { 35 | jit_type_t return_type; 36 | jit_type_t ptr_result_type; 37 | jit_type_t arg1_type; 38 | jit_type_t arg2_type; 39 | 40 | } jit_intrinsic_descr_t; 41 | 42 | /* 43 | * Structure for iterating over the instructions in a block. 44 | * This should be treated as opaque. 45 | */ 46 | typedef struct 47 | { 48 | jit_block_t block; 49 | int posn; 50 | 51 | } jit_insn_iter_t; 52 | 53 | /* 54 | * Flags for "jit_insn_call" and friends. 55 | */ 56 | #define JIT_CALL_NOTHROW (1 << 0) 57 | #define JIT_CALL_NORETURN (1 << 1) 58 | #define JIT_CALL_TAIL (1 << 2) 59 | 60 | int jit_insn_get_opcode(jit_insn_t insn) JIT_NOTHROW; 61 | jit_value_t jit_insn_get_dest(jit_insn_t insn) JIT_NOTHROW; 62 | jit_value_t jit_insn_get_value1(jit_insn_t insn) JIT_NOTHROW; 63 | jit_value_t jit_insn_get_value2(jit_insn_t insn) JIT_NOTHROW; 64 | jit_label_t jit_insn_get_label(jit_insn_t insn) JIT_NOTHROW; 65 | jit_function_t jit_insn_get_function(jit_insn_t insn) JIT_NOTHROW; 66 | void *jit_insn_get_native(jit_insn_t insn) JIT_NOTHROW; 67 | const char *jit_insn_get_name(jit_insn_t insn) JIT_NOTHROW; 68 | jit_type_t jit_insn_get_signature(jit_insn_t insn) JIT_NOTHROW; 69 | int jit_insn_dest_is_value(jit_insn_t insn) JIT_NOTHROW; 70 | 71 | int jit_insn_label(jit_function_t func, jit_label_t *label) JIT_NOTHROW; 72 | int jit_insn_new_block(jit_function_t func) JIT_NOTHROW; 73 | jit_value_t jit_insn_load(jit_function_t func, jit_value_t value) JIT_NOTHROW; 74 | jit_value_t jit_insn_dup(jit_function_t func, jit_value_t value) JIT_NOTHROW; 75 | jit_value_t jit_insn_load_small 76 | (jit_function_t func, jit_value_t value) JIT_NOTHROW; 77 | int jit_insn_store 78 | (jit_function_t func, jit_value_t dest, jit_value_t value) JIT_NOTHROW; 79 | jit_value_t jit_insn_load_relative 80 | (jit_function_t func, jit_value_t value, 81 | jit_nint offset, jit_type_t type) JIT_NOTHROW; 82 | int jit_insn_store_relative 83 | (jit_function_t func, jit_value_t dest, 84 | jit_nint offset, jit_value_t value) JIT_NOTHROW; 85 | jit_value_t jit_insn_add_relative 86 | (jit_function_t func, jit_value_t value, jit_nint offset) JIT_NOTHROW; 87 | jit_value_t jit_insn_load_elem 88 | (jit_function_t func, jit_value_t base_addr, 89 | jit_value_t index, jit_type_t elem_type) JIT_NOTHROW; 90 | jit_value_t jit_insn_load_elem_address 91 | (jit_function_t func, jit_value_t base_addr, 92 | jit_value_t index, jit_type_t elem_type) JIT_NOTHROW; 93 | int jit_insn_store_elem 94 | (jit_function_t func, jit_value_t base_addr, 95 | jit_value_t index, jit_value_t value) JIT_NOTHROW; 96 | int jit_insn_check_null(jit_function_t func, jit_value_t value) JIT_NOTHROW; 97 | 98 | jit_value_t jit_insn_add 99 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 100 | jit_value_t jit_insn_add_ovf 101 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 102 | jit_value_t jit_insn_sub 103 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 104 | jit_value_t jit_insn_sub_ovf 105 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 106 | jit_value_t jit_insn_mul 107 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 108 | jit_value_t jit_insn_mul_ovf 109 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 110 | jit_value_t jit_insn_div 111 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 112 | jit_value_t jit_insn_rem 113 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 114 | jit_value_t jit_insn_rem_ieee 115 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 116 | jit_value_t jit_insn_neg 117 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 118 | jit_value_t jit_insn_and 119 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 120 | jit_value_t jit_insn_or 121 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 122 | jit_value_t jit_insn_xor 123 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 124 | jit_value_t jit_insn_not 125 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 126 | jit_value_t jit_insn_shl 127 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 128 | jit_value_t jit_insn_shr 129 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 130 | jit_value_t jit_insn_ushr 131 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 132 | jit_value_t jit_insn_sshr 133 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 134 | jit_value_t jit_insn_eq 135 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 136 | jit_value_t jit_insn_ne 137 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 138 | jit_value_t jit_insn_lt 139 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 140 | jit_value_t jit_insn_le 141 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 142 | jit_value_t jit_insn_gt 143 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 144 | jit_value_t jit_insn_ge 145 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 146 | jit_value_t jit_insn_cmpl 147 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 148 | jit_value_t jit_insn_cmpg 149 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 150 | jit_value_t jit_insn_to_bool 151 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 152 | jit_value_t jit_insn_to_not_bool 153 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 154 | jit_value_t jit_insn_acos 155 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 156 | jit_value_t jit_insn_asin 157 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 158 | jit_value_t jit_insn_atan 159 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 160 | jit_value_t jit_insn_atan2 161 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 162 | jit_value_t jit_insn_ceil 163 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 164 | jit_value_t jit_insn_cos 165 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 166 | jit_value_t jit_insn_cosh 167 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 168 | jit_value_t jit_insn_exp 169 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 170 | jit_value_t jit_insn_floor 171 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 172 | jit_value_t jit_insn_log 173 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 174 | jit_value_t jit_insn_log10 175 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 176 | jit_value_t jit_insn_pow 177 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 178 | jit_value_t jit_insn_rint 179 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 180 | jit_value_t jit_insn_round 181 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 182 | jit_value_t jit_insn_sin 183 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 184 | jit_value_t jit_insn_sinh 185 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 186 | jit_value_t jit_insn_sqrt 187 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 188 | jit_value_t jit_insn_tan 189 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 190 | jit_value_t jit_insn_tanh 191 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 192 | jit_value_t jit_insn_trunc 193 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 194 | jit_value_t jit_insn_is_nan 195 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 196 | jit_value_t jit_insn_is_finite 197 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 198 | jit_value_t jit_insn_is_inf 199 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 200 | jit_value_t jit_insn_abs 201 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 202 | jit_value_t jit_insn_min 203 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 204 | jit_value_t jit_insn_max 205 | (jit_function_t func, jit_value_t value1, jit_value_t value2) JIT_NOTHROW; 206 | jit_value_t jit_insn_sign 207 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 208 | int jit_insn_branch 209 | (jit_function_t func, jit_label_t *label) JIT_NOTHROW; 210 | int jit_insn_branch_if 211 | (jit_function_t func, jit_value_t value, jit_label_t *label) JIT_NOTHROW; 212 | int jit_insn_branch_if_not 213 | (jit_function_t func, jit_value_t value, jit_label_t *label) JIT_NOTHROW; 214 | int jit_insn_jump_table 215 | (jit_function_t func, jit_value_t value, 216 | jit_label_t *labels, unsigned int num_labels) JIT_NOTHROW; 217 | jit_value_t jit_insn_address_of 218 | (jit_function_t func, jit_value_t value1) JIT_NOTHROW; 219 | jit_value_t jit_insn_address_of_label 220 | (jit_function_t func, jit_label_t *label) JIT_NOTHROW; 221 | jit_value_t jit_insn_convert 222 | (jit_function_t func, jit_value_t value, 223 | jit_type_t type, int overflow_check) JIT_NOTHROW; 224 | 225 | jit_value_t jit_insn_call 226 | (jit_function_t func, const char *name, 227 | jit_function_t jit_func, jit_type_t signature, 228 | jit_value_t *args, unsigned int num_args, int flags) JIT_NOTHROW; 229 | jit_value_t jit_insn_call_indirect 230 | (jit_function_t func, jit_value_t value, jit_type_t signature, 231 | jit_value_t *args, unsigned int num_args, int flags) JIT_NOTHROW; 232 | jit_value_t jit_insn_call_indirect_vtable 233 | (jit_function_t func, jit_value_t value, jit_type_t signature, 234 | jit_value_t *args, unsigned int num_args, int flags) JIT_NOTHROW; 235 | jit_value_t jit_insn_call_native 236 | (jit_function_t func, const char *name, 237 | void *native_func, jit_type_t signature, 238 | jit_value_t *args, unsigned int num_args, int flags) JIT_NOTHROW; 239 | jit_value_t jit_insn_call_intrinsic 240 | (jit_function_t func, const char *name, void *intrinsic_func, 241 | const jit_intrinsic_descr_t *descriptor, 242 | jit_value_t arg1, jit_value_t arg2) JIT_NOTHROW; 243 | int jit_insn_incoming_reg 244 | (jit_function_t func, jit_value_t value, int reg) JIT_NOTHROW; 245 | int jit_insn_incoming_frame_posn 246 | (jit_function_t func, jit_value_t value, jit_nint frame_offset) JIT_NOTHROW; 247 | int jit_insn_outgoing_reg 248 | (jit_function_t func, jit_value_t value, int reg) JIT_NOTHROW; 249 | int jit_insn_outgoing_frame_posn 250 | (jit_function_t func, jit_value_t value, jit_nint frame_offset) JIT_NOTHROW; 251 | int jit_insn_return_reg 252 | (jit_function_t func, jit_value_t value, int reg) JIT_NOTHROW; 253 | int jit_insn_setup_for_nested 254 | (jit_function_t func, int nested_level, int reg) JIT_NOTHROW; 255 | int jit_insn_flush_struct(jit_function_t func, jit_value_t value) JIT_NOTHROW; 256 | jit_value_t jit_insn_import 257 | (jit_function_t func, jit_value_t value) JIT_NOTHROW; 258 | int jit_insn_push(jit_function_t func, jit_value_t value) JIT_NOTHROW; 259 | int jit_insn_push_ptr 260 | (jit_function_t func, jit_value_t value, jit_type_t type) JIT_NOTHROW; 261 | int jit_insn_set_param 262 | (jit_function_t func, jit_value_t value, jit_nint offset) JIT_NOTHROW; 263 | int jit_insn_set_param_ptr 264 | (jit_function_t func, jit_value_t value, jit_type_t type, 265 | jit_nint offset) JIT_NOTHROW; 266 | int jit_insn_push_return_area_ptr(jit_function_t func) JIT_NOTHROW; 267 | int jit_insn_pop_stack(jit_function_t func, jit_nint num_items) JIT_NOTHROW; 268 | int jit_insn_defer_pop_stack 269 | (jit_function_t func, jit_nint num_items) JIT_NOTHROW; 270 | int jit_insn_flush_defer_pop 271 | (jit_function_t func, jit_nint num_items) JIT_NOTHROW; 272 | int jit_insn_return(jit_function_t func, jit_value_t value) JIT_NOTHROW; 273 | int jit_insn_return_ptr 274 | (jit_function_t func, jit_value_t value, jit_type_t type) JIT_NOTHROW; 275 | int jit_insn_default_return(jit_function_t func) JIT_NOTHROW; 276 | int jit_insn_throw(jit_function_t func, jit_value_t value) JIT_NOTHROW; 277 | jit_value_t jit_insn_get_call_stack(jit_function_t func) JIT_NOTHROW; 278 | 279 | jit_value_t jit_insn_thrown_exception(jit_function_t func) JIT_NOTHROW; 280 | int jit_insn_uses_catcher(jit_function_t func) JIT_NOTHROW; 281 | jit_value_t jit_insn_start_catcher(jit_function_t func) JIT_NOTHROW; 282 | int jit_insn_branch_if_pc_not_in_range 283 | (jit_function_t func, jit_label_t start_label, 284 | jit_label_t end_label, jit_label_t *label) JIT_NOTHROW; 285 | int jit_insn_rethrow_unhandled(jit_function_t func) JIT_NOTHROW; 286 | int jit_insn_start_finally 287 | (jit_function_t func, jit_label_t *finally_label) JIT_NOTHROW; 288 | int jit_insn_return_from_finally(jit_function_t func) JIT_NOTHROW; 289 | int jit_insn_call_finally 290 | (jit_function_t func, jit_label_t *finally_label) JIT_NOTHROW; 291 | jit_value_t jit_insn_start_filter 292 | (jit_function_t func, jit_label_t *label, jit_type_t type) JIT_NOTHROW; 293 | int jit_insn_return_from_filter 294 | (jit_function_t func, jit_value_t value) JIT_NOTHROW; 295 | jit_value_t jit_insn_call_filter 296 | (jit_function_t func, jit_label_t *label, 297 | jit_value_t value, jit_type_t type) JIT_NOTHROW; 298 | 299 | int jit_insn_memcpy 300 | (jit_function_t func, jit_value_t dest, 301 | jit_value_t src, jit_value_t size) JIT_NOTHROW; 302 | int jit_insn_memmove 303 | (jit_function_t func, jit_value_t dest, 304 | jit_value_t src, jit_value_t size) JIT_NOTHROW; 305 | int jit_insn_memset 306 | (jit_function_t func, jit_value_t dest, 307 | jit_value_t value, jit_value_t size) JIT_NOTHROW; 308 | jit_value_t jit_insn_alloca 309 | (jit_function_t func, jit_value_t size) JIT_NOTHROW; 310 | 311 | int jit_insn_move_blocks_to_end 312 | (jit_function_t func, jit_label_t from_label, jit_label_t to_label) 313 | JIT_NOTHROW; 314 | int jit_insn_move_blocks_to_start 315 | (jit_function_t func, jit_label_t from_label, jit_label_t to_label) 316 | JIT_NOTHROW; 317 | 318 | int jit_insn_mark_offset 319 | (jit_function_t func, jit_int offset) JIT_NOTHROW; 320 | int jit_insn_mark_breakpoint 321 | (jit_function_t func, jit_nint data1, jit_nint data2) JIT_NOTHROW; 322 | int jit_insn_mark_breakpoint_variable 323 | (jit_function_t func, jit_value_t data1, jit_value_t data2) JIT_NOTHROW; 324 | 325 | void jit_insn_iter_init(jit_insn_iter_t *iter, jit_block_t block) JIT_NOTHROW; 326 | void jit_insn_iter_init_last 327 | (jit_insn_iter_t *iter, jit_block_t block) JIT_NOTHROW; 328 | jit_insn_t jit_insn_iter_next(jit_insn_iter_t *iter) JIT_NOTHROW; 329 | jit_insn_t jit_insn_iter_previous(jit_insn_iter_t *iter) JIT_NOTHROW; 330 | 331 | #ifdef __cplusplus 332 | }; 333 | #endif 334 | 335 | #endif /* _JIT_INSN_H */ 336 | -------------------------------------------------------------------------------- /libjit/include/jit/jit-plus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit-plus.h - C++ binding for the JIT library. 3 | * 4 | * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 | * 6 | * The libjit library is free software: you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation, either version 2.1 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * The libjit library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with the libjit library. If not, see 18 | * . 19 | */ 20 | 21 | #ifndef _JIT_PLUS_H 22 | #define _JIT_PLUS_H 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | 28 | class jit_build_exception 29 | { 30 | public: 31 | jit_build_exception(int result) { this->result = result; } 32 | ~jit_build_exception() {} 33 | 34 | int result; 35 | }; 36 | 37 | class jit_value 38 | { 39 | public: 40 | jit_value() { this->value = 0; } 41 | jit_value(jit_value_t value) { this->value = value; } 42 | jit_value(const jit_value& value) { this->value = value.value; } 43 | ~jit_value() {} 44 | 45 | jit_value& operator=(const jit_value& value) 46 | { this->value = value.value; return *this; } 47 | 48 | jit_value_t raw() const { return value; } 49 | int is_valid() const { return (value != 0); } 50 | 51 | int is_temporary() const { return jit_value_is_temporary(value); } 52 | int is_local() const { return jit_value_is_local(value); } 53 | int is_constant() const { return jit_value_is_constant(value); } 54 | int is_parameter() const { return jit_value_is_parameter(value); } 55 | 56 | void set_volatile() { jit_value_set_volatile(value); } 57 | int is_volatile() const { return jit_value_is_volatile(value); } 58 | 59 | void set_addressable() { jit_value_set_addressable(value); } 60 | int is_addressable() const { return jit_value_is_addressable(value); } 61 | 62 | jit_type_t type() const { return jit_value_get_type(value); } 63 | jit_function_t function() const { return jit_value_get_function(value); } 64 | jit_block_t block() const { return jit_value_get_block(value); } 65 | jit_context_t context() const { return jit_value_get_context(value); } 66 | 67 | jit_constant_t constant() const 68 | { return jit_value_get_constant(value); } 69 | jit_nint nint_constant() const 70 | { return jit_value_get_nint_constant(value); } 71 | jit_long long_constant() const 72 | { return jit_value_get_long_constant(value); } 73 | jit_float32 float32_constant() const 74 | { return jit_value_get_float32_constant(value); } 75 | jit_float64 float64_constant() const 76 | { return jit_value_get_float64_constant(value); } 77 | jit_nfloat nfloat_constant() const 78 | { return jit_value_get_nfloat_constant(value); } 79 | 80 | private: 81 | jit_value_t value; 82 | }; 83 | 84 | jit_value operator+(const jit_value& value1, const jit_value& value2); 85 | jit_value operator-(const jit_value& value1, const jit_value& value2); 86 | jit_value operator*(const jit_value& value1, const jit_value& value2); 87 | jit_value operator/(const jit_value& value1, const jit_value& value2); 88 | jit_value operator%(const jit_value& value1, const jit_value& value2); 89 | jit_value operator-(const jit_value& value1); 90 | jit_value operator&(const jit_value& value1, const jit_value& value2); 91 | jit_value operator|(const jit_value& value1, const jit_value& value2); 92 | jit_value operator^(const jit_value& value1, const jit_value& value2); 93 | jit_value operator~(const jit_value& value1); 94 | jit_value operator<<(const jit_value& value1, const jit_value& value2); 95 | jit_value operator>>(const jit_value& value1, const jit_value& value2); 96 | jit_value operator==(const jit_value& value1, const jit_value& value2); 97 | jit_value operator!=(const jit_value& value1, const jit_value& value2); 98 | jit_value operator<(const jit_value& value1, const jit_value& value2); 99 | jit_value operator<=(const jit_value& value1, const jit_value& value2); 100 | jit_value operator>(const jit_value& value1, const jit_value& value2); 101 | jit_value operator>=(const jit_value& value1, const jit_value& value2); 102 | 103 | class jit_label 104 | { 105 | public: 106 | jit_label() { label = jit_label_undefined; } 107 | jit_label(jit_label_t label) { this->label = label; } 108 | jit_label(const jit_label& label) { this->label = label.label; } 109 | ~jit_label() {} 110 | 111 | jit_label_t raw() const { return label; } 112 | jit_label_t *rawp() { return &label; } 113 | int is_valid() const { return (label != jit_label_undefined); } 114 | 115 | jit_label& operator=(const jit_label& value) 116 | { this->label = value.label; return *this; } 117 | 118 | private: 119 | jit_label_t label; 120 | }; 121 | 122 | class jit_jump_table 123 | { 124 | public: 125 | 126 | jit_jump_table(int size); 127 | ~jit_jump_table(); 128 | 129 | int size() { return num_labels; } 130 | jit_label_t *raw() { return labels; } 131 | 132 | jit_label get(int index); 133 | 134 | void set(int index, jit_label label); 135 | 136 | private: 137 | 138 | jit_label_t *labels; 139 | int num_labels; 140 | 141 | // forbid copying 142 | jit_jump_table(const jit_jump_table&); 143 | jit_jump_table& operator=(const jit_jump_table&); 144 | }; 145 | 146 | class jit_context 147 | { 148 | public: 149 | jit_context(); 150 | jit_context(jit_context_t context); 151 | ~jit_context(); 152 | 153 | void build_start() { jit_context_build_start(context); } 154 | void build_end() { jit_context_build_end(context); } 155 | jit_context_t raw() const { return context; } 156 | 157 | private: 158 | jit_context_t context; 159 | int copied; 160 | }; 161 | 162 | class jit_function 163 | { 164 | public: 165 | jit_function(jit_context& context, jit_type_t signature); 166 | jit_function(jit_context& context); 167 | jit_function(jit_function_t func); 168 | virtual ~jit_function(); 169 | 170 | jit_function_t raw() const { return func; } 171 | int is_valid() const { return (func != 0); } 172 | 173 | static jit_function *from_raw(jit_function_t func); 174 | 175 | jit_type_t signature() const { return jit_function_get_signature(func); } 176 | 177 | void create(jit_type_t signature); 178 | void create(); 179 | 180 | int compile(); 181 | 182 | int is_compiled() const { return jit_function_is_compiled(func); } 183 | 184 | int is_recompilable() const { return jit_function_is_recompilable(func); } 185 | 186 | void set_recompilable() { jit_function_set_recompilable(func); } 187 | void clear_recompilable() { jit_function_clear_recompilable(func); } 188 | void set_recompilable(int flag) 189 | { if(flag) set_recompilable(); else clear_recompilable(); } 190 | 191 | void set_optimization_level(unsigned int level) 192 | { jit_function_set_optimization_level(func, level); } 193 | unsigned int optimization_level() const 194 | { return jit_function_get_optimization_level(func); } 195 | static unsigned int max_optimization_level() 196 | { return jit_function_get_max_optimization_level(); } 197 | 198 | void *closure() const { return jit_function_to_closure(func); } 199 | void *vtable_pointer() const 200 | { return jit_function_to_vtable_pointer(func); } 201 | 202 | int apply(void **args, void *result) 203 | { return jit_function_apply(func, args, result); } 204 | int apply(jit_type_t signature, void **args, void *return_area) 205 | { return jit_function_apply_vararg 206 | (func, signature, args, return_area); } 207 | 208 | static jit_type_t const end_params; 209 | static jit_type_t signature_helper(jit_type_t return_type, ...); 210 | 211 | protected: 212 | virtual void build(); 213 | virtual jit_type_t create_signature(); 214 | void fail(); 215 | void out_of_memory(); 216 | 217 | public: 218 | void build_start() 219 | { jit_context_build_start(jit_function_get_context(func)); } 220 | void build_end() 221 | { jit_context_build_end(jit_function_get_context(func)); } 222 | 223 | jit_value new_value(jit_type_t type); 224 | jit_value new_constant(jit_sbyte value, jit_type_t type=0); 225 | jit_value new_constant(jit_ubyte value, jit_type_t type=0); 226 | jit_value new_constant(jit_short value, jit_type_t type=0); 227 | jit_value new_constant(jit_ushort value, jit_type_t type=0); 228 | jit_value new_constant(jit_int value, jit_type_t type=0); 229 | jit_value new_constant(jit_uint value, jit_type_t type=0); 230 | jit_value new_constant(jit_long value, jit_type_t type=0); 231 | jit_value new_constant(jit_ulong value, jit_type_t type=0); 232 | jit_value new_constant(jit_float32 value, jit_type_t type=0); 233 | jit_value new_constant(jit_float64 value, jit_type_t type=0); 234 | #ifndef JIT_NFLOAT_IS_DOUBLE 235 | jit_value new_constant(jit_nfloat value, jit_type_t type=0); 236 | #endif 237 | jit_value new_constant(void *value, jit_type_t type=0); 238 | jit_value new_constant(const jit_constant_t& value); 239 | jit_value get_param(unsigned int param); 240 | jit_value get_struct_pointer(); 241 | 242 | jit_label new_label(); 243 | 244 | void insn_label(jit_label& label); 245 | void insn_new_block(); 246 | jit_value insn_load(const jit_value& value); 247 | jit_value insn_dup(const jit_value& value); 248 | jit_value insn_load_small(const jit_value& value); 249 | void store(const jit_value& dest, const jit_value& value); 250 | jit_value insn_load_relative 251 | (const jit_value& value, jit_nint offset, jit_type_t type); 252 | void insn_store_relative 253 | (const jit_value& dest, jit_nint offset, const jit_value& value); 254 | jit_value insn_add_relative(const jit_value& value, jit_nint offset); 255 | jit_value insn_load_elem 256 | (const jit_value& base_addr, const jit_value& index, 257 | jit_type_t elem_type); 258 | jit_value insn_load_elem_address 259 | (const jit_value& base_addr, const jit_value& index, 260 | jit_type_t elem_type); 261 | void insn_store_elem 262 | (const jit_value& base_addr, const jit_value& index, 263 | const jit_value& value); 264 | void insn_check_null(const jit_value& value); 265 | jit_value insn_add(const jit_value& value1, const jit_value& value2); 266 | jit_value insn_add_ovf(const jit_value& value1, const jit_value& value2); 267 | jit_value insn_sub(const jit_value& value1, const jit_value& value2); 268 | jit_value insn_sub_ovf(const jit_value& value1, const jit_value& value2); 269 | jit_value insn_mul(const jit_value& value1, const jit_value& value2); 270 | jit_value insn_mul_ovf(const jit_value& value1, const jit_value& value2); 271 | jit_value insn_div(const jit_value& value1, const jit_value& value2); 272 | jit_value insn_rem(const jit_value& value1, const jit_value& value2); 273 | jit_value insn_rem_ieee(const jit_value& value1, const jit_value& value2); 274 | jit_value insn_neg(const jit_value& value1); 275 | jit_value insn_and(const jit_value& value1, const jit_value& value2); 276 | jit_value insn_or(const jit_value& value1, const jit_value& value2); 277 | jit_value insn_xor(const jit_value& value1, const jit_value& value2); 278 | jit_value insn_not(const jit_value& value1); 279 | jit_value insn_shl(const jit_value& value1, const jit_value& value2); 280 | jit_value insn_shr(const jit_value& value1, const jit_value& value2); 281 | jit_value insn_ushr(const jit_value& value1, const jit_value& value2); 282 | jit_value insn_sshr(const jit_value& value1, const jit_value& value2); 283 | jit_value insn_eq(const jit_value& value1, const jit_value& value2); 284 | jit_value insn_ne(const jit_value& value1, const jit_value& value2); 285 | jit_value insn_lt(const jit_value& value1, const jit_value& value2); 286 | jit_value insn_le(const jit_value& value1, const jit_value& value2); 287 | jit_value insn_gt(const jit_value& value1, const jit_value& value2); 288 | jit_value insn_ge(const jit_value& value1, const jit_value& value2); 289 | jit_value insn_cmpl(const jit_value& value1, const jit_value& value2); 290 | jit_value insn_cmpg(const jit_value& value1, const jit_value& value2); 291 | jit_value insn_to_bool(const jit_value& value1); 292 | jit_value insn_to_not_bool(const jit_value& value1); 293 | jit_value insn_acos(const jit_value& value1); 294 | jit_value insn_asin(const jit_value& value1); 295 | jit_value insn_atan(const jit_value& value1); 296 | jit_value insn_atan2(const jit_value& value1, const jit_value& value2); 297 | jit_value insn_ceil(const jit_value& value1); 298 | jit_value insn_cos(const jit_value& value1); 299 | jit_value insn_cosh(const jit_value& value1); 300 | jit_value insn_exp(const jit_value& value1); 301 | jit_value insn_floor(const jit_value& value1); 302 | jit_value insn_log(const jit_value& value1); 303 | jit_value insn_log10(const jit_value& value1); 304 | jit_value insn_pow(const jit_value& value1, const jit_value& value2); 305 | jit_value insn_rint(const jit_value& value1); 306 | jit_value insn_round(const jit_value& value1); 307 | jit_value insn_sin(const jit_value& value1); 308 | jit_value insn_sinh(const jit_value& value1); 309 | jit_value insn_sqrt(const jit_value& value1); 310 | jit_value insn_tan(const jit_value& value1); 311 | jit_value insn_tanh(const jit_value& value1); 312 | jit_value insn_trunc(const jit_value& value1); 313 | jit_value insn_is_nan(const jit_value& value1); 314 | jit_value insn_is_finite(const jit_value& value1); 315 | jit_value insn_is_inf(const jit_value& value1); 316 | jit_value insn_abs(const jit_value& value1); 317 | jit_value insn_min(const jit_value& value1, const jit_value& value2); 318 | jit_value insn_max(const jit_value& value1, const jit_value& value2); 319 | jit_value insn_sign(const jit_value& value1); 320 | void insn_branch(jit_label& label); 321 | void insn_branch_if(const jit_value& value, jit_label& label); 322 | void insn_branch_if_not(const jit_value& value, jit_label& label); 323 | void insn_jump_table(const jit_value& value, jit_jump_table& jump_table); 324 | jit_value insn_address_of(const jit_value& value1); 325 | jit_value insn_address_of_label(jit_label& label); 326 | jit_value insn_convert 327 | (const jit_value& value, jit_type_t type, int overflow_check=0); 328 | jit_value insn_call 329 | (const char *name, jit_function_t jit_func, 330 | jit_type_t signature, jit_value_t *args, unsigned int num_args, 331 | int flags=0); 332 | jit_value insn_call_indirect 333 | (const jit_value& value, jit_type_t signature, 334 | jit_value_t *args, unsigned int num_args, int flags=0); 335 | jit_value insn_call_indirect_vtable 336 | (const jit_value& value, jit_type_t signature, 337 | jit_value_t *args, unsigned int num_args, int flags=0); 338 | jit_value insn_call_native 339 | (const char *name, void *native_func, jit_type_t signature, 340 | jit_value_t *args, unsigned int num_args, int flags=0); 341 | jit_value insn_call_intrinsic 342 | (const char *name, void *intrinsic_func, 343 | const jit_intrinsic_descr_t& descriptor, 344 | const jit_value& arg1, const jit_value& arg2); 345 | void insn_incoming_reg(const jit_value& value, int reg); 346 | void insn_incoming_frame_posn(const jit_value& value, jit_nint posn); 347 | void insn_outgoing_reg(const jit_value& value, int reg); 348 | void insn_outgoing_frame_posn(const jit_value& value, jit_nint posn); 349 | void insn_return_reg(const jit_value& value, int reg); 350 | void insn_setup_for_nested(int nested_level, int reg); 351 | void insn_flush_struct(const jit_value& value); 352 | jit_value insn_import(jit_value value); 353 | void insn_push(const jit_value& value); 354 | void insn_push_ptr(const jit_value& value, jit_type_t type); 355 | void insn_set_param(const jit_value& value, jit_nint offset); 356 | void insn_set_param_ptr 357 | (const jit_value& value, jit_type_t type, jit_nint offset); 358 | void insn_push_return_area_ptr(); 359 | void insn_return(const jit_value& value); 360 | void insn_return(); 361 | void insn_return_ptr(const jit_value& value, jit_type_t type); 362 | void insn_default_return(); 363 | void insn_throw(const jit_value& value); 364 | jit_value insn_get_call_stack(); 365 | jit_value insn_thrown_exception(); 366 | void insn_uses_catcher(); 367 | jit_value insn_start_catcher(); 368 | void insn_branch_if_pc_not_in_range 369 | (const jit_label& start_label, const jit_label& end_label, 370 | jit_label& label); 371 | void insn_rethrow_unhandled(); 372 | void insn_start_finally(jit_label& label); 373 | void insn_return_from_finally(); 374 | void insn_call_finally(jit_label& label); 375 | jit_value insn_start_filter(jit_label& label, jit_type_t type); 376 | void insn_return_from_filter(const jit_value& value); 377 | jit_value insn_call_filter 378 | (jit_label& label, const jit_value& value, jit_type_t type); 379 | void insn_memcpy 380 | (const jit_value& dest, const jit_value& src, const jit_value& size); 381 | void insn_memmove 382 | (const jit_value& dest, const jit_value& src, const jit_value& size); 383 | void insn_memset 384 | (const jit_value& dest, const jit_value& value, const jit_value& size); 385 | jit_value insn_alloca(const jit_value& size); 386 | void insn_move_blocks_to_end 387 | (const jit_label& from_label, const jit_label& to_label); 388 | void insn_move_blocks_to_start 389 | (const jit_label& from_label, const jit_label& to_label); 390 | void insn_mark_offset(jit_int offset); 391 | void insn_mark_breakpoint(jit_nint data1, jit_nint data2); 392 | 393 | private: 394 | jit_function_t func; 395 | jit_context_t context; 396 | 397 | void register_on_demand(); 398 | static int on_demand_compiler(jit_function_t func); 399 | static void free_mapping(void *data); 400 | }; 401 | 402 | #endif /* __cplusplus */ 403 | 404 | #endif /* _JIT_PLUS_H */ 405 | -------------------------------------------------------------------------------- /libjit/include/jit/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.3 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | pkgdatadir = $(datadir)/@PACKAGE@ 20 | pkgincludedir = $(includedir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | install_sh_DATA = $(install_sh) -c -m 644 25 | install_sh_PROGRAM = $(install_sh) -c 26 | install_sh_SCRIPT = $(install_sh) -c 27 | INSTALL_HEADER = $(INSTALL_DATA) 28 | transform = $(program_transform_name) 29 | NORMAL_INSTALL = : 30 | PRE_INSTALL = : 31 | POST_INSTALL = : 32 | NORMAL_UNINSTALL = : 33 | PRE_UNINSTALL = : 34 | POST_UNINSTALL = : 35 | build_triplet = @build@ 36 | host_triplet = @host@ 37 | subdir = include/jit 38 | DIST_COMMON = $(dist_libjitinclude_HEADERS) $(noinst_HEADERS) \ 39 | $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 40 | $(srcdir)/jit-defs.h.in 41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 42 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 43 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 44 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 45 | $(top_srcdir)/configure.ac 46 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 47 | $(ACLOCAL_M4) 48 | mkinstalldirs = $(install_sh) -d 49 | CONFIG_HEADER = $(top_builddir)/config.h 50 | CONFIG_CLEAN_FILES = jit-defs.h 51 | CONFIG_CLEAN_VPATH_FILES = 52 | SOURCES = 53 | DIST_SOURCES = 54 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 55 | am__vpath_adj = case $$p in \ 56 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 57 | *) f=$$p;; \ 58 | esac; 59 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 60 | am__install_max = 40 61 | am__nobase_strip_setup = \ 62 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 63 | am__nobase_strip = \ 64 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 65 | am__nobase_list = $(am__nobase_strip_setup); \ 66 | for p in $$list; do echo "$$p $$p"; done | \ 67 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 68 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 69 | if (++n[$$2] == $(am__install_max)) \ 70 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 71 | END { for (dir in files) print dir, files[dir] }' 72 | am__base_list = \ 73 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 74 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 75 | am__uninstall_files_from_dir = { \ 76 | test -z "$$files" \ 77 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 78 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 79 | $(am__cd) "$$dir" && rm -f $$files; }; \ 80 | } 81 | am__installdirs = "$(DESTDIR)$(libjitincludedir)" \ 82 | "$(DESTDIR)$(libjitincludedir)" 83 | HEADERS = $(dist_libjitinclude_HEADERS) \ 84 | $(nodist_libjitinclude_HEADERS) $(noinst_HEADERS) 85 | ETAGS = etags 86 | CTAGS = ctags 87 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 88 | ACLOCAL = @ACLOCAL@ 89 | ALLOCA = @ALLOCA@ 90 | AMTAR = @AMTAR@ 91 | AR = @AR@ 92 | AS = @AS@ 93 | AUTOCONF = @AUTOCONF@ 94 | AUTOHEADER = @AUTOHEADER@ 95 | AUTOMAKE = @AUTOMAKE@ 96 | AWK = @AWK@ 97 | CC = @CC@ 98 | CCDEPMODE = @CCDEPMODE@ 99 | CFLAGS = @CFLAGS@ 100 | CPP = @CPP@ 101 | CPPFLAGS = @CPPFLAGS@ 102 | CXX = @CXX@ 103 | CXXCPP = @CXXCPP@ 104 | CXXDEPMODE = @CXXDEPMODE@ 105 | CXXFLAGS = @CXXFLAGS@ 106 | CYGPATH_W = @CYGPATH_W@ 107 | DEFS = @DEFS@ 108 | DEPDIR = @DEPDIR@ 109 | DLLTOOL = @DLLTOOL@ 110 | DSYMUTIL = @DSYMUTIL@ 111 | DUMPBIN = @DUMPBIN@ 112 | ECHO_C = @ECHO_C@ 113 | ECHO_N = @ECHO_N@ 114 | ECHO_T = @ECHO_T@ 115 | EGREP = @EGREP@ 116 | EXEEXT = @EXEEXT@ 117 | FGREP = @FGREP@ 118 | GREP = @GREP@ 119 | INSTALL = @INSTALL@ 120 | INSTALL_DATA = @INSTALL_DATA@ 121 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 122 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 123 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 124 | JITFLOAT32 = @JITFLOAT32@ 125 | JITFLOAT64 = @JITFLOAT64@ 126 | JITINT16 = @JITINT16@ 127 | JITINT32 = @JITINT32@ 128 | JITINT64 = @JITINT64@ 129 | JITINT64CXX = @JITINT64CXX@ 130 | JITINT8 = @JITINT8@ 131 | JITNATIVEFLOAT = @JITNATIVEFLOAT@ 132 | JITNATIVEINT = @JITNATIVEINT@ 133 | JITNATIVEINTDEFINE = @JITNATIVEINTDEFINE@ 134 | JITNFLOATISDOUBLE = @JITNFLOATISDOUBLE@ 135 | JITTHROWIDIOM = @JITTHROWIDIOM@ 136 | JITUINT8 = @JITUINT8@ 137 | JIT_ARCH = @JIT_ARCH@ 138 | JIT_INT64_INCLUDE = @JIT_INT64_INCLUDE@ 139 | LD = @LD@ 140 | LDFLAGS = @LDFLAGS@ 141 | LEX = @LEX@ 142 | LEXLIB = @LEXLIB@ 143 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 144 | LIBJIT_VERSION = @LIBJIT_VERSION@ 145 | LIBOBJS = @LIBOBJS@ 146 | LIBS = @LIBS@ 147 | LIBTOOL = @LIBTOOL@ 148 | LIB_STDCPP = @LIB_STDCPP@ 149 | LIPO = @LIPO@ 150 | LN_S = @LN_S@ 151 | LTLIBOBJS = @LTLIBOBJS@ 152 | MAKEINFO = @MAKEINFO@ 153 | MANIFEST_TOOL = @MANIFEST_TOOL@ 154 | MKDIR_P = @MKDIR_P@ 155 | NM = @NM@ 156 | NMEDIT = @NMEDIT@ 157 | OBJDUMP = @OBJDUMP@ 158 | OBJEXT = @OBJEXT@ 159 | OTOOL = @OTOOL@ 160 | OTOOL64 = @OTOOL64@ 161 | PACKAGE = @PACKAGE@ 162 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 163 | PACKAGE_NAME = @PACKAGE_NAME@ 164 | PACKAGE_STRING = @PACKAGE_STRING@ 165 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 166 | PACKAGE_URL = @PACKAGE_URL@ 167 | PACKAGE_VERSION = @PACKAGE_VERSION@ 168 | PATH_SEPARATOR = @PATH_SEPARATOR@ 169 | RANLIB = @RANLIB@ 170 | SED = @SED@ 171 | SET_MAKE = @SET_MAKE@ 172 | SHELL = @SHELL@ 173 | STRIP = @STRIP@ 174 | VERSION = @VERSION@ 175 | YACC = @YACC@ 176 | YFLAGS = @YFLAGS@ 177 | abs_builddir = @abs_builddir@ 178 | abs_srcdir = @abs_srcdir@ 179 | abs_top_builddir = @abs_top_builddir@ 180 | abs_top_srcdir = @abs_top_srcdir@ 181 | ac_ct_AR = @ac_ct_AR@ 182 | ac_ct_CC = @ac_ct_CC@ 183 | ac_ct_CXX = @ac_ct_CXX@ 184 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 185 | am__include = @am__include@ 186 | am__leading_dot = @am__leading_dot@ 187 | am__quote = @am__quote@ 188 | am__tar = @am__tar@ 189 | am__untar = @am__untar@ 190 | bindir = @bindir@ 191 | build = @build@ 192 | build_alias = @build_alias@ 193 | build_cpu = @build_cpu@ 194 | build_os = @build_os@ 195 | build_vendor = @build_vendor@ 196 | builddir = @builddir@ 197 | datadir = @datadir@ 198 | datarootdir = @datarootdir@ 199 | docdir = @docdir@ 200 | dvidir = @dvidir@ 201 | exec_prefix = @exec_prefix@ 202 | host = @host@ 203 | host_alias = @host_alias@ 204 | host_cpu = @host_cpu@ 205 | host_os = @host_os@ 206 | host_vendor = @host_vendor@ 207 | htmldir = @htmldir@ 208 | includedir = @includedir@ 209 | infodir = @infodir@ 210 | install_sh = @install_sh@ 211 | libdir = @libdir@ 212 | libexecdir = @libexecdir@ 213 | localedir = @localedir@ 214 | localstatedir = @localstatedir@ 215 | mandir = @mandir@ 216 | mkdir_p = @mkdir_p@ 217 | oldincludedir = @oldincludedir@ 218 | pdfdir = @pdfdir@ 219 | prefix = @prefix@ 220 | program_transform_name = @program_transform_name@ 221 | psdir = @psdir@ 222 | sbindir = @sbindir@ 223 | sharedstatedir = @sharedstatedir@ 224 | srcdir = @srcdir@ 225 | sysconfdir = @sysconfdir@ 226 | target_alias = @target_alias@ 227 | top_build_prefix = @top_build_prefix@ 228 | top_builddir = @top_builddir@ 229 | top_srcdir = @top_srcdir@ 230 | ARCH_HEADER = jit-arch-@JIT_ARCH@.h 231 | BUILT_SOURCES = jit-arch.h jit-opcode.h 232 | libjitincludedir = $(includedir)/jit 233 | dist_libjitinclude_HEADERS = \ 234 | jit.h \ 235 | jit-apply.h \ 236 | jit-block.h \ 237 | jit-common.h \ 238 | jit-context.h \ 239 | jit-debugger.h \ 240 | jit-defs.h \ 241 | jit-dump.h \ 242 | jit-dynamic.h \ 243 | jit-elf.h \ 244 | jit-except.h \ 245 | jit-function.h \ 246 | jit-init.h \ 247 | jit-insn.h \ 248 | jit-intrinsic.h \ 249 | jit-memory.h \ 250 | jit-meta.h \ 251 | jit-objmodel.h \ 252 | jit-objmodel-private.h \ 253 | jit-opcode-compat.h \ 254 | jit-opcode.h \ 255 | jit-plus.h \ 256 | jit-type.h \ 257 | jit-unwind.h \ 258 | jit-util.h \ 259 | jit-value.h \ 260 | jit-vmem.h \ 261 | jit-walk.h 262 | 263 | nodist_libjitinclude_HEADERS = \ 264 | jit-arch.h 265 | 266 | noinst_HEADERS = jit-arch-generic.h jit-arch-x86.h jit-arch-x86-64.h 267 | DISTCLEANFILES = jit-arch.h jit-defs.h jit-opcode.h 268 | all: $(BUILT_SOURCES) 269 | $(MAKE) $(AM_MAKEFLAGS) all-am 270 | 271 | .SUFFIXES: 272 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 273 | @for dep in $?; do \ 274 | case '$(am__configure_deps)' in \ 275 | *$$dep*) \ 276 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 277 | && { if test -f $@; then exit 0; else break; fi; }; \ 278 | exit 1;; \ 279 | esac; \ 280 | done; \ 281 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/jit/Makefile'; \ 282 | $(am__cd) $(top_srcdir) && \ 283 | $(AUTOMAKE) --gnu include/jit/Makefile 284 | .PRECIOUS: Makefile 285 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 286 | @case '$?' in \ 287 | *config.status*) \ 288 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 289 | *) \ 290 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 291 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 292 | esac; 293 | 294 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 295 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 296 | 297 | $(top_srcdir)/configure: $(am__configure_deps) 298 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 299 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 300 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 301 | $(am__aclocal_m4_deps): 302 | jit-defs.h: $(top_builddir)/config.status $(srcdir)/jit-defs.h.in 303 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 304 | 305 | mostlyclean-libtool: 306 | -rm -f *.lo 307 | 308 | clean-libtool: 309 | -rm -rf .libs _libs 310 | install-dist_libjitincludeHEADERS: $(dist_libjitinclude_HEADERS) 311 | @$(NORMAL_INSTALL) 312 | test -z "$(libjitincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libjitincludedir)" 313 | @list='$(dist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 314 | for p in $$list; do \ 315 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 316 | echo "$$d$$p"; \ 317 | done | $(am__base_list) | \ 318 | while read files; do \ 319 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libjitincludedir)'"; \ 320 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(libjitincludedir)" || exit $$?; \ 321 | done 322 | 323 | uninstall-dist_libjitincludeHEADERS: 324 | @$(NORMAL_UNINSTALL) 325 | @list='$(dist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 326 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 327 | dir='$(DESTDIR)$(libjitincludedir)'; $(am__uninstall_files_from_dir) 328 | install-nodist_libjitincludeHEADERS: $(nodist_libjitinclude_HEADERS) 329 | @$(NORMAL_INSTALL) 330 | test -z "$(libjitincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libjitincludedir)" 331 | @list='$(nodist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 332 | for p in $$list; do \ 333 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 334 | echo "$$d$$p"; \ 335 | done | $(am__base_list) | \ 336 | while read files; do \ 337 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libjitincludedir)'"; \ 338 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(libjitincludedir)" || exit $$?; \ 339 | done 340 | 341 | uninstall-nodist_libjitincludeHEADERS: 342 | @$(NORMAL_UNINSTALL) 343 | @list='$(nodist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 344 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 345 | dir='$(DESTDIR)$(libjitincludedir)'; $(am__uninstall_files_from_dir) 346 | 347 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 348 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 349 | unique=`for i in $$list; do \ 350 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 351 | done | \ 352 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 353 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 354 | mkid -fID $$unique 355 | tags: TAGS 356 | 357 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 358 | $(TAGS_FILES) $(LISP) 359 | set x; \ 360 | here=`pwd`; \ 361 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 362 | unique=`for i in $$list; do \ 363 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 364 | done | \ 365 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 366 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 367 | shift; \ 368 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 369 | test -n "$$unique" || unique=$$empty_fix; \ 370 | if test $$# -gt 0; then \ 371 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 372 | "$$@" $$unique; \ 373 | else \ 374 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 375 | $$unique; \ 376 | fi; \ 377 | fi 378 | ctags: CTAGS 379 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 380 | $(TAGS_FILES) $(LISP) 381 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 382 | unique=`for i in $$list; do \ 383 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 384 | done | \ 385 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 386 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 387 | test -z "$(CTAGS_ARGS)$$unique" \ 388 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 389 | $$unique 390 | 391 | GTAGS: 392 | here=`$(am__cd) $(top_builddir) && pwd` \ 393 | && $(am__cd) $(top_srcdir) \ 394 | && gtags -i $(GTAGS_ARGS) "$$here" 395 | 396 | distclean-tags: 397 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 398 | 399 | distdir: $(DISTFILES) 400 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 401 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 402 | list='$(DISTFILES)'; \ 403 | dist_files=`for file in $$list; do echo $$file; done | \ 404 | sed -e "s|^$$srcdirstrip/||;t" \ 405 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 406 | case $$dist_files in \ 407 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 408 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 409 | sort -u` ;; \ 410 | esac; \ 411 | for file in $$dist_files; do \ 412 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 413 | if test -d $$d/$$file; then \ 414 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 415 | if test -d "$(distdir)/$$file"; then \ 416 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 417 | fi; \ 418 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 419 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 420 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 421 | fi; \ 422 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 423 | else \ 424 | test -f "$(distdir)/$$file" \ 425 | || cp -p $$d/$$file "$(distdir)/$$file" \ 426 | || exit 1; \ 427 | fi; \ 428 | done 429 | check-am: all-am 430 | check: $(BUILT_SOURCES) 431 | $(MAKE) $(AM_MAKEFLAGS) check-am 432 | all-am: Makefile $(HEADERS) 433 | installdirs: 434 | for dir in "$(DESTDIR)$(libjitincludedir)" "$(DESTDIR)$(libjitincludedir)"; do \ 435 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 436 | done 437 | install: $(BUILT_SOURCES) 438 | $(MAKE) $(AM_MAKEFLAGS) install-am 439 | install-exec: install-exec-am 440 | install-data: install-data-am 441 | uninstall: uninstall-am 442 | 443 | install-am: all-am 444 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 445 | 446 | installcheck: installcheck-am 447 | install-strip: 448 | if test -z '$(STRIP)'; then \ 449 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 450 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 451 | install; \ 452 | else \ 453 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 454 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 455 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 456 | fi 457 | mostlyclean-generic: 458 | 459 | clean-generic: 460 | 461 | distclean-generic: 462 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 463 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 464 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 465 | 466 | maintainer-clean-generic: 467 | @echo "This command is intended for maintainers to use" 468 | @echo "it deletes files that may require special tools to rebuild." 469 | -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) 470 | clean: clean-am 471 | 472 | clean-am: clean-generic clean-libtool mostlyclean-am 473 | 474 | distclean: distclean-am 475 | -rm -f Makefile 476 | distclean-am: clean-am distclean-generic distclean-tags 477 | 478 | dvi: dvi-am 479 | 480 | dvi-am: 481 | 482 | html: html-am 483 | 484 | html-am: 485 | 486 | info: info-am 487 | 488 | info-am: 489 | 490 | install-data-am: install-dist_libjitincludeHEADERS \ 491 | install-nodist_libjitincludeHEADERS 492 | 493 | install-dvi: install-dvi-am 494 | 495 | install-dvi-am: 496 | 497 | install-exec-am: 498 | 499 | install-html: install-html-am 500 | 501 | install-html-am: 502 | 503 | install-info: install-info-am 504 | 505 | install-info-am: 506 | 507 | install-man: 508 | 509 | install-pdf: install-pdf-am 510 | 511 | install-pdf-am: 512 | 513 | install-ps: install-ps-am 514 | 515 | install-ps-am: 516 | 517 | installcheck-am: 518 | 519 | maintainer-clean: maintainer-clean-am 520 | -rm -f Makefile 521 | maintainer-clean-am: distclean-am maintainer-clean-generic 522 | 523 | mostlyclean: mostlyclean-am 524 | 525 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 526 | 527 | pdf: pdf-am 528 | 529 | pdf-am: 530 | 531 | ps: ps-am 532 | 533 | ps-am: 534 | 535 | uninstall-am: uninstall-dist_libjitincludeHEADERS \ 536 | uninstall-nodist_libjitincludeHEADERS 537 | 538 | .MAKE: all check install install-am install-strip 539 | 540 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ 541 | clean-libtool ctags distclean distclean-generic \ 542 | distclean-libtool distclean-tags distdir dvi dvi-am html \ 543 | html-am info info-am install install-am install-data \ 544 | install-data-am install-dist_libjitincludeHEADERS install-dvi \ 545 | install-dvi-am install-exec install-exec-am install-html \ 546 | install-html-am install-info install-info-am install-man \ 547 | install-nodist_libjitincludeHEADERS install-pdf install-pdf-am \ 548 | install-ps install-ps-am install-strip installcheck \ 549 | installcheck-am installdirs maintainer-clean \ 550 | maintainer-clean-generic mostlyclean mostlyclean-generic \ 551 | mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ 552 | uninstall-am uninstall-dist_libjitincludeHEADERS \ 553 | uninstall-nodist_libjitincludeHEADERS 554 | 555 | 556 | jit-arch.h: $(ARCH_HEADER) 557 | rm -f $@ 558 | $(LN_S) $(srcdir)/$(ARCH_HEADER) $@ 559 | 560 | jit-opcode.h: $(top_srcdir)/jit/jit-opcodes.ops 561 | $(top_builddir)/tools/gen-ops -H $(top_srcdir)/jit/jit-opcodes.ops >jit-opcode.h 562 | 563 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 564 | # Otherwise a system limit (for SysV at least) may be exceeded. 565 | .NOEXPORT: 566 | -------------------------------------------------------------------------------- /libjit/include/jit/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.3 from Makefile.am. 2 | # include/jit/Makefile. Generated from Makefile.in by configure. 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | 17 | 18 | 19 | pkgdatadir = $(datadir)/libjit 20 | pkgincludedir = $(includedir)/libjit 21 | pkglibdir = $(libdir)/libjit 22 | pkglibexecdir = $(libexecdir)/libjit 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | install_sh_DATA = $(install_sh) -c -m 644 25 | install_sh_PROGRAM = $(install_sh) -c 26 | install_sh_SCRIPT = $(install_sh) -c 27 | INSTALL_HEADER = $(INSTALL_DATA) 28 | transform = $(program_transform_name) 29 | NORMAL_INSTALL = : 30 | PRE_INSTALL = : 31 | POST_INSTALL = : 32 | NORMAL_UNINSTALL = : 33 | PRE_UNINSTALL = : 34 | POST_UNINSTALL = : 35 | build_triplet = i686-pc-linux-gnu 36 | host_triplet = i686-pc-linux-gnu 37 | subdir = include/jit 38 | DIST_COMMON = $(dist_libjitinclude_HEADERS) $(noinst_HEADERS) \ 39 | $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 40 | $(srcdir)/jit-defs.h.in 41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 42 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 43 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 44 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 45 | $(top_srcdir)/configure.ac 46 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 47 | $(ACLOCAL_M4) 48 | mkinstalldirs = $(install_sh) -d 49 | CONFIG_HEADER = $(top_builddir)/config.h 50 | CONFIG_CLEAN_FILES = jit-defs.h 51 | CONFIG_CLEAN_VPATH_FILES = 52 | SOURCES = 53 | DIST_SOURCES = 54 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 55 | am__vpath_adj = case $$p in \ 56 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 57 | *) f=$$p;; \ 58 | esac; 59 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 60 | am__install_max = 40 61 | am__nobase_strip_setup = \ 62 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 63 | am__nobase_strip = \ 64 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 65 | am__nobase_list = $(am__nobase_strip_setup); \ 66 | for p in $$list; do echo "$$p $$p"; done | \ 67 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 68 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 69 | if (++n[$$2] == $(am__install_max)) \ 70 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 71 | END { for (dir in files) print dir, files[dir] }' 72 | am__base_list = \ 73 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 74 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 75 | am__uninstall_files_from_dir = { \ 76 | test -z "$$files" \ 77 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 78 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 79 | $(am__cd) "$$dir" && rm -f $$files; }; \ 80 | } 81 | am__installdirs = "$(DESTDIR)$(libjitincludedir)" \ 82 | "$(DESTDIR)$(libjitincludedir)" 83 | HEADERS = $(dist_libjitinclude_HEADERS) \ 84 | $(nodist_libjitinclude_HEADERS) $(noinst_HEADERS) 85 | ETAGS = etags 86 | CTAGS = ctags 87 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 88 | ACLOCAL = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run aclocal-1.11 89 | ALLOCA = 90 | AMTAR = $${TAR-tar} 91 | AR = ar 92 | AS = as 93 | AUTOCONF = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run autoconf 94 | AUTOHEADER = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run autoheader 95 | AUTOMAKE = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run automake-1.11 96 | AWK = mawk 97 | CC = gcc 98 | CCDEPMODE = depmode=gcc3 99 | CFLAGS = -fno-gcse -g -O2 -Wall -fno-omit-frame-pointer 100 | CPP = gcc -E 101 | CPPFLAGS = 102 | CXX = g++ 103 | CXXCPP = g++ -E 104 | CXXDEPMODE = depmode=gcc3 105 | CXXFLAGS = -g -O2 -Wall -fno-omit-frame-pointer 106 | CYGPATH_W = echo 107 | DEFS = -DHAVE_CONFIG_H 108 | DEPDIR = .deps 109 | DLLTOOL = dlltool 110 | DSYMUTIL = 111 | DUMPBIN = 112 | ECHO_C = 113 | ECHO_N = -n 114 | ECHO_T = 115 | EGREP = /bin/grep -E 116 | EXEEXT = 117 | FGREP = /bin/grep -F 118 | GREP = /bin/grep 119 | INSTALL = /usr/bin/install -c 120 | INSTALL_DATA = ${INSTALL} -m 644 121 | INSTALL_PROGRAM = ${INSTALL} 122 | INSTALL_SCRIPT = ${INSTALL} 123 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s 124 | JITFLOAT32 = float 125 | JITFLOAT64 = double 126 | JITINT16 = short 127 | JITINT32 = int 128 | JITINT64 = long long 129 | JITINT64CXX = long long 130 | JITINT8 = char 131 | JITNATIVEFLOAT = long double 132 | JITNATIVEINT = int 133 | JITNATIVEINTDEFINE = JIT_NATIVE_INT32 134 | JITNFLOATISDOUBLE = 135 | JITTHROWIDIOM = throw() 136 | JITUINT8 = unsigned char 137 | JIT_ARCH = x86 138 | JIT_INT64_INCLUDE = 139 | LD = /usr/bin/ld 140 | LDFLAGS = 141 | LEX = flex 142 | LEXLIB = -lfl 143 | LEX_OUTPUT_ROOT = lex.yy 144 | LIBJIT_VERSION = 0:1:0 145 | LIBOBJS = 146 | LIBS = -lpthread -ldl -lm 147 | LIBTOOL = $(SHELL) $(top_builddir)/libtool 148 | LIB_STDCPP = -lstdc++ 149 | LIPO = 150 | LN_S = ln -s 151 | LTLIBOBJS = 152 | MAKEINFO = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run makeinfo 153 | MANIFEST_TOOL = : 154 | MKDIR_P = /bin/mkdir -p 155 | NM = /usr/bin/nm -B 156 | NMEDIT = 157 | OBJDUMP = objdump 158 | OBJEXT = o 159 | OTOOL = 160 | OTOOL64 = 161 | PACKAGE = libjit 162 | PACKAGE_BUGREPORT = libjit@gnu.org 163 | PACKAGE_NAME = libjit 164 | PACKAGE_STRING = libjit 0.1.3 165 | PACKAGE_TARNAME = libjit 166 | PACKAGE_URL = 167 | PACKAGE_VERSION = 0.1.3 168 | PATH_SEPARATOR = : 169 | RANLIB = ranlib 170 | SED = /bin/sed 171 | SET_MAKE = 172 | SHELL = /bin/sh 173 | STRIP = strip 174 | VERSION = 0.1.3 175 | YACC = bison -y 176 | YFLAGS = 177 | abs_builddir = /home/sankha/projects/libjit/include/jit 178 | abs_srcdir = /home/sankha/projects/libjit/include/jit 179 | abs_top_builddir = /home/sankha/projects/libjit 180 | abs_top_srcdir = /home/sankha/projects/libjit 181 | ac_ct_AR = ar 182 | ac_ct_CC = gcc 183 | ac_ct_CXX = g++ 184 | ac_ct_DUMPBIN = 185 | am__include = include 186 | am__leading_dot = . 187 | am__quote = 188 | am__tar = $${TAR-tar} chof - "$$tardir" 189 | am__untar = $${TAR-tar} xf - 190 | bindir = ${exec_prefix}/bin 191 | build = i686-pc-linux-gnu 192 | build_alias = 193 | build_cpu = i686 194 | build_os = linux-gnu 195 | build_vendor = pc 196 | builddir = . 197 | datadir = ${datarootdir} 198 | datarootdir = ${prefix}/share 199 | docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} 200 | dvidir = ${docdir} 201 | exec_prefix = ${prefix} 202 | host = i686-pc-linux-gnu 203 | host_alias = 204 | host_cpu = i686 205 | host_os = linux-gnu 206 | host_vendor = pc 207 | htmldir = ${docdir} 208 | includedir = ${prefix}/include 209 | infodir = ${datarootdir}/info 210 | install_sh = ${SHELL} /home/sankha/projects/libjit/build-aux/install-sh 211 | libdir = ${exec_prefix}/lib/../lib 212 | libexecdir = ${exec_prefix}/libexec 213 | localedir = ${datarootdir}/locale 214 | localstatedir = ${prefix}/var 215 | mandir = ${datarootdir}/man 216 | mkdir_p = /bin/mkdir -p 217 | oldincludedir = /usr/include 218 | pdfdir = ${docdir} 219 | prefix = /usr/local 220 | program_transform_name = s,x,x, 221 | psdir = ${docdir} 222 | sbindir = ${exec_prefix}/sbin 223 | sharedstatedir = ${prefix}/com 224 | srcdir = . 225 | sysconfdir = ${prefix}/etc 226 | target_alias = 227 | top_build_prefix = ../../ 228 | top_builddir = ../.. 229 | top_srcdir = ../.. 230 | ARCH_HEADER = jit-arch-x86.h 231 | BUILT_SOURCES = jit-arch.h jit-opcode.h 232 | libjitincludedir = $(includedir)/jit 233 | dist_libjitinclude_HEADERS = \ 234 | jit.h \ 235 | jit-apply.h \ 236 | jit-block.h \ 237 | jit-common.h \ 238 | jit-context.h \ 239 | jit-debugger.h \ 240 | jit-defs.h \ 241 | jit-dump.h \ 242 | jit-dynamic.h \ 243 | jit-elf.h \ 244 | jit-except.h \ 245 | jit-function.h \ 246 | jit-init.h \ 247 | jit-insn.h \ 248 | jit-intrinsic.h \ 249 | jit-memory.h \ 250 | jit-meta.h \ 251 | jit-objmodel.h \ 252 | jit-objmodel-private.h \ 253 | jit-opcode-compat.h \ 254 | jit-opcode.h \ 255 | jit-plus.h \ 256 | jit-type.h \ 257 | jit-unwind.h \ 258 | jit-util.h \ 259 | jit-value.h \ 260 | jit-vmem.h \ 261 | jit-walk.h 262 | 263 | nodist_libjitinclude_HEADERS = \ 264 | jit-arch.h 265 | 266 | noinst_HEADERS = jit-arch-generic.h jit-arch-x86.h jit-arch-x86-64.h 267 | DISTCLEANFILES = jit-arch.h jit-defs.h jit-opcode.h 268 | all: $(BUILT_SOURCES) 269 | $(MAKE) $(AM_MAKEFLAGS) all-am 270 | 271 | .SUFFIXES: 272 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 273 | @for dep in $?; do \ 274 | case '$(am__configure_deps)' in \ 275 | *$$dep*) \ 276 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 277 | && { if test -f $@; then exit 0; else break; fi; }; \ 278 | exit 1;; \ 279 | esac; \ 280 | done; \ 281 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/jit/Makefile'; \ 282 | $(am__cd) $(top_srcdir) && \ 283 | $(AUTOMAKE) --gnu include/jit/Makefile 284 | .PRECIOUS: Makefile 285 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 286 | @case '$?' in \ 287 | *config.status*) \ 288 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 289 | *) \ 290 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 291 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 292 | esac; 293 | 294 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 295 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 296 | 297 | $(top_srcdir)/configure: $(am__configure_deps) 298 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 299 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 300 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 301 | $(am__aclocal_m4_deps): 302 | jit-defs.h: $(top_builddir)/config.status $(srcdir)/jit-defs.h.in 303 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 304 | 305 | mostlyclean-libtool: 306 | -rm -f *.lo 307 | 308 | clean-libtool: 309 | -rm -rf .libs _libs 310 | install-dist_libjitincludeHEADERS: $(dist_libjitinclude_HEADERS) 311 | @$(NORMAL_INSTALL) 312 | test -z "$(libjitincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libjitincludedir)" 313 | @list='$(dist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 314 | for p in $$list; do \ 315 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 316 | echo "$$d$$p"; \ 317 | done | $(am__base_list) | \ 318 | while read files; do \ 319 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libjitincludedir)'"; \ 320 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(libjitincludedir)" || exit $$?; \ 321 | done 322 | 323 | uninstall-dist_libjitincludeHEADERS: 324 | @$(NORMAL_UNINSTALL) 325 | @list='$(dist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 326 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 327 | dir='$(DESTDIR)$(libjitincludedir)'; $(am__uninstall_files_from_dir) 328 | install-nodist_libjitincludeHEADERS: $(nodist_libjitinclude_HEADERS) 329 | @$(NORMAL_INSTALL) 330 | test -z "$(libjitincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libjitincludedir)" 331 | @list='$(nodist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 332 | for p in $$list; do \ 333 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 334 | echo "$$d$$p"; \ 335 | done | $(am__base_list) | \ 336 | while read files; do \ 337 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libjitincludedir)'"; \ 338 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(libjitincludedir)" || exit $$?; \ 339 | done 340 | 341 | uninstall-nodist_libjitincludeHEADERS: 342 | @$(NORMAL_UNINSTALL) 343 | @list='$(nodist_libjitinclude_HEADERS)'; test -n "$(libjitincludedir)" || list=; \ 344 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 345 | dir='$(DESTDIR)$(libjitincludedir)'; $(am__uninstall_files_from_dir) 346 | 347 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 348 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 349 | unique=`for i in $$list; do \ 350 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 351 | done | \ 352 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 353 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 354 | mkid -fID $$unique 355 | tags: TAGS 356 | 357 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 358 | $(TAGS_FILES) $(LISP) 359 | set x; \ 360 | here=`pwd`; \ 361 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 362 | unique=`for i in $$list; do \ 363 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 364 | done | \ 365 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 366 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 367 | shift; \ 368 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 369 | test -n "$$unique" || unique=$$empty_fix; \ 370 | if test $$# -gt 0; then \ 371 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 372 | "$$@" $$unique; \ 373 | else \ 374 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 375 | $$unique; \ 376 | fi; \ 377 | fi 378 | ctags: CTAGS 379 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 380 | $(TAGS_FILES) $(LISP) 381 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 382 | unique=`for i in $$list; do \ 383 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 384 | done | \ 385 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 386 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 387 | test -z "$(CTAGS_ARGS)$$unique" \ 388 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 389 | $$unique 390 | 391 | GTAGS: 392 | here=`$(am__cd) $(top_builddir) && pwd` \ 393 | && $(am__cd) $(top_srcdir) \ 394 | && gtags -i $(GTAGS_ARGS) "$$here" 395 | 396 | distclean-tags: 397 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 398 | 399 | distdir: $(DISTFILES) 400 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 401 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 402 | list='$(DISTFILES)'; \ 403 | dist_files=`for file in $$list; do echo $$file; done | \ 404 | sed -e "s|^$$srcdirstrip/||;t" \ 405 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 406 | case $$dist_files in \ 407 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 408 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 409 | sort -u` ;; \ 410 | esac; \ 411 | for file in $$dist_files; do \ 412 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 413 | if test -d $$d/$$file; then \ 414 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 415 | if test -d "$(distdir)/$$file"; then \ 416 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 417 | fi; \ 418 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 419 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 420 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 421 | fi; \ 422 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 423 | else \ 424 | test -f "$(distdir)/$$file" \ 425 | || cp -p $$d/$$file "$(distdir)/$$file" \ 426 | || exit 1; \ 427 | fi; \ 428 | done 429 | check-am: all-am 430 | check: $(BUILT_SOURCES) 431 | $(MAKE) $(AM_MAKEFLAGS) check-am 432 | all-am: Makefile $(HEADERS) 433 | installdirs: 434 | for dir in "$(DESTDIR)$(libjitincludedir)" "$(DESTDIR)$(libjitincludedir)"; do \ 435 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 436 | done 437 | install: $(BUILT_SOURCES) 438 | $(MAKE) $(AM_MAKEFLAGS) install-am 439 | install-exec: install-exec-am 440 | install-data: install-data-am 441 | uninstall: uninstall-am 442 | 443 | install-am: all-am 444 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 445 | 446 | installcheck: installcheck-am 447 | install-strip: 448 | if test -z '$(STRIP)'; then \ 449 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 450 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 451 | install; \ 452 | else \ 453 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 454 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 455 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 456 | fi 457 | mostlyclean-generic: 458 | 459 | clean-generic: 460 | 461 | distclean-generic: 462 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 463 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 464 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 465 | 466 | maintainer-clean-generic: 467 | @echo "This command is intended for maintainers to use" 468 | @echo "it deletes files that may require special tools to rebuild." 469 | -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) 470 | clean: clean-am 471 | 472 | clean-am: clean-generic clean-libtool mostlyclean-am 473 | 474 | distclean: distclean-am 475 | -rm -f Makefile 476 | distclean-am: clean-am distclean-generic distclean-tags 477 | 478 | dvi: dvi-am 479 | 480 | dvi-am: 481 | 482 | html: html-am 483 | 484 | html-am: 485 | 486 | info: info-am 487 | 488 | info-am: 489 | 490 | install-data-am: install-dist_libjitincludeHEADERS \ 491 | install-nodist_libjitincludeHEADERS 492 | 493 | install-dvi: install-dvi-am 494 | 495 | install-dvi-am: 496 | 497 | install-exec-am: 498 | 499 | install-html: install-html-am 500 | 501 | install-html-am: 502 | 503 | install-info: install-info-am 504 | 505 | install-info-am: 506 | 507 | install-man: 508 | 509 | install-pdf: install-pdf-am 510 | 511 | install-pdf-am: 512 | 513 | install-ps: install-ps-am 514 | 515 | install-ps-am: 516 | 517 | installcheck-am: 518 | 519 | maintainer-clean: maintainer-clean-am 520 | -rm -f Makefile 521 | maintainer-clean-am: distclean-am maintainer-clean-generic 522 | 523 | mostlyclean: mostlyclean-am 524 | 525 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 526 | 527 | pdf: pdf-am 528 | 529 | pdf-am: 530 | 531 | ps: ps-am 532 | 533 | ps-am: 534 | 535 | uninstall-am: uninstall-dist_libjitincludeHEADERS \ 536 | uninstall-nodist_libjitincludeHEADERS 537 | 538 | .MAKE: all check install install-am install-strip 539 | 540 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ 541 | clean-libtool ctags distclean distclean-generic \ 542 | distclean-libtool distclean-tags distdir dvi dvi-am html \ 543 | html-am info info-am install install-am install-data \ 544 | install-data-am install-dist_libjitincludeHEADERS install-dvi \ 545 | install-dvi-am install-exec install-exec-am install-html \ 546 | install-html-am install-info install-info-am install-man \ 547 | install-nodist_libjitincludeHEADERS install-pdf install-pdf-am \ 548 | install-ps install-ps-am install-strip installcheck \ 549 | installcheck-am installdirs maintainer-clean \ 550 | maintainer-clean-generic mostlyclean mostlyclean-generic \ 551 | mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ 552 | uninstall-am uninstall-dist_libjitincludeHEADERS \ 553 | uninstall-nodist_libjitincludeHEADERS 554 | 555 | 556 | jit-arch.h: $(ARCH_HEADER) 557 | rm -f $@ 558 | $(LN_S) $(srcdir)/$(ARCH_HEADER) $@ 559 | 560 | jit-opcode.h: $(top_srcdir)/jit/jit-opcodes.ops 561 | $(top_builddir)/tools/gen-ops -H $(top_srcdir)/jit/jit-opcodes.ops >jit-opcode.h 562 | 563 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 564 | # Otherwise a system limit (for SysV at least) may be exceeded. 565 | .NOEXPORT: 566 | -------------------------------------------------------------------------------- /libjit/include/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.3 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | VPATH = @srcdir@ 18 | pkgdatadir = $(datadir)/@PACKAGE@ 19 | pkgincludedir = $(includedir)/@PACKAGE@ 20 | pkglibdir = $(libdir)/@PACKAGE@ 21 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 22 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 23 | install_sh_DATA = $(install_sh) -c -m 644 24 | install_sh_PROGRAM = $(install_sh) -c 25 | install_sh_SCRIPT = $(install_sh) -c 26 | INSTALL_HEADER = $(INSTALL_DATA) 27 | transform = $(program_transform_name) 28 | NORMAL_INSTALL = : 29 | PRE_INSTALL = : 30 | POST_INSTALL = : 31 | NORMAL_UNINSTALL = : 32 | PRE_UNINSTALL = : 33 | POST_UNINSTALL = : 34 | build_triplet = @build@ 35 | host_triplet = @host@ 36 | subdir = include 37 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 38 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 39 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 40 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 41 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 42 | $(top_srcdir)/configure.ac 43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 44 | $(ACLOCAL_M4) 45 | mkinstalldirs = $(install_sh) -d 46 | CONFIG_HEADER = $(top_builddir)/config.h 47 | CONFIG_CLEAN_FILES = 48 | CONFIG_CLEAN_VPATH_FILES = 49 | SOURCES = 50 | DIST_SOURCES = 51 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 52 | html-recursive info-recursive install-data-recursive \ 53 | install-dvi-recursive install-exec-recursive \ 54 | install-html-recursive install-info-recursive \ 55 | install-pdf-recursive install-ps-recursive install-recursive \ 56 | installcheck-recursive installdirs-recursive pdf-recursive \ 57 | ps-recursive uninstall-recursive 58 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 59 | distclean-recursive maintainer-clean-recursive 60 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ 61 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ 62 | distdir 63 | ETAGS = etags 64 | CTAGS = ctags 65 | DIST_SUBDIRS = $(SUBDIRS) 66 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 67 | am__relativize = \ 68 | dir0=`pwd`; \ 69 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 70 | sed_rest='s,^[^/]*/*,,'; \ 71 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 72 | sed_butlast='s,/*[^/]*$$,,'; \ 73 | while test -n "$$dir1"; do \ 74 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 75 | if test "$$first" != "."; then \ 76 | if test "$$first" = ".."; then \ 77 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 78 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 79 | else \ 80 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 81 | if test "$$first2" = "$$first"; then \ 82 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 83 | else \ 84 | dir2="../$$dir2"; \ 85 | fi; \ 86 | dir0="$$dir0"/"$$first"; \ 87 | fi; \ 88 | fi; \ 89 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 90 | done; \ 91 | reldir="$$dir2" 92 | ACLOCAL = @ACLOCAL@ 93 | ALLOCA = @ALLOCA@ 94 | AMTAR = @AMTAR@ 95 | AR = @AR@ 96 | AS = @AS@ 97 | AUTOCONF = @AUTOCONF@ 98 | AUTOHEADER = @AUTOHEADER@ 99 | AUTOMAKE = @AUTOMAKE@ 100 | AWK = @AWK@ 101 | CC = @CC@ 102 | CCDEPMODE = @CCDEPMODE@ 103 | CFLAGS = @CFLAGS@ 104 | CPP = @CPP@ 105 | CPPFLAGS = @CPPFLAGS@ 106 | CXX = @CXX@ 107 | CXXCPP = @CXXCPP@ 108 | CXXDEPMODE = @CXXDEPMODE@ 109 | CXXFLAGS = @CXXFLAGS@ 110 | CYGPATH_W = @CYGPATH_W@ 111 | DEFS = @DEFS@ 112 | DEPDIR = @DEPDIR@ 113 | DLLTOOL = @DLLTOOL@ 114 | DSYMUTIL = @DSYMUTIL@ 115 | DUMPBIN = @DUMPBIN@ 116 | ECHO_C = @ECHO_C@ 117 | ECHO_N = @ECHO_N@ 118 | ECHO_T = @ECHO_T@ 119 | EGREP = @EGREP@ 120 | EXEEXT = @EXEEXT@ 121 | FGREP = @FGREP@ 122 | GREP = @GREP@ 123 | INSTALL = @INSTALL@ 124 | INSTALL_DATA = @INSTALL_DATA@ 125 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 126 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 127 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 128 | JITFLOAT32 = @JITFLOAT32@ 129 | JITFLOAT64 = @JITFLOAT64@ 130 | JITINT16 = @JITINT16@ 131 | JITINT32 = @JITINT32@ 132 | JITINT64 = @JITINT64@ 133 | JITINT64CXX = @JITINT64CXX@ 134 | JITINT8 = @JITINT8@ 135 | JITNATIVEFLOAT = @JITNATIVEFLOAT@ 136 | JITNATIVEINT = @JITNATIVEINT@ 137 | JITNATIVEINTDEFINE = @JITNATIVEINTDEFINE@ 138 | JITNFLOATISDOUBLE = @JITNFLOATISDOUBLE@ 139 | JITTHROWIDIOM = @JITTHROWIDIOM@ 140 | JITUINT8 = @JITUINT8@ 141 | JIT_ARCH = @JIT_ARCH@ 142 | JIT_INT64_INCLUDE = @JIT_INT64_INCLUDE@ 143 | LD = @LD@ 144 | LDFLAGS = @LDFLAGS@ 145 | LEX = @LEX@ 146 | LEXLIB = @LEXLIB@ 147 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 148 | LIBJIT_VERSION = @LIBJIT_VERSION@ 149 | LIBOBJS = @LIBOBJS@ 150 | LIBS = @LIBS@ 151 | LIBTOOL = @LIBTOOL@ 152 | LIB_STDCPP = @LIB_STDCPP@ 153 | LIPO = @LIPO@ 154 | LN_S = @LN_S@ 155 | LTLIBOBJS = @LTLIBOBJS@ 156 | MAKEINFO = @MAKEINFO@ 157 | MANIFEST_TOOL = @MANIFEST_TOOL@ 158 | MKDIR_P = @MKDIR_P@ 159 | NM = @NM@ 160 | NMEDIT = @NMEDIT@ 161 | OBJDUMP = @OBJDUMP@ 162 | OBJEXT = @OBJEXT@ 163 | OTOOL = @OTOOL@ 164 | OTOOL64 = @OTOOL64@ 165 | PACKAGE = @PACKAGE@ 166 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 167 | PACKAGE_NAME = @PACKAGE_NAME@ 168 | PACKAGE_STRING = @PACKAGE_STRING@ 169 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 170 | PACKAGE_URL = @PACKAGE_URL@ 171 | PACKAGE_VERSION = @PACKAGE_VERSION@ 172 | PATH_SEPARATOR = @PATH_SEPARATOR@ 173 | RANLIB = @RANLIB@ 174 | SED = @SED@ 175 | SET_MAKE = @SET_MAKE@ 176 | SHELL = @SHELL@ 177 | STRIP = @STRIP@ 178 | VERSION = @VERSION@ 179 | YACC = @YACC@ 180 | YFLAGS = @YFLAGS@ 181 | abs_builddir = @abs_builddir@ 182 | abs_srcdir = @abs_srcdir@ 183 | abs_top_builddir = @abs_top_builddir@ 184 | abs_top_srcdir = @abs_top_srcdir@ 185 | ac_ct_AR = @ac_ct_AR@ 186 | ac_ct_CC = @ac_ct_CC@ 187 | ac_ct_CXX = @ac_ct_CXX@ 188 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 189 | am__include = @am__include@ 190 | am__leading_dot = @am__leading_dot@ 191 | am__quote = @am__quote@ 192 | am__tar = @am__tar@ 193 | am__untar = @am__untar@ 194 | bindir = @bindir@ 195 | build = @build@ 196 | build_alias = @build_alias@ 197 | build_cpu = @build_cpu@ 198 | build_os = @build_os@ 199 | build_vendor = @build_vendor@ 200 | builddir = @builddir@ 201 | datadir = @datadir@ 202 | datarootdir = @datarootdir@ 203 | docdir = @docdir@ 204 | dvidir = @dvidir@ 205 | exec_prefix = @exec_prefix@ 206 | host = @host@ 207 | host_alias = @host_alias@ 208 | host_cpu = @host_cpu@ 209 | host_os = @host_os@ 210 | host_vendor = @host_vendor@ 211 | htmldir = @htmldir@ 212 | includedir = @includedir@ 213 | infodir = @infodir@ 214 | install_sh = @install_sh@ 215 | libdir = @libdir@ 216 | libexecdir = @libexecdir@ 217 | localedir = @localedir@ 218 | localstatedir = @localstatedir@ 219 | mandir = @mandir@ 220 | mkdir_p = @mkdir_p@ 221 | oldincludedir = @oldincludedir@ 222 | pdfdir = @pdfdir@ 223 | prefix = @prefix@ 224 | program_transform_name = @program_transform_name@ 225 | psdir = @psdir@ 226 | sbindir = @sbindir@ 227 | sharedstatedir = @sharedstatedir@ 228 | srcdir = @srcdir@ 229 | sysconfdir = @sysconfdir@ 230 | target_alias = @target_alias@ 231 | top_build_prefix = @top_build_prefix@ 232 | top_builddir = @top_builddir@ 233 | top_srcdir = @top_srcdir@ 234 | SUBDIRS = jit 235 | all: all-recursive 236 | 237 | .SUFFIXES: 238 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 239 | @for dep in $?; do \ 240 | case '$(am__configure_deps)' in \ 241 | *$$dep*) \ 242 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 243 | && { if test -f $@; then exit 0; else break; fi; }; \ 244 | exit 1;; \ 245 | esac; \ 246 | done; \ 247 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ 248 | $(am__cd) $(top_srcdir) && \ 249 | $(AUTOMAKE) --gnu include/Makefile 250 | .PRECIOUS: Makefile 251 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 252 | @case '$?' in \ 253 | *config.status*) \ 254 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 255 | *) \ 256 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 257 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 258 | esac; 259 | 260 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 261 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 262 | 263 | $(top_srcdir)/configure: $(am__configure_deps) 264 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 265 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 266 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 267 | $(am__aclocal_m4_deps): 268 | 269 | mostlyclean-libtool: 270 | -rm -f *.lo 271 | 272 | clean-libtool: 273 | -rm -rf .libs _libs 274 | 275 | # This directory's subdirectories are mostly independent; you can cd 276 | # into them and run `make' without going through this Makefile. 277 | # To change the values of `make' variables: instead of editing Makefiles, 278 | # (1) if the variable is set in `config.status', edit `config.status' 279 | # (which will cause the Makefiles to be regenerated when you run `make'); 280 | # (2) otherwise, pass the desired values on the `make' command line. 281 | $(RECURSIVE_TARGETS): 282 | @fail= failcom='exit 1'; \ 283 | for f in x $$MAKEFLAGS; do \ 284 | case $$f in \ 285 | *=* | --[!k]*);; \ 286 | *k*) failcom='fail=yes';; \ 287 | esac; \ 288 | done; \ 289 | dot_seen=no; \ 290 | target=`echo $@ | sed s/-recursive//`; \ 291 | list='$(SUBDIRS)'; for subdir in $$list; do \ 292 | echo "Making $$target in $$subdir"; \ 293 | if test "$$subdir" = "."; then \ 294 | dot_seen=yes; \ 295 | local_target="$$target-am"; \ 296 | else \ 297 | local_target="$$target"; \ 298 | fi; \ 299 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 300 | || eval $$failcom; \ 301 | done; \ 302 | if test "$$dot_seen" = "no"; then \ 303 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 304 | fi; test -z "$$fail" 305 | 306 | $(RECURSIVE_CLEAN_TARGETS): 307 | @fail= failcom='exit 1'; \ 308 | for f in x $$MAKEFLAGS; do \ 309 | case $$f in \ 310 | *=* | --[!k]*);; \ 311 | *k*) failcom='fail=yes';; \ 312 | esac; \ 313 | done; \ 314 | dot_seen=no; \ 315 | case "$@" in \ 316 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 317 | *) list='$(SUBDIRS)' ;; \ 318 | esac; \ 319 | rev=''; for subdir in $$list; do \ 320 | if test "$$subdir" = "."; then :; else \ 321 | rev="$$subdir $$rev"; \ 322 | fi; \ 323 | done; \ 324 | rev="$$rev ."; \ 325 | target=`echo $@ | sed s/-recursive//`; \ 326 | for subdir in $$rev; do \ 327 | echo "Making $$target in $$subdir"; \ 328 | if test "$$subdir" = "."; then \ 329 | local_target="$$target-am"; \ 330 | else \ 331 | local_target="$$target"; \ 332 | fi; \ 333 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 334 | || eval $$failcom; \ 335 | done && test -z "$$fail" 336 | tags-recursive: 337 | list='$(SUBDIRS)'; for subdir in $$list; do \ 338 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 339 | done 340 | ctags-recursive: 341 | list='$(SUBDIRS)'; for subdir in $$list; do \ 342 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 343 | done 344 | 345 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 346 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 347 | unique=`for i in $$list; do \ 348 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 349 | done | \ 350 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 351 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 352 | mkid -fID $$unique 353 | tags: TAGS 354 | 355 | TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 356 | $(TAGS_FILES) $(LISP) 357 | set x; \ 358 | here=`pwd`; \ 359 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 360 | include_option=--etags-include; \ 361 | empty_fix=.; \ 362 | else \ 363 | include_option=--include; \ 364 | empty_fix=; \ 365 | fi; \ 366 | list='$(SUBDIRS)'; for subdir in $$list; do \ 367 | if test "$$subdir" = .; then :; else \ 368 | test ! -f $$subdir/TAGS || \ 369 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 370 | fi; \ 371 | done; \ 372 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 373 | unique=`for i in $$list; do \ 374 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 375 | done | \ 376 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 377 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 378 | shift; \ 379 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 380 | test -n "$$unique" || unique=$$empty_fix; \ 381 | if test $$# -gt 0; then \ 382 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 383 | "$$@" $$unique; \ 384 | else \ 385 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 386 | $$unique; \ 387 | fi; \ 388 | fi 389 | ctags: CTAGS 390 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 391 | $(TAGS_FILES) $(LISP) 392 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 393 | unique=`for i in $$list; do \ 394 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 395 | done | \ 396 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 397 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 398 | test -z "$(CTAGS_ARGS)$$unique" \ 399 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 400 | $$unique 401 | 402 | GTAGS: 403 | here=`$(am__cd) $(top_builddir) && pwd` \ 404 | && $(am__cd) $(top_srcdir) \ 405 | && gtags -i $(GTAGS_ARGS) "$$here" 406 | 407 | distclean-tags: 408 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 409 | 410 | distdir: $(DISTFILES) 411 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 412 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 413 | list='$(DISTFILES)'; \ 414 | dist_files=`for file in $$list; do echo $$file; done | \ 415 | sed -e "s|^$$srcdirstrip/||;t" \ 416 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 417 | case $$dist_files in \ 418 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 419 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 420 | sort -u` ;; \ 421 | esac; \ 422 | for file in $$dist_files; do \ 423 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 424 | if test -d $$d/$$file; then \ 425 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 426 | if test -d "$(distdir)/$$file"; then \ 427 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 428 | fi; \ 429 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 430 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 431 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 432 | fi; \ 433 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 434 | else \ 435 | test -f "$(distdir)/$$file" \ 436 | || cp -p $$d/$$file "$(distdir)/$$file" \ 437 | || exit 1; \ 438 | fi; \ 439 | done 440 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 441 | if test "$$subdir" = .; then :; else \ 442 | test -d "$(distdir)/$$subdir" \ 443 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 444 | || exit 1; \ 445 | fi; \ 446 | done 447 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 448 | if test "$$subdir" = .; then :; else \ 449 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 450 | $(am__relativize); \ 451 | new_distdir=$$reldir; \ 452 | dir1=$$subdir; dir2="$(top_distdir)"; \ 453 | $(am__relativize); \ 454 | new_top_distdir=$$reldir; \ 455 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 456 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 457 | ($(am__cd) $$subdir && \ 458 | $(MAKE) $(AM_MAKEFLAGS) \ 459 | top_distdir="$$new_top_distdir" \ 460 | distdir="$$new_distdir" \ 461 | am__remove_distdir=: \ 462 | am__skip_length_check=: \ 463 | am__skip_mode_fix=: \ 464 | distdir) \ 465 | || exit 1; \ 466 | fi; \ 467 | done 468 | check-am: all-am 469 | check: check-recursive 470 | all-am: Makefile 471 | installdirs: installdirs-recursive 472 | installdirs-am: 473 | install: install-recursive 474 | install-exec: install-exec-recursive 475 | install-data: install-data-recursive 476 | uninstall: uninstall-recursive 477 | 478 | install-am: all-am 479 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 480 | 481 | installcheck: installcheck-recursive 482 | install-strip: 483 | if test -z '$(STRIP)'; then \ 484 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 485 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 486 | install; \ 487 | else \ 488 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 489 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 490 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 491 | fi 492 | mostlyclean-generic: 493 | 494 | clean-generic: 495 | 496 | distclean-generic: 497 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 498 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 499 | 500 | maintainer-clean-generic: 501 | @echo "This command is intended for maintainers to use" 502 | @echo "it deletes files that may require special tools to rebuild." 503 | clean: clean-recursive 504 | 505 | clean-am: clean-generic clean-libtool mostlyclean-am 506 | 507 | distclean: distclean-recursive 508 | -rm -f Makefile 509 | distclean-am: clean-am distclean-generic distclean-tags 510 | 511 | dvi: dvi-recursive 512 | 513 | dvi-am: 514 | 515 | html: html-recursive 516 | 517 | html-am: 518 | 519 | info: info-recursive 520 | 521 | info-am: 522 | 523 | install-data-am: 524 | 525 | install-dvi: install-dvi-recursive 526 | 527 | install-dvi-am: 528 | 529 | install-exec-am: 530 | 531 | install-html: install-html-recursive 532 | 533 | install-html-am: 534 | 535 | install-info: install-info-recursive 536 | 537 | install-info-am: 538 | 539 | install-man: 540 | 541 | install-pdf: install-pdf-recursive 542 | 543 | install-pdf-am: 544 | 545 | install-ps: install-ps-recursive 546 | 547 | install-ps-am: 548 | 549 | installcheck-am: 550 | 551 | maintainer-clean: maintainer-clean-recursive 552 | -rm -f Makefile 553 | maintainer-clean-am: distclean-am maintainer-clean-generic 554 | 555 | mostlyclean: mostlyclean-recursive 556 | 557 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 558 | 559 | pdf: pdf-recursive 560 | 561 | pdf-am: 562 | 563 | ps: ps-recursive 564 | 565 | ps-am: 566 | 567 | uninstall-am: 568 | 569 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ 570 | install-am install-strip tags-recursive 571 | 572 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 573 | all all-am check check-am clean clean-generic clean-libtool \ 574 | ctags ctags-recursive distclean distclean-generic \ 575 | distclean-libtool distclean-tags distdir dvi dvi-am html \ 576 | html-am info info-am install install-am install-data \ 577 | install-data-am install-dvi install-dvi-am install-exec \ 578 | install-exec-am install-html install-html-am install-info \ 579 | install-info-am install-man install-pdf install-pdf-am \ 580 | install-ps install-ps-am install-strip installcheck \ 581 | installcheck-am installdirs installdirs-am maintainer-clean \ 582 | maintainer-clean-generic mostlyclean mostlyclean-generic \ 583 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ 584 | uninstall uninstall-am 585 | 586 | 587 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 588 | # Otherwise a system limit (for SysV at least) may be exceeded. 589 | .NOEXPORT: 590 | -------------------------------------------------------------------------------- /libjit/include/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.3 from Makefile.am. 2 | # include/Makefile. Generated from Makefile.in by configure. 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 6 | # Foundation, Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | 17 | 18 | pkgdatadir = $(datadir)/libjit 19 | pkgincludedir = $(includedir)/libjit 20 | pkglibdir = $(libdir)/libjit 21 | pkglibexecdir = $(libexecdir)/libjit 22 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 23 | install_sh_DATA = $(install_sh) -c -m 644 24 | install_sh_PROGRAM = $(install_sh) -c 25 | install_sh_SCRIPT = $(install_sh) -c 26 | INSTALL_HEADER = $(INSTALL_DATA) 27 | transform = $(program_transform_name) 28 | NORMAL_INSTALL = : 29 | PRE_INSTALL = : 30 | POST_INSTALL = : 31 | NORMAL_UNINSTALL = : 32 | PRE_UNINSTALL = : 33 | POST_UNINSTALL = : 34 | build_triplet = i686-pc-linux-gnu 35 | host_triplet = i686-pc-linux-gnu 36 | subdir = include 37 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in 38 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 39 | am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 40 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ 41 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ 42 | $(top_srcdir)/configure.ac 43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 44 | $(ACLOCAL_M4) 45 | mkinstalldirs = $(install_sh) -d 46 | CONFIG_HEADER = $(top_builddir)/config.h 47 | CONFIG_CLEAN_FILES = 48 | CONFIG_CLEAN_VPATH_FILES = 49 | SOURCES = 50 | DIST_SOURCES = 51 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 52 | html-recursive info-recursive install-data-recursive \ 53 | install-dvi-recursive install-exec-recursive \ 54 | install-html-recursive install-info-recursive \ 55 | install-pdf-recursive install-ps-recursive install-recursive \ 56 | installcheck-recursive installdirs-recursive pdf-recursive \ 57 | ps-recursive uninstall-recursive 58 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 59 | distclean-recursive maintainer-clean-recursive 60 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ 61 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ 62 | distdir 63 | ETAGS = etags 64 | CTAGS = ctags 65 | DIST_SUBDIRS = $(SUBDIRS) 66 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 67 | am__relativize = \ 68 | dir0=`pwd`; \ 69 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 70 | sed_rest='s,^[^/]*/*,,'; \ 71 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 72 | sed_butlast='s,/*[^/]*$$,,'; \ 73 | while test -n "$$dir1"; do \ 74 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 75 | if test "$$first" != "."; then \ 76 | if test "$$first" = ".."; then \ 77 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 78 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 79 | else \ 80 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 81 | if test "$$first2" = "$$first"; then \ 82 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 83 | else \ 84 | dir2="../$$dir2"; \ 85 | fi; \ 86 | dir0="$$dir0"/"$$first"; \ 87 | fi; \ 88 | fi; \ 89 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 90 | done; \ 91 | reldir="$$dir2" 92 | ACLOCAL = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run aclocal-1.11 93 | ALLOCA = 94 | AMTAR = $${TAR-tar} 95 | AR = ar 96 | AS = as 97 | AUTOCONF = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run autoconf 98 | AUTOHEADER = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run autoheader 99 | AUTOMAKE = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run automake-1.11 100 | AWK = mawk 101 | CC = gcc 102 | CCDEPMODE = depmode=gcc3 103 | CFLAGS = -fno-gcse -g -O2 -Wall -fno-omit-frame-pointer 104 | CPP = gcc -E 105 | CPPFLAGS = 106 | CXX = g++ 107 | CXXCPP = g++ -E 108 | CXXDEPMODE = depmode=gcc3 109 | CXXFLAGS = -g -O2 -Wall -fno-omit-frame-pointer 110 | CYGPATH_W = echo 111 | DEFS = -DHAVE_CONFIG_H 112 | DEPDIR = .deps 113 | DLLTOOL = dlltool 114 | DSYMUTIL = 115 | DUMPBIN = 116 | ECHO_C = 117 | ECHO_N = -n 118 | ECHO_T = 119 | EGREP = /bin/grep -E 120 | EXEEXT = 121 | FGREP = /bin/grep -F 122 | GREP = /bin/grep 123 | INSTALL = /usr/bin/install -c 124 | INSTALL_DATA = ${INSTALL} -m 644 125 | INSTALL_PROGRAM = ${INSTALL} 126 | INSTALL_SCRIPT = ${INSTALL} 127 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s 128 | JITFLOAT32 = float 129 | JITFLOAT64 = double 130 | JITINT16 = short 131 | JITINT32 = int 132 | JITINT64 = long long 133 | JITINT64CXX = long long 134 | JITINT8 = char 135 | JITNATIVEFLOAT = long double 136 | JITNATIVEINT = int 137 | JITNATIVEINTDEFINE = JIT_NATIVE_INT32 138 | JITNFLOATISDOUBLE = 139 | JITTHROWIDIOM = throw() 140 | JITUINT8 = unsigned char 141 | JIT_ARCH = x86 142 | JIT_INT64_INCLUDE = 143 | LD = /usr/bin/ld 144 | LDFLAGS = 145 | LEX = flex 146 | LEXLIB = -lfl 147 | LEX_OUTPUT_ROOT = lex.yy 148 | LIBJIT_VERSION = 0:1:0 149 | LIBOBJS = 150 | LIBS = -lpthread -ldl -lm 151 | LIBTOOL = $(SHELL) $(top_builddir)/libtool 152 | LIB_STDCPP = -lstdc++ 153 | LIPO = 154 | LN_S = ln -s 155 | LTLIBOBJS = 156 | MAKEINFO = ${SHELL} /home/sankha/projects/libjit/build-aux/missing --run makeinfo 157 | MANIFEST_TOOL = : 158 | MKDIR_P = /bin/mkdir -p 159 | NM = /usr/bin/nm -B 160 | NMEDIT = 161 | OBJDUMP = objdump 162 | OBJEXT = o 163 | OTOOL = 164 | OTOOL64 = 165 | PACKAGE = libjit 166 | PACKAGE_BUGREPORT = libjit@gnu.org 167 | PACKAGE_NAME = libjit 168 | PACKAGE_STRING = libjit 0.1.3 169 | PACKAGE_TARNAME = libjit 170 | PACKAGE_URL = 171 | PACKAGE_VERSION = 0.1.3 172 | PATH_SEPARATOR = : 173 | RANLIB = ranlib 174 | SED = /bin/sed 175 | SET_MAKE = 176 | SHELL = /bin/sh 177 | STRIP = strip 178 | VERSION = 0.1.3 179 | YACC = bison -y 180 | YFLAGS = 181 | abs_builddir = /home/sankha/projects/libjit/include 182 | abs_srcdir = /home/sankha/projects/libjit/include 183 | abs_top_builddir = /home/sankha/projects/libjit 184 | abs_top_srcdir = /home/sankha/projects/libjit 185 | ac_ct_AR = ar 186 | ac_ct_CC = gcc 187 | ac_ct_CXX = g++ 188 | ac_ct_DUMPBIN = 189 | am__include = include 190 | am__leading_dot = . 191 | am__quote = 192 | am__tar = $${TAR-tar} chof - "$$tardir" 193 | am__untar = $${TAR-tar} xf - 194 | bindir = ${exec_prefix}/bin 195 | build = i686-pc-linux-gnu 196 | build_alias = 197 | build_cpu = i686 198 | build_os = linux-gnu 199 | build_vendor = pc 200 | builddir = . 201 | datadir = ${datarootdir} 202 | datarootdir = ${prefix}/share 203 | docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} 204 | dvidir = ${docdir} 205 | exec_prefix = ${prefix} 206 | host = i686-pc-linux-gnu 207 | host_alias = 208 | host_cpu = i686 209 | host_os = linux-gnu 210 | host_vendor = pc 211 | htmldir = ${docdir} 212 | includedir = ${prefix}/include 213 | infodir = ${datarootdir}/info 214 | install_sh = ${SHELL} /home/sankha/projects/libjit/build-aux/install-sh 215 | libdir = ${exec_prefix}/lib/../lib 216 | libexecdir = ${exec_prefix}/libexec 217 | localedir = ${datarootdir}/locale 218 | localstatedir = ${prefix}/var 219 | mandir = ${datarootdir}/man 220 | mkdir_p = /bin/mkdir -p 221 | oldincludedir = /usr/include 222 | pdfdir = ${docdir} 223 | prefix = /usr/local 224 | program_transform_name = s,x,x, 225 | psdir = ${docdir} 226 | sbindir = ${exec_prefix}/sbin 227 | sharedstatedir = ${prefix}/com 228 | srcdir = . 229 | sysconfdir = ${prefix}/etc 230 | target_alias = 231 | top_build_prefix = ../ 232 | top_builddir = .. 233 | top_srcdir = .. 234 | SUBDIRS = jit 235 | all: all-recursive 236 | 237 | .SUFFIXES: 238 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 239 | @for dep in $?; do \ 240 | case '$(am__configure_deps)' in \ 241 | *$$dep*) \ 242 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ 243 | && { if test -f $@; then exit 0; else break; fi; }; \ 244 | exit 1;; \ 245 | esac; \ 246 | done; \ 247 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ 248 | $(am__cd) $(top_srcdir) && \ 249 | $(AUTOMAKE) --gnu include/Makefile 250 | .PRECIOUS: Makefile 251 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 252 | @case '$?' in \ 253 | *config.status*) \ 254 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 255 | *) \ 256 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 257 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 258 | esac; 259 | 260 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 261 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 262 | 263 | $(top_srcdir)/configure: $(am__configure_deps) 264 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 265 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 266 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 267 | $(am__aclocal_m4_deps): 268 | 269 | mostlyclean-libtool: 270 | -rm -f *.lo 271 | 272 | clean-libtool: 273 | -rm -rf .libs _libs 274 | 275 | # This directory's subdirectories are mostly independent; you can cd 276 | # into them and run `make' without going through this Makefile. 277 | # To change the values of `make' variables: instead of editing Makefiles, 278 | # (1) if the variable is set in `config.status', edit `config.status' 279 | # (which will cause the Makefiles to be regenerated when you run `make'); 280 | # (2) otherwise, pass the desired values on the `make' command line. 281 | $(RECURSIVE_TARGETS): 282 | @fail= failcom='exit 1'; \ 283 | for f in x $$MAKEFLAGS; do \ 284 | case $$f in \ 285 | *=* | --[!k]*);; \ 286 | *k*) failcom='fail=yes';; \ 287 | esac; \ 288 | done; \ 289 | dot_seen=no; \ 290 | target=`echo $@ | sed s/-recursive//`; \ 291 | list='$(SUBDIRS)'; for subdir in $$list; do \ 292 | echo "Making $$target in $$subdir"; \ 293 | if test "$$subdir" = "."; then \ 294 | dot_seen=yes; \ 295 | local_target="$$target-am"; \ 296 | else \ 297 | local_target="$$target"; \ 298 | fi; \ 299 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 300 | || eval $$failcom; \ 301 | done; \ 302 | if test "$$dot_seen" = "no"; then \ 303 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 304 | fi; test -z "$$fail" 305 | 306 | $(RECURSIVE_CLEAN_TARGETS): 307 | @fail= failcom='exit 1'; \ 308 | for f in x $$MAKEFLAGS; do \ 309 | case $$f in \ 310 | *=* | --[!k]*);; \ 311 | *k*) failcom='fail=yes';; \ 312 | esac; \ 313 | done; \ 314 | dot_seen=no; \ 315 | case "$@" in \ 316 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 317 | *) list='$(SUBDIRS)' ;; \ 318 | esac; \ 319 | rev=''; for subdir in $$list; do \ 320 | if test "$$subdir" = "."; then :; else \ 321 | rev="$$subdir $$rev"; \ 322 | fi; \ 323 | done; \ 324 | rev="$$rev ."; \ 325 | target=`echo $@ | sed s/-recursive//`; \ 326 | for subdir in $$rev; do \ 327 | echo "Making $$target in $$subdir"; \ 328 | if test "$$subdir" = "."; then \ 329 | local_target="$$target-am"; \ 330 | else \ 331 | local_target="$$target"; \ 332 | fi; \ 333 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 334 | || eval $$failcom; \ 335 | done && test -z "$$fail" 336 | tags-recursive: 337 | list='$(SUBDIRS)'; for subdir in $$list; do \ 338 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 339 | done 340 | ctags-recursive: 341 | list='$(SUBDIRS)'; for subdir in $$list; do \ 342 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 343 | done 344 | 345 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 346 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 347 | unique=`for i in $$list; do \ 348 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 349 | done | \ 350 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 351 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 352 | mkid -fID $$unique 353 | tags: TAGS 354 | 355 | TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 356 | $(TAGS_FILES) $(LISP) 357 | set x; \ 358 | here=`pwd`; \ 359 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 360 | include_option=--etags-include; \ 361 | empty_fix=.; \ 362 | else \ 363 | include_option=--include; \ 364 | empty_fix=; \ 365 | fi; \ 366 | list='$(SUBDIRS)'; for subdir in $$list; do \ 367 | if test "$$subdir" = .; then :; else \ 368 | test ! -f $$subdir/TAGS || \ 369 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 370 | fi; \ 371 | done; \ 372 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 373 | unique=`for i in $$list; do \ 374 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 375 | done | \ 376 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 377 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 378 | shift; \ 379 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 380 | test -n "$$unique" || unique=$$empty_fix; \ 381 | if test $$# -gt 0; then \ 382 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 383 | "$$@" $$unique; \ 384 | else \ 385 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 386 | $$unique; \ 387 | fi; \ 388 | fi 389 | ctags: CTAGS 390 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 391 | $(TAGS_FILES) $(LISP) 392 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 393 | unique=`for i in $$list; do \ 394 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 395 | done | \ 396 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 397 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 398 | test -z "$(CTAGS_ARGS)$$unique" \ 399 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 400 | $$unique 401 | 402 | GTAGS: 403 | here=`$(am__cd) $(top_builddir) && pwd` \ 404 | && $(am__cd) $(top_srcdir) \ 405 | && gtags -i $(GTAGS_ARGS) "$$here" 406 | 407 | distclean-tags: 408 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 409 | 410 | distdir: $(DISTFILES) 411 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 412 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 413 | list='$(DISTFILES)'; \ 414 | dist_files=`for file in $$list; do echo $$file; done | \ 415 | sed -e "s|^$$srcdirstrip/||;t" \ 416 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 417 | case $$dist_files in \ 418 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 419 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 420 | sort -u` ;; \ 421 | esac; \ 422 | for file in $$dist_files; do \ 423 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 424 | if test -d $$d/$$file; then \ 425 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 426 | if test -d "$(distdir)/$$file"; then \ 427 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 428 | fi; \ 429 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 430 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 431 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 432 | fi; \ 433 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 434 | else \ 435 | test -f "$(distdir)/$$file" \ 436 | || cp -p $$d/$$file "$(distdir)/$$file" \ 437 | || exit 1; \ 438 | fi; \ 439 | done 440 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 441 | if test "$$subdir" = .; then :; else \ 442 | test -d "$(distdir)/$$subdir" \ 443 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 444 | || exit 1; \ 445 | fi; \ 446 | done 447 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 448 | if test "$$subdir" = .; then :; else \ 449 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 450 | $(am__relativize); \ 451 | new_distdir=$$reldir; \ 452 | dir1=$$subdir; dir2="$(top_distdir)"; \ 453 | $(am__relativize); \ 454 | new_top_distdir=$$reldir; \ 455 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 456 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 457 | ($(am__cd) $$subdir && \ 458 | $(MAKE) $(AM_MAKEFLAGS) \ 459 | top_distdir="$$new_top_distdir" \ 460 | distdir="$$new_distdir" \ 461 | am__remove_distdir=: \ 462 | am__skip_length_check=: \ 463 | am__skip_mode_fix=: \ 464 | distdir) \ 465 | || exit 1; \ 466 | fi; \ 467 | done 468 | check-am: all-am 469 | check: check-recursive 470 | all-am: Makefile 471 | installdirs: installdirs-recursive 472 | installdirs-am: 473 | install: install-recursive 474 | install-exec: install-exec-recursive 475 | install-data: install-data-recursive 476 | uninstall: uninstall-recursive 477 | 478 | install-am: all-am 479 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 480 | 481 | installcheck: installcheck-recursive 482 | install-strip: 483 | if test -z '$(STRIP)'; then \ 484 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 485 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 486 | install; \ 487 | else \ 488 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 489 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 490 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 491 | fi 492 | mostlyclean-generic: 493 | 494 | clean-generic: 495 | 496 | distclean-generic: 497 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 498 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 499 | 500 | maintainer-clean-generic: 501 | @echo "This command is intended for maintainers to use" 502 | @echo "it deletes files that may require special tools to rebuild." 503 | clean: clean-recursive 504 | 505 | clean-am: clean-generic clean-libtool mostlyclean-am 506 | 507 | distclean: distclean-recursive 508 | -rm -f Makefile 509 | distclean-am: clean-am distclean-generic distclean-tags 510 | 511 | dvi: dvi-recursive 512 | 513 | dvi-am: 514 | 515 | html: html-recursive 516 | 517 | html-am: 518 | 519 | info: info-recursive 520 | 521 | info-am: 522 | 523 | install-data-am: 524 | 525 | install-dvi: install-dvi-recursive 526 | 527 | install-dvi-am: 528 | 529 | install-exec-am: 530 | 531 | install-html: install-html-recursive 532 | 533 | install-html-am: 534 | 535 | install-info: install-info-recursive 536 | 537 | install-info-am: 538 | 539 | install-man: 540 | 541 | install-pdf: install-pdf-recursive 542 | 543 | install-pdf-am: 544 | 545 | install-ps: install-ps-recursive 546 | 547 | install-ps-am: 548 | 549 | installcheck-am: 550 | 551 | maintainer-clean: maintainer-clean-recursive 552 | -rm -f Makefile 553 | maintainer-clean-am: distclean-am maintainer-clean-generic 554 | 555 | mostlyclean: mostlyclean-recursive 556 | 557 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool 558 | 559 | pdf: pdf-recursive 560 | 561 | pdf-am: 562 | 563 | ps: ps-recursive 564 | 565 | ps-am: 566 | 567 | uninstall-am: 568 | 569 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ 570 | install-am install-strip tags-recursive 571 | 572 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 573 | all all-am check check-am clean clean-generic clean-libtool \ 574 | ctags ctags-recursive distclean distclean-generic \ 575 | distclean-libtool distclean-tags distdir dvi dvi-am html \ 576 | html-am info info-am install install-am install-data \ 577 | install-data-am install-dvi install-dvi-am install-exec \ 578 | install-exec-am install-html install-html-am install-info \ 579 | install-info-am install-man install-pdf install-pdf-am \ 580 | install-ps install-ps-am install-strip installcheck \ 581 | installcheck-am installdirs installdirs-am maintainer-clean \ 582 | maintainer-clean-generic mostlyclean mostlyclean-generic \ 583 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ 584 | uninstall uninstall-am 585 | 586 | 587 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 588 | # Otherwise a system limit (for SysV at least) may be exceeded. 589 | .NOEXPORT: 590 | --------------------------------------------------------------------------------