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 #ifndef SHARE_VM_OOPS_CPCACHEOOP_INLINE_HPP
26 #define SHARE_VM_OOPS_CPCACHEOOP_INLINE_HPP
27
28 #include "oops/cpCache.hpp"
29 #include "oops/oopHandle.inline.hpp"
30 #include "runtime/orderAccess.inline.hpp"
31
32 inline int ConstantPoolCacheEntry::indices_ord() const { return OrderAccess::load_acquire(&_indices); }
33
34 inline Bytecodes::Code ConstantPoolCacheEntry::bytecode_1() const {
35 return Bytecodes::cast((indices_ord() >> bytecode_1_shift) & bytecode_1_mask);
36 }
37
38 inline Bytecodes::Code ConstantPoolCacheEntry::bytecode_2() const {
39 return Bytecodes::cast((indices_ord() >> bytecode_2_shift) & bytecode_2_mask);
40 }
41
42 // Has this bytecode been resolved? Only valid for invokes and get/put field/static.
43 inline bool ConstantPoolCacheEntry::is_resolved(Bytecodes::Code code) const {
44 switch (bytecode_number(code)) {
45 case 1: return (bytecode_1() == code);
46 case 2: return (bytecode_2() == code);
47 }
48 return false; // default: not resolved
49 }
50
|
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 #ifndef SHARE_VM_OOPS_CPCACHEOOP_INLINE_HPP
26 #define SHARE_VM_OOPS_CPCACHEOOP_INLINE_HPP
27
28 #include "oops/cpCache.hpp"
29 #include "oops/oopHandle.inline.hpp"
30 #include "runtime/orderAccess.hpp"
31
32 inline int ConstantPoolCacheEntry::indices_ord() const { return OrderAccess::load_acquire(&_indices); }
33
34 inline Bytecodes::Code ConstantPoolCacheEntry::bytecode_1() const {
35 return Bytecodes::cast((indices_ord() >> bytecode_1_shift) & bytecode_1_mask);
36 }
37
38 inline Bytecodes::Code ConstantPoolCacheEntry::bytecode_2() const {
39 return Bytecodes::cast((indices_ord() >> bytecode_2_shift) & bytecode_2_mask);
40 }
41
42 // Has this bytecode been resolved? Only valid for invokes and get/put field/static.
43 inline bool ConstantPoolCacheEntry::is_resolved(Bytecodes::Code code) const {
44 switch (bytecode_number(code)) {
45 case 1: return (bytecode_1() == code);
46 case 2: return (bytecode_2() == code);
47 }
48 return false; // default: not resolved
49 }
50
|