1 /*
2 * Copyright (c) 1997, 2017, 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 *
99 // That is why we must check both ProfileInterpreter and mdo != NULL.
100 MethodData* mdo = last_frame.method()->method_data();
101 if (mdo != NULL) {
102 NEEDS_CLEANUP;
103 last_frame.set_mdp(mdo->bci_to_dp(last_frame.bci()));
104 }
105 }
106 }
107
108 //------------------------------------------------------------------------------------------------------------------------
109 // Constants
110
111
112 IRT_ENTRY(void, InterpreterRuntime::ldc(JavaThread* thread, bool wide))
113 // access constant pool
114 LastFrameAccessor last_frame(thread);
115 ConstantPool* pool = last_frame.method()->constants();
116 int index = wide ? last_frame.get_index_u2(Bytecodes::_ldc_w) : last_frame.get_index_u1(Bytecodes::_ldc);
117 constantTag tag = pool->tag_at(index);
118
119 assert ((tag.is_unresolved_klass() || tag.is_klass() ||
120 tag.is_unresolved_value_type() || tag.is_value_type()),
121 "wrong ldc call");
122 Klass* klass = pool->klass_at(index, CHECK);
123 oop java_class = klass->java_mirror();
124 thread->set_vm_result(java_class);
125 IRT_END
126
127 IRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* thread, Bytecodes::Code bytecode)) {
128 assert(bytecode == Bytecodes::_ldc ||
129 bytecode == Bytecodes::_ldc_w ||
130 bytecode == Bytecodes::_ldc2_w ||
131 bytecode == Bytecodes::_fast_aldc ||
132 bytecode == Bytecodes::_fast_aldc_w, "wrong bc");
133 ResourceMark rm(thread);
134 const bool is_fast_aldc = (bytecode == Bytecodes::_fast_aldc ||
135 bytecode == Bytecodes::_fast_aldc_w);
136 LastFrameAccessor last_frame(thread);
137 methodHandle m (thread, last_frame.method());
138 Bytecode_loadconstant ldc(m, last_frame.bci());
139
140 // Double-check the size. (Condy can have any type.)
141 BasicType type = ldc.result_type();
|
1 /*
2 * Copyright (c) 1997, 2018, 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 *
99 // That is why we must check both ProfileInterpreter and mdo != NULL.
100 MethodData* mdo = last_frame.method()->method_data();
101 if (mdo != NULL) {
102 NEEDS_CLEANUP;
103 last_frame.set_mdp(mdo->bci_to_dp(last_frame.bci()));
104 }
105 }
106 }
107
108 //------------------------------------------------------------------------------------------------------------------------
109 // Constants
110
111
112 IRT_ENTRY(void, InterpreterRuntime::ldc(JavaThread* thread, bool wide))
113 // access constant pool
114 LastFrameAccessor last_frame(thread);
115 ConstantPool* pool = last_frame.method()->constants();
116 int index = wide ? last_frame.get_index_u2(Bytecodes::_ldc_w) : last_frame.get_index_u1(Bytecodes::_ldc);
117 constantTag tag = pool->tag_at(index);
118
119 assert (tag.is_unresolved_klass() || tag.is_klass(), "wrong ldc call");
120 Klass* klass = pool->klass_at(index, CHECK);
121 oop java_class = klass->java_mirror();
122 thread->set_vm_result(java_class);
123 IRT_END
124
125 IRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* thread, Bytecodes::Code bytecode)) {
126 assert(bytecode == Bytecodes::_ldc ||
127 bytecode == Bytecodes::_ldc_w ||
128 bytecode == Bytecodes::_ldc2_w ||
129 bytecode == Bytecodes::_fast_aldc ||
130 bytecode == Bytecodes::_fast_aldc_w, "wrong bc");
131 ResourceMark rm(thread);
132 const bool is_fast_aldc = (bytecode == Bytecodes::_fast_aldc ||
133 bytecode == Bytecodes::_fast_aldc_w);
134 LastFrameAccessor last_frame(thread);
135 methodHandle m (thread, last_frame.method());
136 Bytecode_loadconstant ldc(m, last_frame.bci());
137
138 // Double-check the size. (Condy can have any type.)
139 BasicType type = ldc.result_type();
|