size = VM_Memory.alignUp(size, BYTES_IN_ADDRESS); int rawSize = (align != BYTES_IN_ADDRESS) ? (size + align) : size;
alignedSize = VM_Memory.alignUp(size, BYTES_IN_ADDRESS); int rawSize = (align != BYTES_IN_ADDRESS) ? (alignedSize + align) : alignedSize;
  public static Object allocateScalar(int size, Object [] tib, int allocator,                                      int align, int offset)    throws VM_PragmaUninterruptible, VM_PragmaInline {    Plan plan = VM_Interface.getPlan();    // JMTk requires sizes to be multiples of BYTES_IN_ADDRESS.    // Jikes RVM currently forces scalars to be multiples of    // BYTES_IN_INT. So in 64 bit mode have to do something extra here.    if (BYTES_IN_ADDRESS != BYTES_IN_INT)      size = VM_Memory.alignUp(size, BYTES_IN_ADDRESS);    int rawSize = (align != BYTES_IN_ADDRESS) ? (size + align) : size;    AllocAdvice advice = plan.getAllocAdvice(null, rawSize, null, null);    VM_Address region = plan.alloc(rawSize, true, allocator, advice);    if (CHECK_MEMORY_IS_ZEROED) Memory.assertIsZeroed(region, rawSize);    if (align != BYTES_IN_ADDRESS) {      // This code is based on some fancy modulo artihmetic.      // It ensures the property (region + offset) % alignment == 0      VM_Word mask  = VM_Word.fromIntSignExtend(align-1);      VM_Word negOff= VM_Word.fromIntSignExtend(-offset);      VM_Offset delta = negOff.sub(region.toWord()).and(mask).toOffset();      region = region.add(delta);    }    Object result = VM_ObjectModel.initializeScalar(region, tib, size);    plan.postAlloc(VM_Magic.objectAsAddress(result), tib, rawSize, true,                   allocator);    return result;  }