CACAO
MachineInstructionSchedule.cpp
Go to the documentation of this file.
1 /* src/vm/jit/compiler2/MachineInstructionSchedule.cpp - MachineInstructionSchedule
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 
27 
28 namespace cacao {
29 namespace jit {
30 namespace compiler2 {
31 
33 
36  list.push_back(value.MBB);
37  return value.MBB->my_it = --end();
38 }
41  list.push_front(value.MBB);
42  return value.MBB->my_it = begin();
43 }
46  const MBBBuilder& value) {
47  list.insert(pos.it,value.MBB);
48  return value.MBB->my_it = --pos;
49 }
50 
52  if (empty()) return mi_end();
53  // Note: by convention MachineBasicBlock blocks are not
54  // allowed to be empty. Therefor we can safely assume
55  // that front()->begin() != front()->end().
56  return MIIterator(begin(),front()->begin());
57 }
59  return MIIterator(end());
60 }
61 
62 } // end namespace compiler2
63 } // end namespace jit
64 } // end namespace cacao
65 
66 
67 /*
68  * These are local overrides for various environment variables in Emacs.
69  * Please do not remove this and leave it at the end of the file, where
70  * Emacs will automagically detect them.
71  * ---------------------------------------------------------------------
72  * Local variables:
73  * mode: c++
74  * indent-tabs-mode: t
75  * c-basic-offset: 4
76  * tab-width: 4
77  * End:
78  * vim:noexpandtab:sw=4:ts=4:
79  */
alloc::ordered_list< MachineBasicBlock * >::type list
MIIterator mi_end()
returns an const MIIterator to the end
MachineInstructionSchedule::iterator insert_before(iterator pos, const MBBBuilder &value)
inserts value before the element pointed to by pos
A basic block of (scheduled) machine instructions.
bool empty() const
checks if the schedule has no elements.
iterator begin()
returns an iterator to the beginning
MIIterator pos
MIIterator mi_begin()
returns an const MIIterator to the beginning
MachineInstructionSchedule::iterator push_front(const MBBBuilder &value)
inserts value to the beginning
MachineInstructionSchedule::iterator push_back(const MBBBuilder &value)
Appends the given element value to the end of the container.