422 if (addr >= csp()->top()) return csp()->top(); |
422 if (addr >= csp()->top()) return csp()->top(); |
423 while (next_boundary < addr) { |
423 while (next_boundary < addr) { |
424 while (n <= next_boundary) { |
424 while (n <= next_boundary) { |
425 q = n; |
425 q = n; |
426 oop obj = oop(q); |
426 oop obj = oop(q); |
427 if (obj->klass() == NULL) return q; |
427 if (obj->klass_or_null() == NULL) return q; |
428 n += obj->size(); |
428 n += obj->size(); |
429 } |
429 } |
430 assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); |
430 assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); |
431 // [q, n) is the block that crosses the boundary. |
431 // [q, n) is the block that crosses the boundary. |
432 alloc_block_work2(&next_boundary, &next_index, q, n); |
432 alloc_block_work2(&next_boundary, &next_index, q, n); |
434 } else { |
434 } else { |
435 while (next_boundary < addr) { |
435 while (next_boundary < addr) { |
436 while (n <= next_boundary) { |
436 while (n <= next_boundary) { |
437 q = n; |
437 q = n; |
438 oop obj = oop(q); |
438 oop obj = oop(q); |
439 if (obj->klass() == NULL) return q; |
439 if (obj->klass_or_null() == NULL) return q; |
440 n += _sp->block_size(q); |
440 n += _sp->block_size(q); |
441 } |
441 } |
442 assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); |
442 assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); |
443 // [q, n) is the block that crosses the boundary. |
443 // [q, n) is the block that crosses the boundary. |
444 alloc_block_work2(&next_boundary, &next_index, q, n); |
444 alloc_block_work2(&next_boundary, &next_index, q, n); |