Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/collectorPolicy.cpp @ 22936:fb69749583e8
8072621: Clean up around VM_GC_Operations
Reviewed-by: brutisso, jmasa
author | mlarsson |
---|---|
date | Thu, 09 Apr 2015 15:58:49 +0200 |
parents | d63ce76a0f0e |
children | dd9cc155639c |
comparison
equal
deleted
inserted
replaced
22935:bff23dedb306 | 22936:fb69749583e8 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
654 | 654 |
655 HeapWord* result = NULL; | 655 HeapWord* result = NULL; |
656 | 656 |
657 // Loop until the allocation is satisified, | 657 // Loop until the allocation is satisified, |
658 // or unsatisfied after GC. | 658 // or unsatisfied after GC. |
659 for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) { | 659 for (uint try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) { |
660 HandleMark hm; // discard any handles allocated in each iteration | 660 HandleMark hm; // discard any handles allocated in each iteration |
661 | 661 |
662 // First allocation attempt is lock-free. | 662 // First allocation attempt is lock-free. |
663 Generation *gen0 = gch->get_gen(0); | 663 Generation *gen0 = gch->get_gen(0); |
664 assert(gen0->supports_inline_contig_alloc(), | 664 assert(gen0->supports_inline_contig_alloc(), |
668 if (result != NULL) { | 668 if (result != NULL) { |
669 assert(gch->is_in_reserved(result), "result not in heap"); | 669 assert(gch->is_in_reserved(result), "result not in heap"); |
670 return result; | 670 return result; |
671 } | 671 } |
672 } | 672 } |
673 unsigned int gc_count_before; // read inside the Heap_lock locked region | 673 uint gc_count_before; // read inside the Heap_lock locked region |
674 { | 674 { |
675 MutexLocker ml(Heap_lock); | 675 MutexLocker ml(Heap_lock); |
676 if (PrintGC && Verbose) { | 676 if (PrintGC && Verbose) { |
677 gclog_or_tty->print_cr("TwoGenerationCollectorPolicy::mem_allocate_work:" | 677 gclog_or_tty->print_cr("TwoGenerationCollectorPolicy::mem_allocate_work:" |
678 " attempting locked slow path allocation"); | 678 " attempting locked slow path allocation"); |