1 /*
2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
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.
253 ldr(mcs, Address(method, Method::method_counters_offset()));
254 cbnz(mcs, has_counters);
255 call_VM(noreg, CAST_FROM_FN_PTR(address,
256 InterpreterRuntime::build_method_counters), method);
257 ldr(mcs, Address(method, Method::method_counters_offset()));
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::resolved_references_offset_in_bytes()));
274 // JNIHandles::resolve(obj);
275 ldr(result, Address(result, 0));
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 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
282 // subtype of super_klass.
283 //
284 // Args:
285 // r0: superklass
286 // Rsub_klass: subklass
287 //
288 // Kills:
289 // r2, r5
290 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
291 Label& ok_is_subtype) {
292 assert(Rsub_klass != r0, "r0 holds superklass");
293 assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
|
1 /*
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
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.
253 ldr(mcs, Address(method, Method::method_counters_offset()));
254 cbnz(mcs, has_counters);
255 call_VM(noreg, CAST_FROM_FN_PTR(address,
256 InterpreterRuntime::build_method_counters), method);
257 ldr(mcs, Address(method, Method::method_counters_offset()));
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 // JNIHandles::resolve(obj);
276 ldr(result, Address(result, 0));
277 // Add in the index
278 add(result, result, tmp);
279 load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
280 }
281
282 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
283 // subtype of super_klass.
284 //
285 // Args:
286 // r0: superklass
287 // Rsub_klass: subklass
288 //
289 // Kills:
290 // r2, r5
291 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
292 Label& ok_is_subtype) {
293 assert(Rsub_klass != r0, "r0 holds superklass");
294 assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
|