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 class SharkState : public SharkTargetInvariants {
27 public:
28 SharkState(const SharkTargetInvariants* parent)
29 : SharkTargetInvariants(parent),
30 _method(NULL),
31 _oop_tmp(NULL),
32 _has_safepointed(false) { initialize(NULL); }
33
34 SharkState(const SharkState* state)
35 : SharkTargetInvariants(state),
36 _method(state->_method),
37 _oop_tmp(state->_oop_tmp),
38 _has_safepointed(state->_has_safepointed) { initialize(state); }
39
40 private:
41 void initialize(const SharkState* state);
42
43 private:
44 llvm::Value* _method;
45 SharkValue** _locals;
169 };
170
171 // SharkPHIState objects are used to manage the entry state
172 // for blocks with more than one entry path or for blocks
173 // entered from blocks that will be compiled later.
174 class SharkPHIState : public SharkState {
175 public:
176 SharkPHIState(SharkTopLevelBlock* block);
177
178 private:
179 SharkTopLevelBlock* _block;
180
181 private:
182 SharkTopLevelBlock* block() const {
183 return _block;
184 }
185
186 public:
187 void add_incoming(SharkState* incoming_state);
188 };
|
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_SHARKSTATE_HPP
27 #define SHARE_VM_SHARK_SHARKSTATE_HPP
28
29 #include "ci/ciMethod.hpp"
30 #include "memory/allocation.hpp"
31 #include "shark/llvmHeaders.hpp"
32 #include "shark/sharkBuilder.hpp"
33 #include "shark/sharkInvariants.hpp"
34 #include "shark/sharkValue.hpp"
35
36 class SharkState : public SharkTargetInvariants {
37 public:
38 SharkState(const SharkTargetInvariants* parent)
39 : SharkTargetInvariants(parent),
40 _method(NULL),
41 _oop_tmp(NULL),
42 _has_safepointed(false) { initialize(NULL); }
43
44 SharkState(const SharkState* state)
45 : SharkTargetInvariants(state),
46 _method(state->_method),
47 _oop_tmp(state->_oop_tmp),
48 _has_safepointed(state->_has_safepointed) { initialize(state); }
49
50 private:
51 void initialize(const SharkState* state);
52
53 private:
54 llvm::Value* _method;
55 SharkValue** _locals;
179 };
180
181 // SharkPHIState objects are used to manage the entry state
182 // for blocks with more than one entry path or for blocks
183 // entered from blocks that will be compiled later.
184 class SharkPHIState : public SharkState {
185 public:
186 SharkPHIState(SharkTopLevelBlock* block);
187
188 private:
189 SharkTopLevelBlock* _block;
190
191 private:
192 SharkTopLevelBlock* block() const {
193 return _block;
194 }
195
196 public:
197 void add_incoming(SharkState* incoming_state);
198 };
199
200 #endif // SHARE_VM_SHARK_SHARKSTATE_HPP
|