1556 } |
1556 } |
1557 |
1557 |
1558 void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) { |
1558 void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) { |
1559 if (op->init_check()) { |
1559 if (op->init_check()) { |
1560 __ cmpb(Address(op->klass()->as_register(), |
1560 __ cmpb(Address(op->klass()->as_register(), |
1561 instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)), |
1561 instanceKlass::init_state_offset()), |
1562 instanceKlass::fully_initialized); |
1562 instanceKlass::fully_initialized); |
1563 add_debug_info_for_null_check_here(op->stub()->info()); |
1563 add_debug_info_for_null_check_here(op->stub()->info()); |
1564 __ jcc(Assembler::notEqual, *op->stub()->entry()); |
1564 __ jcc(Assembler::notEqual, *op->stub()->entry()); |
1565 } |
1565 } |
1566 __ allocate_object(op->obj()->as_register(), |
1566 __ allocate_object(op->obj()->as_register(), |
1728 #ifdef _LP64 |
1728 #ifdef _LP64 |
1729 __ cmpptr(k_RInfo, Address(klass_RInfo, k->super_check_offset())); |
1729 __ cmpptr(k_RInfo, Address(klass_RInfo, k->super_check_offset())); |
1730 #else |
1730 #else |
1731 __ cmpoop(Address(klass_RInfo, k->super_check_offset()), k->constant_encoding()); |
1731 __ cmpoop(Address(klass_RInfo, k->super_check_offset()), k->constant_encoding()); |
1732 #endif // _LP64 |
1732 #endif // _LP64 |
1733 if (sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() != k->super_check_offset()) { |
1733 if ((juint)in_bytes(Klass::secondary_super_cache_offset()) != k->super_check_offset()) { |
1734 __ jcc(Assembler::notEqual, *failure_target); |
1734 __ jcc(Assembler::notEqual, *failure_target); |
1735 // successful cast, fall through to profile or jump |
1735 // successful cast, fall through to profile or jump |
1736 } else { |
1736 } else { |
1737 // See if we get an immediate positive hit |
1737 // See if we get an immediate positive hit |
1738 __ jcc(Assembler::equal, *success_target); |
1738 __ jcc(Assembler::equal, *success_target); |
1840 add_debug_info_for_null_check_here(op->info_for_exception()); |
1840 add_debug_info_for_null_check_here(op->info_for_exception()); |
1841 __ load_klass(k_RInfo, array); |
1841 __ load_klass(k_RInfo, array); |
1842 __ load_klass(klass_RInfo, value); |
1842 __ load_klass(klass_RInfo, value); |
1843 |
1843 |
1844 // get instance klass (it's already uncompressed) |
1844 // get instance klass (it's already uncompressed) |
1845 __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc))); |
1845 __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset())); |
1846 // perform the fast part of the checking logic |
1846 // perform the fast part of the checking logic |
1847 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL); |
1847 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL); |
1848 // call out-of-line instance of __ check_klass_subtype_slow_path(...): |
1848 // call out-of-line instance of __ check_klass_subtype_slow_path(...): |
1849 __ push(klass_RInfo); |
1849 __ push(klass_RInfo); |
1850 __ push(k_RInfo); |
1850 __ push(k_RInfo); |
3287 if (!(flags & LIR_OpArrayCopy::src_objarray)) { |
3287 if (!(flags & LIR_OpArrayCopy::src_objarray)) { |
3288 __ load_klass(tmp, src); |
3288 __ load_klass(tmp, src); |
3289 } else if (!(flags & LIR_OpArrayCopy::dst_objarray)) { |
3289 } else if (!(flags & LIR_OpArrayCopy::dst_objarray)) { |
3290 __ load_klass(tmp, dst); |
3290 __ load_klass(tmp, dst); |
3291 } |
3291 } |
3292 int lh_offset = klassOopDesc::header_size() * HeapWordSize + |
3292 int lh_offset = in_bytes(Klass::layout_helper_offset()); |
3293 Klass::layout_helper_offset_in_bytes(); |
|
3294 Address klass_lh_addr(tmp, lh_offset); |
3293 Address klass_lh_addr(tmp, lh_offset); |
3295 jint objArray_lh = Klass::array_layout_helper(T_OBJECT); |
3294 jint objArray_lh = Klass::array_layout_helper(T_OBJECT); |
3296 __ cmpl(klass_lh_addr, objArray_lh); |
3295 __ cmpl(klass_lh_addr, objArray_lh); |
3297 __ jcc(Assembler::notEqual, *stub->entry()); |
3296 __ jcc(Assembler::notEqual, *stub->entry()); |
3298 } |
3297 } |
3305 store_parameter(src_pos, 3); |
3304 store_parameter(src_pos, 3); |
3306 store_parameter(src, 4); |
3305 store_parameter(src, 4); |
3307 |
3306 |
3308 #ifndef _LP64 |
3307 #ifndef _LP64 |
3309 __ movptr(tmp, dst_klass_addr); |
3308 __ movptr(tmp, dst_klass_addr); |
3310 __ movptr(tmp, Address(tmp, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc))); |
3309 __ movptr(tmp, Address(tmp, objArrayKlass::element_klass_offset())); |
3311 __ push(tmp); |
3310 __ push(tmp); |
3312 __ movl(tmp, Address(tmp, Klass::super_check_offset_offset_in_bytes() + sizeof(oopDesc))); |
3311 __ movl(tmp, Address(tmp, Klass::super_check_offset_offset())); |
3313 __ push(tmp); |
3312 __ push(tmp); |
3314 __ push(length); |
3313 __ push(length); |
3315 __ lea(tmp, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3314 __ lea(tmp, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3316 __ push(tmp); |
3315 __ push(tmp); |
3317 __ lea(tmp, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3316 __ lea(tmp, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); |
3331 |
3330 |
3332 #ifdef _WIN64 |
3331 #ifdef _WIN64 |
3333 // Allocate abi space for args but be sure to keep stack aligned |
3332 // Allocate abi space for args but be sure to keep stack aligned |
3334 __ subptr(rsp, 6*wordSize); |
3333 __ subptr(rsp, 6*wordSize); |
3335 __ load_klass(c_rarg3, dst); |
3334 __ load_klass(c_rarg3, dst); |
3336 __ movptr(c_rarg3, Address(c_rarg3, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc))); |
3335 __ movptr(c_rarg3, Address(c_rarg3, objArrayKlass::element_klass_offset())); |
3337 store_parameter(c_rarg3, 4); |
3336 store_parameter(c_rarg3, 4); |
3338 __ movl(c_rarg3, Address(c_rarg3, Klass::super_check_offset_offset_in_bytes() + sizeof(oopDesc))); |
3337 __ movl(c_rarg3, Address(c_rarg3, Klass::super_check_offset_offset())); |
3339 __ call(RuntimeAddress(copyfunc_addr)); |
3338 __ call(RuntimeAddress(copyfunc_addr)); |
3340 __ addptr(rsp, 6*wordSize); |
3339 __ addptr(rsp, 6*wordSize); |
3341 #else |
3340 #else |
3342 __ load_klass(c_rarg4, dst); |
3341 __ load_klass(c_rarg4, dst); |
3343 __ movptr(c_rarg4, Address(c_rarg4, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc))); |
3342 __ movptr(c_rarg4, Address(c_rarg4, objArrayKlass::element_klass_offset())); |
3344 __ movl(c_rarg3, Address(c_rarg4, Klass::super_check_offset_offset_in_bytes() + sizeof(oopDesc))); |
3343 __ movl(c_rarg3, Address(c_rarg4, Klass::super_check_offset_offset())); |
3345 __ call(RuntimeAddress(copyfunc_addr)); |
3344 __ call(RuntimeAddress(copyfunc_addr)); |
3346 #endif |
3345 #endif |
3347 |
3346 |
3348 #endif |
3347 #endif |
3349 |
3348 |