4355 __ get_unsigned_2_byte_index_at_bcp(Rindex, 1);
4356 __ get_cpool_and_tags(Rcpool, Rtags);
4357
4358 // Make sure the class we're about to instantiate has been resolved.
4359 // This is done before loading InstanceKlass to be consistent with the order
4360 // how Constant Pool is updated (see ConstantPool::klass_at_put)
4361 const int tags_offset = Array<u1>::base_offset_in_bytes();
4362 __ add(Rtemp, Rtags, Rindex);
4363
4364 #ifdef AARCH64
4365 __ add(Rtemp, Rtemp, tags_offset);
4366 __ ldarb(Rtemp, Rtemp);
4367 #else
4368 __ ldrb(Rtemp, Address(Rtemp, tags_offset));
4369
4370 // use Rklass as a scratch
4371 volatile_barrier(MacroAssembler::LoadLoad, Rklass);
4372 #endif // AARCH64
4373
4374 // get InstanceKlass
4375 __ add(Rklass, Rcpool, AsmOperand(Rindex, lsl, LogBytesPerWord));
4376 __ ldr(Rklass, Address(Rklass, sizeof(ConstantPool)));
4377 __ cmp(Rtemp, JVM_CONSTANT_Class);
4378 __ b(slow_case, ne);
4379
4380 // make sure klass is initialized & doesn't have finalizer
4381 // make sure klass is fully initialized
4382 __ ldrb(Rtemp, Address(Rklass, InstanceKlass::init_state_offset()));
4383 __ cmp(Rtemp, InstanceKlass::fully_initialized);
4384 __ b(slow_case, ne);
4385
4386 // get instance_size in InstanceKlass (scaled to a count of bytes)
4387 __ ldr_u32(Rsize, Address(Rklass, Klass::layout_helper_offset()));
4388
4389 // test to see if it has a finalizer or is malformed in some way
4390 // Klass::_lh_instance_slow_path_bit is really a bit mask, not bit number
4391 __ tbnz(Rsize, exact_log2(Klass::_lh_instance_slow_path_bit), slow_case);
4392
4393 //
4394 // Allocate the instance
4395 // 1) Try to allocate in the TLAB
4396 // 2) if fail and the object is large allocate in the shared Eden
4397 // 3) if the above fails (or is not applicable), go to a slow case
4398 // (creates a new TLAB, etc.)
4630 volatile_barrier(MacroAssembler::LoadLoad, Rtemp, true);
4631 #endif // !AARCH64
4632
4633 __ b(quicked, eq);
4634
4635 __ push(atos);
4636 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
4637 // vm_result_2 has metadata result
4638 __ get_vm_result_2(Rsuper, Robj);
4639 __ pop_ptr(Robj);
4640 __ b(resolved);
4641
4642 __ bind(throw_exception);
4643 // Come here on failure of subtype check
4644 __ profile_typecheck_failed(R1_tmp);
4645 __ mov(R2_ClassCastException_obj, Robj); // convention with generate_ClassCastException_handler()
4646 __ b(Interpreter::_throw_ClassCastException_entry);
4647
4648 // Get superklass in Rsuper and subklass in Rsub
4649 __ bind(quicked);
4650 __ add(Rtemp, Rcpool, AsmOperand(Rindex, lsl, LogBytesPerWord));
4651 __ ldr(Rsuper, Address(Rtemp, sizeof(ConstantPool)));
4652
4653 __ bind(resolved);
4654 __ load_klass(Rsub, Robj);
4655
4656 // Generate subtype check. Blows both tmps and Rtemp.
4657 assert_different_registers(Robj, Rsub, Rsuper, Rsubtype_check_tmp1, Rsubtype_check_tmp2, Rtemp);
4658 __ gen_subtype_check(Rsub, Rsuper, throw_exception, Rsubtype_check_tmp1, Rsubtype_check_tmp2);
4659
4660 // Come here on success
4661
4662 // Collect counts on whether this check-cast sees NULLs a lot or not.
4663 if (ProfileInterpreter) {
4664 __ b(done);
4665 __ bind(is_null);
4666 __ profile_null_seen(R1_tmp);
4667 } else {
4668 __ bind(is_null); // same as 'done'
4669 }
4670 __ bind(done);
4671 }
4704 #else
4705 __ ldrb(Rtemp, Address(Rtemp, Array<u1>::base_offset_in_bytes()));
4706 #endif // AARCH64
4707 __ cmp(Rtemp, JVM_CONSTANT_Class);
4708
4709 #ifndef AARCH64
4710 volatile_barrier(MacroAssembler::LoadLoad, Rtemp, true);
4711 #endif // !AARCH64
4712
4713 __ b(quicked, eq);
4714
4715 __ push(atos);
4716 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
4717 // vm_result_2 has metadata result
4718 __ get_vm_result_2(Rsuper, Robj);
4719 __ pop_ptr(Robj);
4720 __ b(resolved);
4721
4722 // Get superklass in Rsuper and subklass in Rsub
4723 __ bind(quicked);
4724 __ add(Rtemp, Rcpool, AsmOperand(Rindex, lsl, LogBytesPerWord));
4725 __ ldr(Rsuper, Address(Rtemp, sizeof(ConstantPool)));
4726
4727 __ bind(resolved);
4728 __ load_klass(Rsub, Robj);
4729
4730 // Generate subtype check. Blows both tmps and Rtemp.
4731 __ gen_subtype_check(Rsub, Rsuper, not_subtype, Rsubtype_check_tmp1, Rsubtype_check_tmp2);
4732
4733 // Come here on success
4734 __ mov(R0_tos, 1);
4735 __ b(done);
4736
4737 __ bind(not_subtype);
4738 // Come here on failure
4739 __ profile_typecheck_failed(R1_tmp);
4740 __ mov(R0_tos, 0);
4741
4742 // Collect counts on whether this test sees NULLs a lot or not.
4743 if (ProfileInterpreter) {
4744 __ b(done);
4745 __ bind(is_null);
|
4355 __ get_unsigned_2_byte_index_at_bcp(Rindex, 1);
4356 __ get_cpool_and_tags(Rcpool, Rtags);
4357
4358 // Make sure the class we're about to instantiate has been resolved.
4359 // This is done before loading InstanceKlass to be consistent with the order
4360 // how Constant Pool is updated (see ConstantPool::klass_at_put)
4361 const int tags_offset = Array<u1>::base_offset_in_bytes();
4362 __ add(Rtemp, Rtags, Rindex);
4363
4364 #ifdef AARCH64
4365 __ add(Rtemp, Rtemp, tags_offset);
4366 __ ldarb(Rtemp, Rtemp);
4367 #else
4368 __ ldrb(Rtemp, Address(Rtemp, tags_offset));
4369
4370 // use Rklass as a scratch
4371 volatile_barrier(MacroAssembler::LoadLoad, Rklass);
4372 #endif // AARCH64
4373
4374 // get InstanceKlass
4375 __ cmp(Rtemp, JVM_CONSTANT_Class);
4376 __ b(slow_case, ne);
4377 __ load_resolved_klass_at_offset(Rcpool, Rindex, Rklass);
4378
4379 // make sure klass is initialized & doesn't have finalizer
4380 // make sure klass is fully initialized
4381 __ ldrb(Rtemp, Address(Rklass, InstanceKlass::init_state_offset()));
4382 __ cmp(Rtemp, InstanceKlass::fully_initialized);
4383 __ b(slow_case, ne);
4384
4385 // get instance_size in InstanceKlass (scaled to a count of bytes)
4386 __ ldr_u32(Rsize, Address(Rklass, Klass::layout_helper_offset()));
4387
4388 // test to see if it has a finalizer or is malformed in some way
4389 // Klass::_lh_instance_slow_path_bit is really a bit mask, not bit number
4390 __ tbnz(Rsize, exact_log2(Klass::_lh_instance_slow_path_bit), slow_case);
4391
4392 //
4393 // Allocate the instance
4394 // 1) Try to allocate in the TLAB
4395 // 2) if fail and the object is large allocate in the shared Eden
4396 // 3) if the above fails (or is not applicable), go to a slow case
4397 // (creates a new TLAB, etc.)
4629 volatile_barrier(MacroAssembler::LoadLoad, Rtemp, true);
4630 #endif // !AARCH64
4631
4632 __ b(quicked, eq);
4633
4634 __ push(atos);
4635 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
4636 // vm_result_2 has metadata result
4637 __ get_vm_result_2(Rsuper, Robj);
4638 __ pop_ptr(Robj);
4639 __ b(resolved);
4640
4641 __ bind(throw_exception);
4642 // Come here on failure of subtype check
4643 __ profile_typecheck_failed(R1_tmp);
4644 __ mov(R2_ClassCastException_obj, Robj); // convention with generate_ClassCastException_handler()
4645 __ b(Interpreter::_throw_ClassCastException_entry);
4646
4647 // Get superklass in Rsuper and subklass in Rsub
4648 __ bind(quicked);
4649 __ load_resolved_klass_at_offset(Rcpool, Rindex, Rsuper);
4650
4651 __ bind(resolved);
4652 __ load_klass(Rsub, Robj);
4653
4654 // Generate subtype check. Blows both tmps and Rtemp.
4655 assert_different_registers(Robj, Rsub, Rsuper, Rsubtype_check_tmp1, Rsubtype_check_tmp2, Rtemp);
4656 __ gen_subtype_check(Rsub, Rsuper, throw_exception, Rsubtype_check_tmp1, Rsubtype_check_tmp2);
4657
4658 // Come here on success
4659
4660 // Collect counts on whether this check-cast sees NULLs a lot or not.
4661 if (ProfileInterpreter) {
4662 __ b(done);
4663 __ bind(is_null);
4664 __ profile_null_seen(R1_tmp);
4665 } else {
4666 __ bind(is_null); // same as 'done'
4667 }
4668 __ bind(done);
4669 }
4702 #else
4703 __ ldrb(Rtemp, Address(Rtemp, Array<u1>::base_offset_in_bytes()));
4704 #endif // AARCH64
4705 __ cmp(Rtemp, JVM_CONSTANT_Class);
4706
4707 #ifndef AARCH64
4708 volatile_barrier(MacroAssembler::LoadLoad, Rtemp, true);
4709 #endif // !AARCH64
4710
4711 __ b(quicked, eq);
4712
4713 __ push(atos);
4714 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
4715 // vm_result_2 has metadata result
4716 __ get_vm_result_2(Rsuper, Robj);
4717 __ pop_ptr(Robj);
4718 __ b(resolved);
4719
4720 // Get superklass in Rsuper and subklass in Rsub
4721 __ bind(quicked);
4722 __ load_resolved_klass_at_offset(Rcpool, Rindex, Rsuper);
4723
4724 __ bind(resolved);
4725 __ load_klass(Rsub, Robj);
4726
4727 // Generate subtype check. Blows both tmps and Rtemp.
4728 __ gen_subtype_check(Rsub, Rsuper, not_subtype, Rsubtype_check_tmp1, Rsubtype_check_tmp2);
4729
4730 // Come here on success
4731 __ mov(R0_tos, 1);
4732 __ b(done);
4733
4734 __ bind(not_subtype);
4735 // Come here on failure
4736 __ profile_typecheck_failed(R1_tmp);
4737 __ mov(R0_tos, 0);
4738
4739 // Collect counts on whether this test sees NULLs a lot or not.
4740 if (ProfileInterpreter) {
4741 __ b(done);
4742 __ bind(is_null);
|