1002 // Move subklass into rbx |
1002 // Move subklass into rbx |
1003 __ load_klass(rbx, rax); |
1003 __ load_klass(rbx, rax); |
1004 // Move superklass into rax |
1004 // Move superklass into rax |
1005 __ load_klass(rax, rdx); |
1005 __ load_klass(rax, rdx); |
1006 __ movptr(rax, Address(rax, |
1006 __ movptr(rax, Address(rax, |
1007 sizeof(oopDesc) + |
1007 objArrayKlass::element_klass_offset())); |
1008 objArrayKlass::element_klass_offset_in_bytes())); |
|
1009 // Compress array + index*oopSize + 12 into a single register. Frees rcx. |
1008 // Compress array + index*oopSize + 12 into a single register. Frees rcx. |
1010 __ lea(rdx, element_address); |
1009 __ lea(rdx, element_address); |
1011 |
1010 |
1012 // Generate subtype check. Blows rcx, rdi |
1011 // Generate subtype check. Blows rcx, rdi |
1013 // Superklass in rax. Subklass in rbx. |
1012 // Superklass in rax. Subklass in rbx. |
2065 |
2064 |
2066 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { |
2065 if (_desc->bytecode() == Bytecodes::_return_register_finalizer) { |
2067 assert(state == vtos, "only valid state"); |
2066 assert(state == vtos, "only valid state"); |
2068 __ movptr(c_rarg1, aaddress(0)); |
2067 __ movptr(c_rarg1, aaddress(0)); |
2069 __ load_klass(rdi, c_rarg1); |
2068 __ load_klass(rdi, c_rarg1); |
2070 __ movl(rdi, Address(rdi, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc))); |
2069 __ movl(rdi, Address(rdi, Klass::access_flags_offset())); |
2071 __ testl(rdi, JVM_ACC_HAS_FINALIZER); |
2070 __ testl(rdi, JVM_ACC_HAS_FINALIZER); |
2072 Label skip_register_finalizer; |
2071 Label skip_register_finalizer; |
2073 __ jcc(Assembler::zero, skip_register_finalizer); |
2072 __ jcc(Assembler::zero, skip_register_finalizer); |
2074 |
2073 |
2075 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), c_rarg1); |
2074 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), c_rarg1); |
3234 Address::times_8, sizeof(constantPoolOopDesc))); |
3233 Address::times_8, sizeof(constantPoolOopDesc))); |
3235 |
3234 |
3236 // make sure klass is initialized & doesn't have finalizer |
3235 // make sure klass is initialized & doesn't have finalizer |
3237 // make sure klass is fully initialized |
3236 // make sure klass is fully initialized |
3238 __ cmpl(Address(rsi, |
3237 __ cmpl(Address(rsi, |
3239 instanceKlass::init_state_offset_in_bytes() + |
3238 instanceKlass::init_state_offset()), |
3240 sizeof(oopDesc)), |
|
3241 instanceKlass::fully_initialized); |
3239 instanceKlass::fully_initialized); |
3242 __ jcc(Assembler::notEqual, slow_case); |
3240 __ jcc(Assembler::notEqual, slow_case); |
3243 |
3241 |
3244 // get instance_size in instanceKlass (scaled to a count of bytes) |
3242 // get instance_size in instanceKlass (scaled to a count of bytes) |
3245 __ movl(rdx, |
3243 __ movl(rdx, |
3246 Address(rsi, |
3244 Address(rsi, |
3247 Klass::layout_helper_offset_in_bytes() + sizeof(oopDesc))); |
3245 Klass::layout_helper_offset())); |
3248 // test to see if it has a finalizer or is malformed in some way |
3246 // test to see if it has a finalizer or is malformed in some way |
3249 __ testl(rdx, Klass::_lh_instance_slow_path_bit); |
3247 __ testl(rdx, Klass::_lh_instance_slow_path_bit); |
3250 __ jcc(Assembler::notZero, slow_case); |
3248 __ jcc(Assembler::notZero, slow_case); |
3251 |
3249 |
3252 // Allocate the instance |
3250 // Allocate the instance |
3335 } |
3333 } |
3336 |
3334 |
3337 // initialize object header only. |
3335 // initialize object header only. |
3338 __ bind(initialize_header); |
3336 __ bind(initialize_header); |
3339 if (UseBiasedLocking) { |
3337 if (UseBiasedLocking) { |
3340 __ movptr(rscratch1, Address(rsi, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); |
3338 __ movptr(rscratch1, Address(rsi, Klass::prototype_header_offset())); |
3341 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), rscratch1); |
3339 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), rscratch1); |
3342 } else { |
3340 } else { |
3343 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), |
3341 __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), |
3344 (intptr_t) markOopDesc::prototype()); // header (address 0x1) |
3342 (intptr_t) markOopDesc::prototype()); // header (address 0x1) |
3345 } |
3343 } |