3355
3356 __ get_unsigned_2_byte_index_at_bcp(r3, 1);
3357 Label slow_case;
3358 Label done;
3359 Label initialize_header;
3360 Label initialize_object; // including clearing the fields
3361 Label allocate_shared;
3362
3363 __ get_cpool_and_tags(r4, r0);
3364 // Make sure the class we're about to instantiate has been resolved.
3365 // This is done before loading InstanceKlass to be consistent with the order
3366 // how Constant Pool is updated (see ConstantPool::klass_at_put)
3367 const int tags_offset = Array<u1>::base_offset_in_bytes();
3368 __ lea(rscratch1, Address(r0, r3, Address::lsl(0)));
3369 __ lea(rscratch1, Address(rscratch1, tags_offset));
3370 __ ldarb(rscratch1, rscratch1);
3371 __ cmp(rscratch1, JVM_CONSTANT_Class);
3372 __ br(Assembler::NE, slow_case);
3373
3374 // get InstanceKlass
3375 __ lea(r4, Address(r4, r3, Address::lsl(3)));
3376 __ ldr(r4, Address(r4, sizeof(ConstantPool)));
3377
3378 // make sure klass is initialized & doesn't have finalizer
3379 // make sure klass is fully initialized
3380 __ ldrb(rscratch1, Address(r4, InstanceKlass::init_state_offset()));
3381 __ cmp(rscratch1, InstanceKlass::fully_initialized);
3382 __ br(Assembler::NE, slow_case);
3383
3384 // get instance_size in InstanceKlass (scaled to a count of bytes)
3385 __ ldrw(r3,
3386 Address(r4,
3387 Klass::layout_helper_offset()));
3388 // test to see if it has a finalizer or is malformed in some way
3389 __ tbnz(r3, exact_log2(Klass::_lh_instance_slow_path_bit), slow_case);
3390
3391 // Allocate the instance
3392 // 1) Try to allocate in the TLAB
3393 // 2) if fail and the object is large allocate in the shared Eden
3394 // 3) if the above fails (or is not applicable), go to a slow case
3395 // (creates a new TLAB, etc.)
3396
3509 // Get cpool & tags index
3510 __ get_cpool_and_tags(r2, r3); // r2=cpool, r3=tags array
3511 __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3512 // See if bytecode has already been quicked
3513 __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3514 __ lea(r1, Address(rscratch1, r19));
3515 __ ldarb(r1, r1);
3516 __ cmp(r1, JVM_CONSTANT_Class);
3517 __ br(Assembler::EQ, quicked);
3518
3519 __ push(atos); // save receiver for result, and for GC
3520 call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3521 // vm_result_2 has metadata result
3522 __ get_vm_result_2(r0, rthread);
3523 __ pop(r3); // restore receiver
3524 __ b(resolved);
3525
3526 // Get superklass in r0 and subklass in r3
3527 __ bind(quicked);
3528 __ mov(r3, r0); // Save object in r3; r0 needed for subtype check
3529 __ lea(r0, Address(r2, r19, Address::lsl(3)));
3530 __ ldr(r0, Address(r0, sizeof(ConstantPool)));
3531
3532 __ bind(resolved);
3533 __ load_klass(r19, r3);
3534
3535 // Generate subtype check. Blows r2, r5. Object in r3.
3536 // Superklass in r0. Subklass in r19.
3537 __ gen_subtype_check(r19, ok_is_subtype);
3538
3539 // Come here on failure
3540 __ push(r3);
3541 // object is at TOS
3542 __ b(Interpreter::_throw_ClassCastException_entry);
3543
3544 // Come here on success
3545 __ bind(ok_is_subtype);
3546 __ mov(r0, r3); // Restore object in r3
3547
3548 // Collect counts on whether this test sees NULLs a lot or not.
3549 if (ProfileInterpreter) {
3550 __ b(done);
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 {
|
3355
3356 __ get_unsigned_2_byte_index_at_bcp(r3, 1);
3357 Label slow_case;
3358 Label done;
3359 Label initialize_header;
3360 Label initialize_object; // including clearing the fields
3361 Label allocate_shared;
3362
3363 __ get_cpool_and_tags(r4, r0);
3364 // Make sure the class we're about to instantiate has been resolved.
3365 // This is done before loading InstanceKlass to be consistent with the order
3366 // how Constant Pool is updated (see ConstantPool::klass_at_put)
3367 const int tags_offset = Array<u1>::base_offset_in_bytes();
3368 __ lea(rscratch1, Address(r0, r3, Address::lsl(0)));
3369 __ lea(rscratch1, Address(rscratch1, tags_offset));
3370 __ ldarb(rscratch1, rscratch1);
3371 __ cmp(rscratch1, JVM_CONSTANT_Class);
3372 __ br(Assembler::NE, slow_case);
3373
3374 // get InstanceKlass
3375 __ load_resolved_klass_at_offset(r4, r3, r4, rscratch1);
3376
3377 // make sure klass is initialized & doesn't have finalizer
3378 // make sure klass is fully initialized
3379 __ ldrb(rscratch1, Address(r4, InstanceKlass::init_state_offset()));
3380 __ cmp(rscratch1, InstanceKlass::fully_initialized);
3381 __ br(Assembler::NE, slow_case);
3382
3383 // get instance_size in InstanceKlass (scaled to a count of bytes)
3384 __ ldrw(r3,
3385 Address(r4,
3386 Klass::layout_helper_offset()));
3387 // test to see if it has a finalizer or is malformed in some way
3388 __ tbnz(r3, exact_log2(Klass::_lh_instance_slow_path_bit), slow_case);
3389
3390 // Allocate the instance
3391 // 1) Try to allocate in the TLAB
3392 // 2) if fail and the object is large allocate in the shared Eden
3393 // 3) if the above fails (or is not applicable), go to a slow case
3394 // (creates a new TLAB, etc.)
3395
3508 // Get cpool & tags index
3509 __ get_cpool_and_tags(r2, r3); // r2=cpool, r3=tags array
3510 __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3511 // See if bytecode has already been quicked
3512 __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3513 __ lea(r1, Address(rscratch1, r19));
3514 __ ldarb(r1, r1);
3515 __ cmp(r1, JVM_CONSTANT_Class);
3516 __ br(Assembler::EQ, quicked);
3517
3518 __ push(atos); // save receiver for result, and for GC
3519 call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3520 // vm_result_2 has metadata result
3521 __ get_vm_result_2(r0, rthread);
3522 __ pop(r3); // restore receiver
3523 __ b(resolved);
3524
3525 // Get superklass in r0 and subklass in r3
3526 __ bind(quicked);
3527 __ mov(r3, r0); // Save object in r3; r0 needed for subtype check
3528 __ load_resolved_klass_at_offset(r2, r19, r0, rscratch1); // r0 = klass
3529
3530 __ bind(resolved);
3531 __ load_klass(r19, r3);
3532
3533 // Generate subtype check. Blows r2, r5. Object in r3.
3534 // Superklass in r0. Subklass in r19.
3535 __ gen_subtype_check(r19, ok_is_subtype);
3536
3537 // Come here on failure
3538 __ push(r3);
3539 // object is at TOS
3540 __ b(Interpreter::_throw_ClassCastException_entry);
3541
3542 // Come here on success
3543 __ bind(ok_is_subtype);
3544 __ mov(r0, r3); // Restore object in r3
3545
3546 // Collect counts on whether this test sees NULLs a lot or not.
3547 if (ProfileInterpreter) {
3548 __ b(done);
3564 __ get_unsigned_2_byte_index_at_bcp(r19, 1); // r19=index
3565 // See if bytecode has already been quicked
3566 __ add(rscratch1, r3, Array<u1>::base_offset_in_bytes());
3567 __ lea(r1, Address(rscratch1, r19));
3568 __ ldarb(r1, r1);
3569 __ cmp(r1, JVM_CONSTANT_Class);
3570 __ br(Assembler::EQ, quicked);
3571
3572 __ push(atos); // save receiver for result, and for GC
3573 call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc));
3574 // vm_result_2 has metadata result
3575 __ get_vm_result_2(r0, rthread);
3576 __ pop(r3); // restore receiver
3577 __ verify_oop(r3);
3578 __ load_klass(r3, r3);
3579 __ b(resolved);
3580
3581 // Get superklass in r0 and subklass in r3
3582 __ bind(quicked);
3583 __ load_klass(r3, r0);
3584 __ load_resolved_klass_at_offset(r2, r19, r0, rscratch1);
3585
3586 __ bind(resolved);
3587
3588 // Generate subtype check. Blows r2, r5
3589 // Superklass in r0. Subklass in r3.
3590 __ gen_subtype_check(r3, ok_is_subtype);
3591
3592 // Come here on failure
3593 __ mov(r0, 0);
3594 __ b(done);
3595 // Come here on success
3596 __ bind(ok_is_subtype);
3597 __ mov(r0, 1);
3598
3599 // Collect counts on whether this test sees NULLs a lot or not.
3600 if (ProfileInterpreter) {
3601 __ b(done);
3602 __ bind(is_null);
3603 __ profile_null_seen(r2);
3604 } else {
|