3224 Label done;
3225 Label initialize_header;
3226 Label initialize_object; // including clearing the fields
3227
3228 Register RallocatedObject = Otos_i;
3229 Register RinstanceKlass = O1;
3230 Register Roffset = O3;
3231 Register Rscratch = O4;
3232
3233 __ get_2_byte_integer_at_bcp(1, Rscratch, Roffset, InterpreterMacroAssembler::Unsigned);
3234 __ get_cpool_and_tags(Rscratch, G3_scratch);
3235 // make sure the class we're about to instantiate has been resolved
3236 // This is done before loading InstanceKlass to be consistent with the order
3237 // how Constant Pool is updated (see ConstantPool::klass_at_put)
3238 __ add(G3_scratch, Array<u1>::base_offset_in_bytes(), G3_scratch);
3239 __ ldub(G3_scratch, Roffset, G3_scratch);
3240 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3241 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3242 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3243 // get InstanceKlass
3244 //__ sll(Roffset, LogBytesPerWord, Roffset); // executed in delay slot
3245 __ add(Roffset, sizeof(ConstantPool), Roffset);
3246 __ ld_ptr(Rscratch, Roffset, RinstanceKlass);
3247
3248 // make sure klass is fully initialized:
3249 __ ldub(RinstanceKlass, in_bytes(InstanceKlass::init_state_offset()), G3_scratch);
3250 __ cmp(G3_scratch, InstanceKlass::fully_initialized);
3251 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3252 __ delayed()->ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3253
3254 // get instance_size in InstanceKlass (already aligned)
3255 //__ ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3256
3257 // make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class
3258 __ btst(Klass::_lh_instance_slow_path_bit, Roffset);
3259 __ br(Assembler::notZero, false, Assembler::pn, slow_case);
3260 __ delayed()->nop();
3261
3262 // allocate the instance
3263 // 1) Try to allocate in the TLAB
3264 // 2) if fail, and the TLAB is not full enough to discard, allocate in the shared Eden
3265 // 3) if the above fails (or is not applicable), go to a slow case
3266 // (creates a new TLAB, etc.)
3448 // Get constant pool tag
3449 __ get_2_byte_integer_at_bcp(1, Lscratch, Roffset, InterpreterMacroAssembler::Unsigned);
3450
3451 // See if the checkcast has been quickened
3452 __ get_cpool_and_tags(Lscratch, G3_scratch);
3453 __ add(G3_scratch, Array<u1>::base_offset_in_bytes(), G3_scratch);
3454 __ ldub(G3_scratch, Roffset, G3_scratch);
3455 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3456 __ br(Assembler::equal, true, Assembler::pt, quicked);
3457 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3458
3459 __ push_ptr(); // save receiver for result, and for GC
3460 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) );
3461 __ get_vm_result_2(RspecifiedKlass);
3462 __ pop_ptr(Otos_i, G3_scratch); // restore receiver
3463
3464 __ ba_short(resolved);
3465
3466 // Extract target class from constant pool
3467 __ bind(quicked);
3468 __ add(Roffset, sizeof(ConstantPool), Roffset);
3469 __ ld_ptr(Lscratch, Roffset, RspecifiedKlass);
3470 __ bind(resolved);
3471 __ load_klass(Otos_i, RobjKlass); // get value klass
3472
3473 // Generate a fast subtype check. Branch to cast_ok if no
3474 // failure. Throw exception if failure.
3475 __ gen_subtype_check( RobjKlass, RspecifiedKlass, G3_scratch, G4_scratch, G1_scratch, cast_ok );
3476
3477 // Not a subtype; so must throw exception
3478 __ throw_if_not_x( Assembler::never, Interpreter::_throw_ClassCastException_entry, G3_scratch );
3479
3480 __ bind(cast_ok);
3481
3482 if (ProfileInterpreter) {
3483 __ ba_short(done);
3484 }
3485 __ bind(is_null);
3486 __ profile_null_seen(G3_scratch);
3487 __ bind(done);
3488 }
3489
3505 // Get constant pool tag
3506 __ get_2_byte_integer_at_bcp(1, Lscratch, Roffset, InterpreterMacroAssembler::Unsigned);
3507
3508 // See if the checkcast has been quickened
3509 __ get_cpool_and_tags(Lscratch, G3_scratch);
3510 __ add(G3_scratch, Array<u1>::base_offset_in_bytes(), G3_scratch);
3511 __ ldub(G3_scratch, Roffset, G3_scratch);
3512 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3513 __ br(Assembler::equal, true, Assembler::pt, quicked);
3514 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3515
3516 __ push_ptr(); // save receiver for result, and for GC
3517 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) );
3518 __ get_vm_result_2(RspecifiedKlass);
3519 __ pop_ptr(Otos_i, G3_scratch); // restore receiver
3520
3521 __ ba_short(resolved);
3522
3523 // Extract target class from constant pool
3524 __ bind(quicked);
3525 __ add(Roffset, sizeof(ConstantPool), Roffset);
3526 __ get_constant_pool(Lscratch);
3527 __ ld_ptr(Lscratch, Roffset, RspecifiedKlass);
3528 __ bind(resolved);
3529 __ load_klass(Otos_i, RobjKlass); // get value klass
3530
3531 // Generate a fast subtype check. Branch to cast_ok if no
3532 // failure. Return 0 if failure.
3533 __ or3(G0, 1, Otos_i); // set result assuming quick tests succeed
3534 __ gen_subtype_check( RobjKlass, RspecifiedKlass, G3_scratch, G4_scratch, G1_scratch, done );
3535 // Not a subtype; return 0;
3536 __ clr( Otos_i );
3537
3538 if (ProfileInterpreter) {
3539 __ ba_short(done);
3540 }
3541 __ bind(is_null);
3542 __ profile_null_seen(G3_scratch);
3543 __ bind(done);
3544 }
3545
3546 void TemplateTable::_breakpoint() {
3547
|
3224 Label done;
3225 Label initialize_header;
3226 Label initialize_object; // including clearing the fields
3227
3228 Register RallocatedObject = Otos_i;
3229 Register RinstanceKlass = O1;
3230 Register Roffset = O3;
3231 Register Rscratch = O4;
3232
3233 __ get_2_byte_integer_at_bcp(1, Rscratch, Roffset, InterpreterMacroAssembler::Unsigned);
3234 __ get_cpool_and_tags(Rscratch, G3_scratch);
3235 // make sure the class we're about to instantiate has been resolved
3236 // This is done before loading InstanceKlass to be consistent with the order
3237 // how Constant Pool is updated (see ConstantPool::klass_at_put)
3238 __ add(G3_scratch, Array<u1>::base_offset_in_bytes(), G3_scratch);
3239 __ ldub(G3_scratch, Roffset, G3_scratch);
3240 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3241 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3242 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3243 // get InstanceKlass
3244 __ load_resolved_klass_at_offset(Rscratch, Roffset, RinstanceKlass);
3245
3246 // make sure klass is fully initialized:
3247 __ ldub(RinstanceKlass, in_bytes(InstanceKlass::init_state_offset()), G3_scratch);
3248 __ cmp(G3_scratch, InstanceKlass::fully_initialized);
3249 __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
3250 __ delayed()->ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3251
3252 // get instance_size in InstanceKlass (already aligned)
3253 //__ ld(RinstanceKlass, in_bytes(Klass::layout_helper_offset()), Roffset);
3254
3255 // make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class
3256 __ btst(Klass::_lh_instance_slow_path_bit, Roffset);
3257 __ br(Assembler::notZero, false, Assembler::pn, slow_case);
3258 __ delayed()->nop();
3259
3260 // allocate the instance
3261 // 1) Try to allocate in the TLAB
3262 // 2) if fail, and the TLAB is not full enough to discard, allocate in the shared Eden
3263 // 3) if the above fails (or is not applicable), go to a slow case
3264 // (creates a new TLAB, etc.)
3446 // Get constant pool tag
3447 __ get_2_byte_integer_at_bcp(1, Lscratch, Roffset, InterpreterMacroAssembler::Unsigned);
3448
3449 // See if the checkcast has been quickened
3450 __ get_cpool_and_tags(Lscratch, G3_scratch);
3451 __ add(G3_scratch, Array<u1>::base_offset_in_bytes(), G3_scratch);
3452 __ ldub(G3_scratch, Roffset, G3_scratch);
3453 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3454 __ br(Assembler::equal, true, Assembler::pt, quicked);
3455 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3456
3457 __ push_ptr(); // save receiver for result, and for GC
3458 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) );
3459 __ get_vm_result_2(RspecifiedKlass);
3460 __ pop_ptr(Otos_i, G3_scratch); // restore receiver
3461
3462 __ ba_short(resolved);
3463
3464 // Extract target class from constant pool
3465 __ bind(quicked);
3466 __ load_resolved_klass_at_offset(Lscratch, Roffset, RspecifiedKlass);
3467
3468
3469 __ bind(resolved);
3470 __ load_klass(Otos_i, RobjKlass); // get value klass
3471
3472 // Generate a fast subtype check. Branch to cast_ok if no
3473 // failure. Throw exception if failure.
3474 __ gen_subtype_check( RobjKlass, RspecifiedKlass, G3_scratch, G4_scratch, G1_scratch, cast_ok );
3475
3476 // Not a subtype; so must throw exception
3477 __ throw_if_not_x( Assembler::never, Interpreter::_throw_ClassCastException_entry, G3_scratch );
3478
3479 __ bind(cast_ok);
3480
3481 if (ProfileInterpreter) {
3482 __ ba_short(done);
3483 }
3484 __ bind(is_null);
3485 __ profile_null_seen(G3_scratch);
3486 __ bind(done);
3487 }
3488
3504 // Get constant pool tag
3505 __ get_2_byte_integer_at_bcp(1, Lscratch, Roffset, InterpreterMacroAssembler::Unsigned);
3506
3507 // See if the checkcast has been quickened
3508 __ get_cpool_and_tags(Lscratch, G3_scratch);
3509 __ add(G3_scratch, Array<u1>::base_offset_in_bytes(), G3_scratch);
3510 __ ldub(G3_scratch, Roffset, G3_scratch);
3511 __ cmp(G3_scratch, JVM_CONSTANT_Class);
3512 __ br(Assembler::equal, true, Assembler::pt, quicked);
3513 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
3514
3515 __ push_ptr(); // save receiver for result, and for GC
3516 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc) );
3517 __ get_vm_result_2(RspecifiedKlass);
3518 __ pop_ptr(Otos_i, G3_scratch); // restore receiver
3519
3520 __ ba_short(resolved);
3521
3522 // Extract target class from constant pool
3523 __ bind(quicked);
3524 __ get_constant_pool(Lscratch);
3525 __ load_resolved_klass_at_offset(Lscratch, Roffset, RspecifiedKlass);
3526
3527 __ bind(resolved);
3528 __ load_klass(Otos_i, RobjKlass); // get value klass
3529
3530 // Generate a fast subtype check. Branch to cast_ok if no
3531 // failure. Return 0 if failure.
3532 __ or3(G0, 1, Otos_i); // set result assuming quick tests succeed
3533 __ gen_subtype_check( RobjKlass, RspecifiedKlass, G3_scratch, G4_scratch, G1_scratch, done );
3534 // Not a subtype; return 0;
3535 __ clr( Otos_i );
3536
3537 if (ProfileInterpreter) {
3538 __ ba_short(done);
3539 }
3540 __ bind(is_null);
3541 __ profile_null_seen(G3_scratch);
3542 __ bind(done);
3543 }
3544
3545 void TemplateTable::_breakpoint() {
3546
|