1 /*
2 * Copyright (c) 2003, 2016, 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.
3566 __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3567 // See if bytecode has already been quicked
3568 __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3569 __ lea(r1, Address(rscratch1, r19));
3570 __ ldarb(r1, r1);
3571 __ cmp(r1, JVM_CONSTANT_Class);
3572 __ br(Assembler::EQ, quicked);
3573
3574 __ push(atos); // save receiver for result, and for GC
3575 call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3576 // vm_result_2 has metadata result
3577 __ get_vm_result_2(r0, rthread);
3578 __ pop(r3); // restore receiver
3579 __ verify_oop(r3);
3580 __ load_klass(r3, r3);
3581 __ b(resolved);
3582
3583 // Get superklass in r0 and subklass in r3
3584 __ bind(quicked);
3585 __ load_klass(r3, r0);
3586 __ lea(r0, Address(r2, r19, Address::lsl(3)));
3587 __ ldr(r0, Address(r0, sizeof(ConstantPool)));
3588
3589 __ bind(resolved);
3590
3591 // Generate subtype check. Blows r2, r5
3592 // Superklass in r0. Subklass in r3.
3593 __ gen_subtype_check(r3, ok_is_subtype);
3594
3595 // Come here on failure
3596 __ mov(r0, 0);
3597 __ b(done);
3598 // Come here on success
3599 __ bind(ok_is_subtype);
3600 __ mov(r0, 1);
3601
3602 // Collect counts on whether this test sees NULLs a lot or not.
3603 if (ProfileInterpreter) {
3604 __ b(done);
3605 __ bind(is_null);
3606 __ profile_null_seen(r2);
3607 } else {
|
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.
3566 __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3567 // See if bytecode has already been quicked
3568 __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3569 __ lea(r1, Address(rscratch1, r19));
3570 __ ldarb(r1, r1);
3571 __ cmp(r1, JVM_CONSTANT_Class);
3572 __ br(Assembler::EQ, quicked);
3573
3574 __ push(atos); // save receiver for result, and for GC
3575 call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3576 // vm_result_2 has metadata result
3577 __ get_vm_result_2(r0, rthread);
3578 __ pop(r3); // restore receiver
3579 __ verify_oop(r3);
3580 __ load_klass(r3, r3);
3581 __ b(resolved);
3582
3583 // Get superklass in r0 and subklass in r3
3584 __ bind(quicked);
3585 __ load_klass(r3, r0);
3586 //__ load_resolved_klass_at_offset(r2, r19, r0);
3587 Register cpool = r2;
3588 Register index = r19;
3589 Register klass = r0;
3590 Register tmp = klass;
3591 __ lea(tmp, Address(cpool, index, Address::lsl(3)));
3592 __ ldrh(index, Address(tmp, sizeof(ConstantPool))); // index = resolved_klass_index
3593 __ ldr(tmp, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes())); // tmp = cpool->_resolved_klasses
3594 __ lea(tmp, Address(tmp, index, Address::lsl(3)));
3595 __ ldr(klass, Address(tmp, Array<Klass*>::base_offset_in_bytes()));
3596
3597 __ bind(resolved);
3598
3599 // Generate subtype check. Blows r2, r5
3600 // Superklass in r0. Subklass in r3.
3601 __ gen_subtype_check(r3, ok_is_subtype);
3602
3603 // Come here on failure
3604 __ mov(r0, 0);
3605 __ b(done);
3606 // Come here on success
3607 __ bind(ok_is_subtype);
3608 __ mov(r0, 1);
3609
3610 // Collect counts on whether this test sees NULLs a lot or not.
3611 if (ProfileInterpreter) {
3612 __ b(done);
3613 __ bind(is_null);
3614 __ profile_null_seen(r2);
3615 } else {
|