< prev index next >

src/hotspot/cpu/x86/c1_Runtime1_x86.cpp

Print this page


1167           __ initialize_header(obj, klass, length, t1, t2);
1168           __ movb(t1, Address(klass, in_bytes(Klass::layout_helper_offset()) + (Klass::_lh_header_size_shift / BitsPerByte)));
1169           assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise");
1170           assert(Klass::_lh_header_size_mask <= 0xFF, "bytewise");
1171           __ andptr(t1, Klass::_lh_header_size_mask);
1172           __ subptr(arr_size, t1);  // body length
1173           __ addptr(t1, obj);       // body start
1174           __ initialize_body(t1, arr_size, 0, t2);
1175           __ verify_oop(obj);
1176           __ ret(0);
1177 
1178           __ bind(slow_path);
1179         }
1180 
1181         __ enter();
1182         OopMap* map = save_live_registers(sasm, 3);
1183         int call_offset;
1184         if (id == new_type_array_id) {
1185           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
1186         } else {
1187           // Runtime1::new_object_array handles both object and value arrays

1188           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
1189         }
1190 
1191         oop_maps = new OopMapSet();
1192         oop_maps->add_gc_map(call_offset, map);
1193         restore_live_registers_except_rax(sasm);
1194 
1195         __ verify_oop(obj);
1196         __ leave();
1197         __ ret(0);
1198 
1199         // rax,: new array
1200       }
1201       break;
1202 
1203     case new_multi_array_id:
1204       { StubFrame f(sasm, "new_multi_array", dont_gc_arguments);
1205         // rax,: klass
1206         // rbx,: rank
1207         // rcx: address of 1st dimension
1208         OopMap* map = save_live_registers(sasm, 4);
1209         int call_offset = __ call_RT(rax, noreg, CAST_FROM_FN_PTR(address, new_multi_array), rax, rbx, rcx);
1210 
1211         oop_maps = new OopMapSet();
1212         oop_maps->add_gc_map(call_offset, map);
1213         restore_live_registers_except_rax(sasm);
1214 
1215         // rax,: new multi array




















1216         __ verify_oop(rax);
1217       }
1218       break;
1219 
1220     case register_finalizer_id:
1221       {
1222         __ set_info("register_finalizer", dont_gc_arguments);
1223 
1224         // This is called via call_runtime so the arguments
1225         // will be place in C abi locations
1226 
1227 #ifdef _LP64
1228         __ verify_oop(c_rarg0);
1229         __ mov(rax, c_rarg0);
1230 #else
1231         // The object is passed on the stack and we haven't pushed a
1232         // frame yet so it's one work away from top of stack.
1233         __ movptr(rax, Address(rsp, 1 * BytesPerWord));
1234         __ verify_oop(rax);
1235 #endif // _LP64




1167           __ initialize_header(obj, klass, length, t1, t2);
1168           __ movb(t1, Address(klass, in_bytes(Klass::layout_helper_offset()) + (Klass::_lh_header_size_shift / BitsPerByte)));
1169           assert(Klass::_lh_header_size_shift % BitsPerByte == 0, "bytewise");
1170           assert(Klass::_lh_header_size_mask <= 0xFF, "bytewise");
1171           __ andptr(t1, Klass::_lh_header_size_mask);
1172           __ subptr(arr_size, t1);  // body length
1173           __ addptr(t1, obj);       // body start
1174           __ initialize_body(t1, arr_size, 0, t2);
1175           __ verify_oop(obj);
1176           __ ret(0);
1177 
1178           __ bind(slow_path);
1179         }
1180 
1181         __ enter();
1182         OopMap* map = save_live_registers(sasm, 3);
1183         int call_offset;
1184         if (id == new_type_array_id) {
1185           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_type_array), klass, length);
1186         } else {
1187           // Runtime1::new_object_array handles both object and value arrays.
1188           // new_value_array_id is needed only for the ASSERT block above.
1189           call_offset = __ call_RT(obj, noreg, CAST_FROM_FN_PTR(address, new_object_array), klass, length);
1190         }
1191 
1192         oop_maps = new OopMapSet();
1193         oop_maps->add_gc_map(call_offset, map);
1194         restore_live_registers_except_rax(sasm);
1195 
1196         __ verify_oop(obj);
1197         __ leave();
1198         __ ret(0);
1199 
1200         // rax,: new array
1201       }
1202       break;
1203 
1204     case new_multi_array_id:
1205       { StubFrame f(sasm, "new_multi_array", dont_gc_arguments);
1206         // rax,: klass
1207         // rbx,: rank
1208         // rcx: address of 1st dimension
1209         OopMap* map = save_live_registers(sasm, 4);
1210         int call_offset = __ call_RT(rax, noreg, CAST_FROM_FN_PTR(address, new_multi_array), rax, rbx, rcx);
1211 
1212         oop_maps = new OopMapSet();
1213         oop_maps->add_gc_map(call_offset, map);
1214         restore_live_registers_except_rax(sasm);
1215 
1216         // rax,: new multi array
1217         __ verify_oop(rax);
1218       }
1219       break;
1220 
1221     case load_flattened_array_id:
1222       {
1223         StubFrame f(sasm, "load_flattened_array", dont_gc_arguments);
1224         OopMap* map = save_live_registers(sasm, 3);
1225 
1226         // Called with store_parameter and not C abi
1227 
1228         f.load_argument(1, rax); // rax,: array
1229         f.load_argument(0, rbx); // rbx,: index
1230         int call_offset = __ call_RT(rax, noreg, CAST_FROM_FN_PTR(address, load_flattened_array), rax, rbx);
1231 
1232         oop_maps = new OopMapSet();
1233         oop_maps->add_gc_map(call_offset, map);
1234         restore_live_registers_except_rax(sasm);
1235 
1236         // rax,: loaded element at array[index]
1237         __ verify_oop(rax);
1238       }
1239       break;
1240 
1241     case register_finalizer_id:
1242       {
1243         __ set_info("register_finalizer", dont_gc_arguments);
1244 
1245         // This is called via call_runtime so the arguments
1246         // will be place in C abi locations
1247 
1248 #ifdef _LP64
1249         __ verify_oop(c_rarg0);
1250         __ mov(rax, c_rarg0);
1251 #else
1252         // The object is passed on the stack and we haven't pushed a
1253         // frame yet so it's one work away from top of stack.
1254         __ movptr(rax, Address(rsp, 1 * BytesPerWord));
1255         __ verify_oop(rax);
1256 #endif // _LP64


< prev index next >