Line data Source code
1 : /* src/vm/jit/ir/instruction.cpp - IR instruction
2 :
3 : Copyright (C) 2008
4 : CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 :
6 : This file is part of CACAO.
7 :
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.
12 :
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.
17 :
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
21 : 02110-1301, USA.
22 :
23 : */
24 :
25 : #include "vm/jit/ir/instruction.hpp"
26 : #include "vm/jit/builtin.hpp" // for builtintable_entry
27 : #include "vm/descriptor.hpp" // for typedesc
28 : #include "vm/method.hpp" // for methodinfo
29 : #include "vm/resolve.hpp" // for unresolved_method
30 :
31 0 : methoddesc* instruction_call_site(const instruction* iptr)
32 : {
33 0 : if (iptr->opc == ICMD_BUILTIN) {
34 0 : return iptr->sx.s23.s3.bte->md;
35 : }
36 0 : else if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
37 0 : return iptr->sx.s23.s3.um->methodref->parseddesc.md;
38 : }
39 : else {
40 0 : return iptr->sx.s23.s3.fmiref->p.method->parseddesc;
41 : }
42 : }
43 :
44 0 : Type instruction_call_site_return_type(const instruction* iptr) {
45 0 : return (Type) instruction_call_site(iptr)->returntype.type;
46 : }
47 :
48 : /*
49 : * These are local overrides for various environment variables in Emacs.
50 : * Please do not remove this and leave it at the end of the file, where
51 : * Emacs will automagically detect them.
52 : * ---------------------------------------------------------------------
53 : * Local variables:
54 : * mode: c++
55 : * indent-tabs-mode: t
56 : * c-basic-offset: 4
57 : * tab-width: 4
58 : * End:
59 : * vim:noexpandtab:sw=4:ts=4:
60 : */
|