5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_GraphBuilder.cpp.incl" 27 28 class BlockListBuilder VALUE_OBJ_CLASS_SPEC { 29 private: 30 Compilation* _compilation; 31 IRScope* _scope; 32 33 BlockList _blocks; // internal list of all blocks 34 BlockList* _bci2block; // mapping from bci to blocks for GraphBuilder 35 36 // fields used by mark_loops 37 BitMap _active; // for iteration of control flow graph 38 BitMap _visited; // for iteration of control flow graph 39 intArray _loop_map; // caches the information if a block is contained in a loop 40 int _next_loop_index; // next free loop number 41 int _next_block_number; // for reverse postorder numbering of blocks 42 43 // accessors 44 Compilation* compilation() const { return _compilation; } 45 IRScope* scope() const { return _scope; } 46 ciMethod* method() const { return scope()->method(); } | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "c1/c1_CFGPrinter.hpp" 27 #include "c1/c1_Canonicalizer.hpp" 28 #include "c1/c1_Compilation.hpp" 29 #include "c1/c1_GraphBuilder.hpp" 30 #include "c1/c1_InstructionPrinter.hpp" 31 #include "ci/ciField.hpp" 32 #include "ci/ciKlass.hpp" 33 #include "interpreter/bytecode.hpp" 34 #include "runtime/sharedRuntime.hpp" 35 #include "utilities/bitMap.inline.hpp" 36 37 class BlockListBuilder VALUE_OBJ_CLASS_SPEC { 38 private: 39 Compilation* _compilation; 40 IRScope* _scope; 41 42 BlockList _blocks; // internal list of all blocks 43 BlockList* _bci2block; // mapping from bci to blocks for GraphBuilder 44 45 // fields used by mark_loops 46 BitMap _active; // for iteration of control flow graph 47 BitMap _visited; // for iteration of control flow graph 48 intArray _loop_map; // caches the information if a block is contained in a loop 49 int _next_loop_index; // next free loop number 50 int _next_block_number; // for reverse postorder numbering of blocks 51 52 // accessors 53 Compilation* compilation() const { return _compilation; } 54 IRScope* scope() const { return _scope; } 55 ciMethod* method() const { return scope()->method(); } |