1 /* src/vm/jit/linenumbertable.hpp - linenumber table
3 Copyright (C) 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #ifndef _LINENUMBERTABLE_HPP
27 #define _LINENUMBERTABLE_HPP
37 #include "toolbox/list.hpp"
39 #include "vm/method.h"
41 #include "vm/jit/jit.hpp"
42 #include "vm/jit/code.hpp"
44 #include "vm/jit/ir/instruction.hpp"
50 * Represents a Java line number.
54 // TODO Add constants.
55 /* -1......start of inlined body */
56 /* -2......end of inlined body */
57 /* <= -3...special entry with methodinfo * */
58 /* (see doc/inlining_stacktrace.txt) */
64 Linenumber(int32_t linenumber, void* pc) : _linenumber(linenumber), _pc(pc) {}
66 inline int32_t get_linenumber() const { return _linenumber; }
67 inline void* get_pc () const { return _pc; }
69 void resolve(codeinfo* code);
74 * Linenumber table of a Java method.
76 class LinenumberTable {
78 std::vector<Linenumber> _linenumbers;
81 LinenumberTable(jitdata* jd);
84 int32_t find(methodinfo **pm, void* pc);
89 typedef struct LinenumberTable LinenumberTable;
91 #include "vm/jit/codegen-common.hpp"
93 int32_t linenumbertable_linenumber_for_pc(methodinfo** m, codeinfo* code, void* pc);
97 #include "vm/jit/codegen-common.hpp"
103 void linenumbertable_list_entry_add(codegendata *cd, int32_t linenumber);
104 void linenumbertable_list_entry_add_inline_start(codegendata *cd, instruction *iptr);
105 void linenumbertable_list_entry_add_inline_end(codegendata *cd, instruction *iptr);
112 #endif // _LINENUMBERTABLE_HPP
116 * These are local overrides for various environment variables in Emacs.
117 * Please do not remove this and leave it at the end of the file, where
118 * Emacs will automagically detect them.
119 * ---------------------------------------------------------------------
122 * indent-tabs-mode: t
126 * vim:noexpandtab:sw=4:ts=4: