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 #include "precompiled.hpp"
27 #include "interp_masm_aarch64.hpp"
28 #include "interpreter/interpreter.hpp"
29 #include "interpreter/interpreterRuntime.hpp"
30 #include "logging/log.hpp"
31 #include "oops/arrayOop.hpp"
32 #include "oops/markOop.hpp"
33 #include "oops/methodData.hpp"
34 #include "oops/method.hpp"
35 #include "prims/jvmtiExport.hpp"
36 #include "prims/jvmtiThreadState.hpp"
37 #include "runtime/basicLock.hpp"
38 #include "runtime/biasedLocking.hpp"
39 #include "runtime/sharedRuntime.hpp"
40 #include "runtime/thread.inline.hpp"
41
42
43 void InterpreterMacroAssembler::narrow(Register result) {
44
45 // Get method->_constMethod->_result_type
46 ldr(rscratch1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
258 cbz(mcs, skip); // No MethodCounters allocated, OutOfMemory
259 bind(has_counters);
260 }
261
262 // Load object from cpool->resolved_references(index)
263 void InterpreterMacroAssembler::load_resolved_reference_at_index(
264 Register result, Register index) {
265 assert_different_registers(result, index);
266 // convert from field index to resolved_references() index and from
267 // word index to byte offset. Since this is a java object, it can be compressed
268 Register tmp = index; // reuse
269 lslw(tmp, tmp, LogBytesPerHeapOop);
270
271 get_constant_pool(result);
272 // load pointer for resolved_references[] objArray
273 ldr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
274 ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
275 resolve_oop_handle(result);
276 // Add in the index
277 add(result, result, tmp);
278 load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
279 }
280
281 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
282 Register cpool, Register index, Register klass, Register temp) {
283 add(temp, cpool, index, LSL, LogBytesPerWord);
284 ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
285 ldr(klass, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
286 add(klass, klass, temp, LSL, LogBytesPerWord);
287 ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));
288 }
289
290 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
291 // subtype of super_klass.
292 //
293 // Args:
294 // r0: superklass
295 // Rsub_klass: subklass
296 //
297 // Kills:
298 // r2, r5
|
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 #include "precompiled.hpp"
27 #include "gc/shared/barrierSetCodeGen.hpp"
28 #include "interp_masm_aarch64.hpp"
29 #include "interpreter/interpreter.hpp"
30 #include "interpreter/interpreterRuntime.hpp"
31 #include "logging/log.hpp"
32 #include "oops/arrayOop.hpp"
33 #include "oops/markOop.hpp"
34 #include "oops/methodData.hpp"
35 #include "oops/method.hpp"
36 #include "prims/jvmtiExport.hpp"
37 #include "prims/jvmtiThreadState.hpp"
38 #include "runtime/basicLock.hpp"
39 #include "runtime/biasedLocking.hpp"
40 #include "runtime/sharedRuntime.hpp"
41 #include "runtime/thread.inline.hpp"
42
43
44 void InterpreterMacroAssembler::narrow(Register result) {
45
46 // Get method->_constMethod->_result_type
47 ldr(rscratch1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
259 cbz(mcs, skip); // No MethodCounters allocated, OutOfMemory
260 bind(has_counters);
261 }
262
263 // Load object from cpool->resolved_references(index)
264 void InterpreterMacroAssembler::load_resolved_reference_at_index(
265 Register result, Register index) {
266 assert_different_registers(result, index);
267 // convert from field index to resolved_references() index and from
268 // word index to byte offset. Since this is a java object, it can be compressed
269 Register tmp = index; // reuse
270 lslw(tmp, tmp, LogBytesPerHeapOop);
271
272 get_constant_pool(result);
273 // load pointer for resolved_references[] objArray
274 ldr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
275 ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
276 resolve_oop_handle(result);
277 // Add in the index
278 add(result, result, tmp);
279 BarrierSetCodeGen *code_gen = BarrierSet::barrier_set()->code_gen();
280 code_gen->load_at(this, ACCESS_IN_HEAP, T_OBJECT, result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), /*tmp1*/ noreg, /*tmp_thread*/ noreg);
281 }
282
283 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
284 Register cpool, Register index, Register klass, Register temp) {
285 add(temp, cpool, index, LSL, LogBytesPerWord);
286 ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
287 ldr(klass, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
288 add(klass, klass, temp, LSL, LogBytesPerWord);
289 ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));
290 }
291
292 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
293 // subtype of super_klass.
294 //
295 // Args:
296 // r0: superklass
297 // Rsub_klass: subklass
298 //
299 // Kills:
300 // r2, r5
|