168 AllocFailStrategy::RETURN_NULL); |
168 AllocFailStrategy::RETURN_NULL); |
169 void* aligned_addr = (void*) align_size_up((intptr_t) real_malloc_addr, alignment); |
169 void* aligned_addr = (void*) align_size_up((intptr_t) real_malloc_addr, alignment); |
170 assert(((uintptr_t) aligned_addr + (uintptr_t) size) <= |
170 assert(((uintptr_t) aligned_addr + (uintptr_t) size) <= |
171 ((uintptr_t) real_malloc_addr + (uintptr_t) aligned_size), |
171 ((uintptr_t) real_malloc_addr + (uintptr_t) aligned_size), |
172 "JavaThread alignment code overflowed allocated storage"); |
172 "JavaThread alignment code overflowed allocated storage"); |
173 if (TraceBiasedLocking) { |
173 if (aligned_addr != real_malloc_addr) { |
174 if (aligned_addr != real_malloc_addr) { |
174 log_info(biasedlocking)("Aligned thread " INTPTR_FORMAT " to " INTPTR_FORMAT, |
175 tty->print_cr("Aligned thread " INTPTR_FORMAT " to " INTPTR_FORMAT, |
175 p2i(real_malloc_addr), |
176 p2i(real_malloc_addr), p2i(aligned_addr)); |
176 p2i(aligned_addr)); |
177 } |
|
178 } |
177 } |
179 ((Thread*) aligned_addr)->_real_malloc_address = real_malloc_addr; |
178 ((Thread*) aligned_addr)->_real_malloc_address = real_malloc_addr; |
180 return aligned_addr; |
179 return aligned_addr; |
181 } else { |
180 } else { |
182 return throw_excpt? AllocateHeap(size, flags, CURRENT_PC) |
181 return throw_excpt? AllocateHeap(size, flags, CURRENT_PC) |