< prev index next >

src/hotspot/cpu/x86/c1_Runtime1_x86.cpp

Print this page




1106       {
1107         Register length   = rbx; // Incoming
1108         Register klass    = rdx; // Incoming
1109         Register obj      = rax; // Result
1110 
1111         if (id == new_type_array_id) {
1112           __ set_info("new_type_array", dont_gc_arguments);
1113         } else {
1114           __ set_info("new_object_array", dont_gc_arguments);
1115         }
1116 
1117 #ifdef ASSERT
1118         // assert object type is really an array of the proper kind
1119         {
1120           Label ok;
1121           Register t0 = obj;
1122           __ movl(t0, Address(klass, Klass::layout_helper_offset()));
1123           __ sarl(t0, Klass::_lh_array_tag_shift);
1124           int tag = ((id == new_type_array_id)
1125                      ? Klass::_lh_array_tag_type_value
1126                      : Klass::_lh_array_tag_obj_value);
1127           __ cmpl(t0, tag);
1128           __ jcc(Assembler::equal, ok);
1129           __ stop("assert(is an array klass)");
1130           __ should_not_reach_here();
1131           __ bind(ok);
1132         }
1133 #endif // ASSERT
1134 
1135         // If TLAB is disabled, see if there is support for inlining contiguous
1136         // allocations.
1137         // Otherwise, just go to the slow path.
1138         if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
1139           Register arr_size = rsi;
1140           Register t1       = rcx;  // must be rcx for use as shift count
1141           Register t2       = rdi;
1142           Label slow_path;
1143 
1144           // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F))
1145           // since size is positive movl does right thing on 64bit
1146           __ movl(t1, Address(klass, Klass::layout_helper_offset()));




1106       {
1107         Register length   = rbx; // Incoming
1108         Register klass    = rdx; // Incoming
1109         Register obj      = rax; // Result
1110 
1111         if (id == new_type_array_id) {
1112           __ set_info("new_type_array", dont_gc_arguments);
1113         } else {
1114           __ set_info("new_object_array", dont_gc_arguments);
1115         }
1116 
1117 #ifdef ASSERT
1118         // assert object type is really an array of the proper kind
1119         {
1120           Label ok;
1121           Register t0 = obj;
1122           __ movl(t0, Address(klass, Klass::layout_helper_offset()));
1123           __ sarl(t0, Klass::_lh_array_tag_shift);
1124           int tag = ((id == new_type_array_id)
1125                      ? Klass::_lh_array_tag_type_value
1126                      : (int) Klass::_lh_array_tag_obj_value);
1127           __ cmpl(t0, tag);
1128           __ jcc(Assembler::equal, ok);
1129           __ stop("assert(is an array klass)");
1130           __ should_not_reach_here();
1131           __ bind(ok);
1132         }
1133 #endif // ASSERT
1134 
1135         // If TLAB is disabled, see if there is support for inlining contiguous
1136         // allocations.
1137         // Otherwise, just go to the slow path.
1138         if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) {
1139           Register arr_size = rsi;
1140           Register t1       = rcx;  // must be rcx for use as shift count
1141           Register t2       = rdi;
1142           Label slow_path;
1143 
1144           // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F))
1145           // since size is positive movl does right thing on 64bit
1146           __ movl(t1, Address(klass, Klass::layout_helper_offset()));


< prev index next >