1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 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. |
50 _was_full = false; |
50 _was_full = false; |
51 } |
51 } |
52 |
52 |
53 |
53 |
54 void CodeHeap::mark_segmap_as_free(size_t beg, size_t end) { |
54 void CodeHeap::mark_segmap_as_free(size_t beg, size_t end) { |
55 assert(0 <= beg && beg < _number_of_committed_segments, "interval begin out of bounds"); |
55 assert( beg < _number_of_committed_segments, "interval begin out of bounds"); |
56 assert(beg < end && end <= _number_of_committed_segments, "interval end out of bounds"); |
56 assert(beg < end && end <= _number_of_committed_segments, "interval end out of bounds"); |
57 // setup _segmap pointers for faster indexing |
57 // setup _segmap pointers for faster indexing |
58 address p = (address)_segmap.low() + beg; |
58 address p = (address)_segmap.low() + beg; |
59 address q = (address)_segmap.low() + end; |
59 address q = (address)_segmap.low() + end; |
60 // initialize interval |
60 // initialize interval |
61 while (p < q) *p++ = free_sentinel; |
61 while (p < q) *p++ = free_sentinel; |
62 } |
62 } |
63 |
63 |
64 |
64 |
65 void CodeHeap::mark_segmap_as_used(size_t beg, size_t end) { |
65 void CodeHeap::mark_segmap_as_used(size_t beg, size_t end) { |
66 assert(0 <= beg && beg < _number_of_committed_segments, "interval begin out of bounds"); |
66 assert( beg < _number_of_committed_segments, "interval begin out of bounds"); |
67 assert(beg < end && end <= _number_of_committed_segments, "interval end out of bounds"); |
67 assert(beg < end && end <= _number_of_committed_segments, "interval end out of bounds"); |
68 // setup _segmap pointers for faster indexing |
68 // setup _segmap pointers for faster indexing |
69 address p = (address)_segmap.low() + beg; |
69 address p = (address)_segmap.low() + beg; |
70 address q = (address)_segmap.low() + end; |
70 address q = (address)_segmap.low() + end; |
71 // initialize interval |
71 // initialize interval |