1 /* src/vm/jit/emit-common.h - common code emitter functions
3 Copyright (C) 2006 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Christian Thalinger
29 $Id: emitfuncs.c 4398 2006-01-31 23:43:08Z twisti $
39 #include "vm/jit/jit.h"
42 /* constant range macros ******************************************************/
44 #if SIZEOF_VOID_P == 8
47 (((s8) (c) >= -128) && ((s8) (c) <= 127))
49 # define IS_IMM32(c) \
50 (((s8) (c) >= (-2147483647-1)) && ((s8) (c) <= 2147483647))
55 (((s4) (c) >= -128) && ((s4) (c) <= 127))
60 /* code generation functions **************************************************/
62 s4 emit_load(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg);
63 s4 emit_load_s1(jitdata *jd, instruction *iptr, s4 tempreg);
64 s4 emit_load_s2(jitdata *jd, instruction *iptr, s4 tempreg);
65 s4 emit_load_s3(jitdata *jd, instruction *iptr, s4 tempreg);
67 #if SIZEOF_VOID_P == 4
68 s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg);
69 s4 emit_load_s1_low(jitdata *jd, instruction *iptr, s4 tempreg);
70 s4 emit_load_s2_low(jitdata *jd, instruction *iptr, s4 tempreg);
71 s4 emit_load_s3_low(jitdata *jd, instruction *iptr, s4 tempreg);
73 s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg);
74 s4 emit_load_s1_high(jitdata *jd, instruction *iptr, s4 tempreg);
75 s4 emit_load_s2_high(jitdata *jd, instruction *iptr, s4 tempreg);
76 s4 emit_load_s3_high(jitdata *jd, instruction *iptr, s4 tempreg);
79 void emit_store(jitdata *jd, instruction *iptr, varinfo *dst, s4 d);
80 void emit_store_dst(jitdata *jd, instruction *iptr, s4 d);
82 #if SIZEOF_VOID_P == 4
83 void emit_store_low(jitdata *jd, instruction *iptr, varinfo *dst, s4 d);
84 void emit_store_high(jitdata *jd, instruction *iptr, varinfo *dst, s4 d);
87 void emit_copy(jitdata *jd, instruction *iptr, varinfo *src, varinfo *dst);
89 void emit_iconst(codegendata *cd, s4 d, s4 value);
90 void emit_lconst(codegendata *cd, s4 d, s8 value);
92 void emit_arithmetic_check(codegendata *cd, s4 reg);
93 void emit_arrayindexoutofbounds_check(codegendata *cd, s4 s1, s4 s2);
94 void emit_arraystore_check(codegendata *cd, s4 reg);
95 void emit_classcast_check(codegendata *cd, s4 condition, s4 reg, s4 s1);
96 void emit_nullpointer_check(codegendata *cd, s4 reg);
97 void emit_exception_check(codegendata *cd);
99 void emit_array_checks(codegendata *cd, instruction *iptr, s4 s1, s4 s2);
101 void emit_exception_stubs(jitdata *jd);
102 void emit_patcher_stubs(jitdata *jd);
103 void emit_replacement_stubs(jitdata *jd);
105 void emit_verbosecall_enter(jitdata *jd);
106 void emit_verbosecall_exit(jitdata *jd);
112 * These are local overrides for various environment variables in Emacs.
113 * Please do not remove this and leave it at the end of the file, where
114 * Emacs will automagically detect them.
115 * ---------------------------------------------------------------------
118 * indent-tabs-mode: t
122 * vim:noexpandtab:sw=4:ts=4: