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
38 #include "toolbox/list.hpp"
40 #include "vm/method.h"
42 #include "vm/jit/jit.hpp"
43 #include "vm/jit/code.hpp"
45 #include "vm/jit/ir/instruction.hpp"
51 * Represents a Java line number.
55 // TODO Add constants.
56 /* -1......start of inlined body */
57 /* -2......end of inlined body */
58 /* <= -3...special entry with methodinfo * */
59 /* (see doc/inlining_stacktrace.txt) */
65 Linenumber(int32_t linenumber, void* pc) : _linenumber(linenumber), _pc(pc) {}
67 inline int32_t get_linenumber() const { return _linenumber; }
68 inline void* get_pc () const { return _pc; }
70 void resolve(const codeinfo* code);
75 * Unary function to resolve Linenumber objects.
77 class LinenumberResolver : public std::binary_function<Linenumber, codeinfo*, void> {
79 // Unary resolve function.
80 void operator() (Linenumber& ln, const codeinfo* code) const
88 * Linenumber table of a Java method.
90 class LinenumberTable {
92 std::vector<Linenumber> _linenumbers;
96 class comparator : public std::binary_function<Linenumber, void*, bool> {
98 bool operator() (const Linenumber& ln, const void* pc) const
100 return (pc >= ln.get_pc());
105 LinenumberTable(jitdata* jd);
106 LinenumberTable() { }
109 int32_t find(methodinfo **pm, void* pc);
114 typedef struct LinenumberTable LinenumberTable;
118 #include "vm/jit/codegen-common.hpp"
124 void linenumbertable_list_entry_add(codegendata *cd, int32_t linenumber);
125 void linenumbertable_list_entry_add_inline_start(codegendata *cd, instruction *iptr);
126 void linenumbertable_list_entry_add_inline_end(codegendata *cd, instruction *iptr);
132 #endif // _LINENUMBERTABLE_HPP
136 * These are local overrides for various environment variables in Emacs.
137 * Please do not remove this and leave it at the end of the file, where
138 * Emacs will automagically detect them.
139 * ---------------------------------------------------------------------
142 * indent-tabs-mode: t
146 * vim:noexpandtab:sw=4:ts=4: