CACAO
StackSlotManager.hpp
Go to the documentation of this file.
1 /* src/vm/jit/compiler2/StackSlotManager.hpp - StackSlotManager
2 
3  Copyright (C) 2013
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 #ifndef _JIT_COMPILER2_STACKSLOTMANAGER
26 #define _JIT_COMPILER2_STACKSLOTMANAGER
27 
29 #include "vm/types.hpp"
30 
33 
34 namespace cacao {
35 namespace jit {
36 namespace compiler2 {
37 
38 // forward declaration
39 class ManagedStackSlot;
40 class StackSlot;
41 
42 /**
43  * StackSlotManager
44  *
45  * The StackSlotManger is used to manage slots for spilled registers etc.
46  */
48 private:
50 
53 
54  /**
55  * The number of argument slots at machine-level.
56  */
58 
59 public:
62 
63  /**
64  * Create a ManagedStackSlot.
65  *
66  * @param type The slot's type.
67  *
68  * @return The new stack slot.
69  */
71 
72  /**
73  * Create a ManagedStackSlot for an invocation argument.
74  *
75  * @param type The slot's type.
76  * @param index The index of the invocation argument for which this slot is used.
77  *
78  * @return The new stack slot.
79  */
81 
82  /**
83  * Assigns each ManagedStackSlot a position in the virtual frame.
84  */
85  void finalize();
86 
87  /**
88  * @return The size of the stack frame in bytes.
89  */
90  u4 get_frame_size() const;
91 
92  /**
93  * @return The number of actual machine-level slots.
94  */
96 };
97 
98 } // end namespace compiler2
99 } // end namespace jit
100 } // end namespace cacao
101 
102 #endif /* _JIT_COMPILER2_STACKSLOTMANAGER */
103 
104 
105 /*
106  * These are local overrides for various environment variables in Emacs.
107  * Please do not remove this and leave it at the end of the file, where
108  * Emacs will automagically detect them.
109  * ---------------------------------------------------------------------
110  * Local variables:
111  * mode: c++
112  * indent-tabs-mode: t
113  * c-basic-offset: 4
114  * tab-width: 4
115  * End:
116  * vim:noexpandtab:sw=4:ts=4:
117  */
std::size_t index
ManagedStackSlot * create_slot(Type::TypeID type)
Create a ManagedStackSlot.
u4 number_of_machine_argument_slots
The number of argument slots at machine-level.
void finalize()
Assigns each ManagedStackSlot a position in the virtual frame.
ManagedStackSlot * create_argument_slot(Type::TypeID type, u4 index)
Create a ManagedStackSlot for an invocation argument.
std::vector< T, Allocator< T > > type
Definition: vector.hpp:38
A &quot;virtual&quot; slot that will eventually be mapped to a machine-level slot.
alloc::vector< ManagedStackSlot * >::type SlotListTy
uint32_t u4
Definition: types.hpp:46