1 /*
2 * Copyright (c) 1999, 2013, 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 *
126 GraphBuilder gm(compilation, this);
127 NOT_PRODUCT(if (PrintValueNumbering && Verbose) gm.print_stats());
128 if (compilation->bailed_out()) return NULL;
129 return gm.start();
130 }
131
132
133 IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph)
134 : _callees(2)
135 , _compilation(compilation)
136 , _requires_phi_function(method->max_locals())
137 {
138 _caller = caller;
139 _level = caller == NULL ? 0 : caller->level() + 1;
140 _method = method;
141 _xhandlers = new XHandlers(method);
142 _number_of_locks = 0;
143 _monitor_pairing_ok = method->has_balanced_monitors();
144 _wrote_final = false;
145 _wrote_fields = false;
146 _start = NULL;
147
148 if (osr_bci == -1) {
149 _requires_phi_function.clear();
150 } else {
151 // selective creation of phi functions is not possibel in osr-methods
152 _requires_phi_function.set_range(0, method->max_locals());
153 }
154
155 assert(method->holder()->is_loaded() , "method holder must be loaded");
156
157 // build graph if monitor pairing is ok
158 if (create_graph && monitor_pairing_ok()) _start = build_graph(compilation, osr_bci);
159 }
160
161
162 int IRScope::max_stack() const {
163 int my_max = method()->max_stack();
164 int callee_max = 0;
165 for (int i = 0; i < number_of_callees(); i++) {
|
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 *
126 GraphBuilder gm(compilation, this);
127 NOT_PRODUCT(if (PrintValueNumbering && Verbose) gm.print_stats());
128 if (compilation->bailed_out()) return NULL;
129 return gm.start();
130 }
131
132
133 IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph)
134 : _callees(2)
135 , _compilation(compilation)
136 , _requires_phi_function(method->max_locals())
137 {
138 _caller = caller;
139 _level = caller == NULL ? 0 : caller->level() + 1;
140 _method = method;
141 _xhandlers = new XHandlers(method);
142 _number_of_locks = 0;
143 _monitor_pairing_ok = method->has_balanced_monitors();
144 _wrote_final = false;
145 _wrote_fields = false;
146 _wrote_volatile = false;
147 _start = NULL;
148
149 if (osr_bci == -1) {
150 _requires_phi_function.clear();
151 } else {
152 // selective creation of phi functions is not possibel in osr-methods
153 _requires_phi_function.set_range(0, method->max_locals());
154 }
155
156 assert(method->holder()->is_loaded() , "method holder must be loaded");
157
158 // build graph if monitor pairing is ok
159 if (create_graph && monitor_pairing_ok()) _start = build_graph(compilation, osr_bci);
160 }
161
162
163 int IRScope::max_stack() const {
164 int my_max = method()->max_stack();
165 int callee_max = 0;
166 for (int i = 0; i < number_of_callees(); i++) {
|