1 /*
2 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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/ciCallSite.hpp"
32 #include "ci/ciField.hpp"
33 #include "ci/ciKlass.hpp"
34 #include "ci/ciMemberName.hpp"
35 #include "compiler/compileBroker.hpp"
36 #include "interpreter/bytecode.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #include "runtime/compilationPolicy.hpp"
40 #include "runtime/vm_version.hpp"
41 #include "utilities/bitMap.inline.hpp"
42
43 class BlockListBuilder VALUE_OBJ_CLASS_SPEC {
44 private:
45 Compilation* _compilation;
46 IRScope* _scope;
47
48 BlockList _blocks; // internal list of all blocks
49 BlockList* _bci2block; // mapping from bci to blocks for GraphBuilder
50
51 // fields used by mark_loops
52 BitMap _active; // for iteration of control flow graph
53 BitMap _visited; // for iteration of control flow graph
54 intArray _loop_map; // caches the information if a block is contained in a loop
55 int _next_loop_index; // next free loop number
56 int _next_block_number; // for reverse postorder numbering of blocks
|
1 /*
2 * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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/ciCallSite.hpp"
32 #include "ci/ciField.hpp"
33 #include "ci/ciKlass.hpp"
34 #include "ci/ciMemberName.hpp"
35 #include "compiler/compileBroker.hpp"
36 #include "interpreter/bytecode.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "runtime/sharedRuntime.hpp"
40 #include "runtime/compilationPolicy.hpp"
41 #include "runtime/vm_version.hpp"
42 #include "utilities/bitMap.inline.hpp"
43
44 class BlockListBuilder VALUE_OBJ_CLASS_SPEC {
45 private:
46 Compilation* _compilation;
47 IRScope* _scope;
48
49 BlockList _blocks; // internal list of all blocks
50 BlockList* _bci2block; // mapping from bci to blocks for GraphBuilder
51
52 // fields used by mark_loops
53 BitMap _active; // for iteration of control flow graph
54 BitMap _visited; // for iteration of control flow graph
55 intArray _loop_map; // caches the information if a block is contained in a loop
56 int _next_loop_index; // next free loop number
57 int _next_block_number; // for reverse postorder numbering of blocks
|