< prev index next >

src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp

Print this page
@@ -294,11 +294,11 @@
  void C1_MacroAssembler::allocate_array(
    Register obj,                        // result: Pointer to array after successful allocation.
    Register len,                        // array length
    Register t1,                         // temp register
    Register t2,                         // temp register
-   int      hdr_size,                   // object header size in words
+   int      base_offset_in_bytes,       // elements offset in bytes
    int      elt_size,                   // element size in bytes
    Register klass,                      // object klass
    Label&   slow_case                   // Continuation point if fast allocation fails.
  ) {
    assert_different_registers(obj, len, t1, t2, klass);

@@ -320,24 +320,24 @@
      case  2: z_sllg(arr_size, len, 1); break;
      case  4: z_sllg(arr_size, len, 2); break;
      case  8: z_sllg(arr_size, len, 3); break;
      default: ShouldNotReachHere();
    }
-   add2reg(arr_size, hdr_size * wordSize + MinObjAlignmentInBytesMask); // Add space for header & alignment.
-   z_nill(arr_size, (~MinObjAlignmentInBytesMask) & 0xffff);            // Align array size.
+   add2reg(arr_size, base_offset_in_bytes + MinObjAlignmentInBytesMask); // Add space for header & alignment.
+   z_nill(arr_size, (~MinObjAlignmentInBytesMask) & 0xffff);             // Align array size.
  
    try_allocate(obj, arr_size, 0, t1, slow_case);
  
    initialize_header(obj, klass, len, noreg, t1);
  
    // Clear rest of allocated space.
    Label done;
    Register object_fields = t1;
    Register Rzero = Z_R1_scratch;
-   z_aghi(arr_size, -(hdr_size * BytesPerWord));
+   z_aghi(arr_size, -base_offset_in_bytes);
    z_bre(done); // Jump if size of fields is zero.
-   z_la(object_fields, hdr_size * BytesPerWord, obj);
+   z_la(object_fields, base_offset_in_bytes, obj);
    z_xgr(Rzero, Rzero);
    initialize_body(object_fields, arr_size, Rzero);
    bind(done);
  
    // Dtrace support is unimplemented.
< prev index next >