1 /*
2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 // Base classes used to track various values through the compilation.
27 // SharkCompileInvariants is used to track values which remain the
28 // same for the top-level method and any inlined methods it may have
29 // (ie for the whole compilation). SharkTargetInvariants is used to
30 // track values which differ between methods.
31
32 class SharkCompileInvariants : public ResourceObj {
33 protected:
34 SharkCompileInvariants(ciEnv* env, SharkBuilder* builder)
35 : _env(env),
36 _builder(builder),
37 _thread(NULL) {}
38
39 SharkCompileInvariants(const SharkCompileInvariants* parent)
40 : _env(parent->_env),
41 _builder(parent->_builder),
42 _thread(parent->_thread) {}
43
44 private:
45 ciEnv* _env;
148 protected:
149 int max_locals() const {
150 return target()->max_locals();
151 }
152 int max_stack() const {
153 return target()->max_stack();
154 }
155 int max_monitors() const {
156 return _max_monitors;
157 }
158 int arg_size() const {
159 return target()->arg_size();
160 }
161 bool is_static() const {
162 return target()->is_static();
163 }
164 bool is_synchronized() const {
165 return target()->is_synchronized();
166 }
167 };
|
1 /*
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef SHARE_VM_SHARK_SHARKINVARIANTS_HPP
27 #define SHARE_VM_SHARK_SHARKINVARIANTS_HPP
28
29 #include "ci/ciEnv.hpp"
30 #include "ci/ciInstanceKlass.hpp"
31 #include "ci/ciMethod.hpp"
32 #include "ci/ciTypeFlow.hpp"
33 #include "code/debugInfoRec.hpp"
34 #include "code/dependencies.hpp"
35 #include "memory/allocation.hpp"
36 #include "shark/llvmHeaders.hpp"
37 #include "shark/sharkBuilder.hpp"
38
39 // Base classes used to track various values through the compilation.
40 // SharkCompileInvariants is used to track values which remain the
41 // same for the top-level method and any inlined methods it may have
42 // (ie for the whole compilation). SharkTargetInvariants is used to
43 // track values which differ between methods.
44
45 class SharkCompileInvariants : public ResourceObj {
46 protected:
47 SharkCompileInvariants(ciEnv* env, SharkBuilder* builder)
48 : _env(env),
49 _builder(builder),
50 _thread(NULL) {}
51
52 SharkCompileInvariants(const SharkCompileInvariants* parent)
53 : _env(parent->_env),
54 _builder(parent->_builder),
55 _thread(parent->_thread) {}
56
57 private:
58 ciEnv* _env;
161 protected:
162 int max_locals() const {
163 return target()->max_locals();
164 }
165 int max_stack() const {
166 return target()->max_stack();
167 }
168 int max_monitors() const {
169 return _max_monitors;
170 }
171 int arg_size() const {
172 return target()->arg_size();
173 }
174 bool is_static() const {
175 return target()->is_static();
176 }
177 bool is_synchronized() const {
178 return target()->is_synchronized();
179 }
180 };
181
182 #endif // SHARE_VM_SHARK_SHARKINVARIANTS_HPP
|