Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | e5d78f318aec |
children | 89152779163c |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. | 3 * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * | 5 * |
6 * This code is free software; you can redistribute it and/or modify it | 6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as | 7 * under the terms of the GNU General Public License version 2 only, as |
8 * published by the Free Software Foundation. | 8 * published by the Free Software Foundation. |
70 // This method should do nothing. | 70 // This method should do nothing. |
71 } | 71 } |
72 #endif // NOT_PRODUCT | 72 #endif // NOT_PRODUCT |
73 | 73 |
74 // There may be unallocated holes in the middle chunks | 74 // There may be unallocated holes in the middle chunks |
75 // that should be filled with dead objects to ensure parsability. | 75 // that should be filled with dead objects to ensure parseability. |
76 void MutableNUMASpace::ensure_parsability() { | 76 void MutableNUMASpace::ensure_parsability() { |
77 for (int i = 0; i < lgrp_spaces()->length(); i++) { | 77 for (int i = 0; i < lgrp_spaces()->length(); i++) { |
78 LGRPSpace *ls = lgrp_spaces()->at(i); | 78 LGRPSpace *ls = lgrp_spaces()->at(i); |
79 MutableSpace *s = ls->space(); | 79 MutableSpace *s = ls->space(); |
80 if (s->top() < top()) { // For all spaces preceding the one containing top() | 80 if (s->top() < top()) { // For all spaces preceding the one containing top() |
170 if (i == -1) { | 170 if (i == -1) { |
171 return 0; | 171 return 0; |
172 } | 172 } |
173 return lgrp_spaces()->at(i)->space()->capacity_in_bytes(); | 173 return lgrp_spaces()->at(i)->space()->capacity_in_bytes(); |
174 } | 174 } |
175 | |
176 size_t MutableNUMASpace::tlab_used(Thread *thr) const { | |
177 // Please see the comments for tlab_capacity(). | |
178 guarantee(thr != NULL, "No thread"); | |
179 int lgrp_id = thr->lgrp_id(); | |
180 if (lgrp_id == -1) { | |
181 if (lgrp_spaces()->length() > 0) { | |
182 return (used_in_bytes()) / lgrp_spaces()->length(); | |
183 } else { | |
184 assert(false, "There should be at least one locality group"); | |
185 return 0; | |
186 } | |
187 } | |
188 int i = lgrp_spaces()->find(&lgrp_id, LGRPSpace::equals); | |
189 if (i == -1) { | |
190 return 0; | |
191 } | |
192 return lgrp_spaces()->at(i)->space()->used_in_bytes(); | |
193 } | |
194 | |
195 | 175 |
196 size_t MutableNUMASpace::unsafe_max_tlab_alloc(Thread *thr) const { | 176 size_t MutableNUMASpace::unsafe_max_tlab_alloc(Thread *thr) const { |
197 // Please see the comments for tlab_capacity(). | 177 // Please see the comments for tlab_capacity(). |
198 guarantee(thr != NULL, "No thread"); | 178 guarantee(thr != NULL, "No thread"); |
199 int lgrp_id = thr->lgrp_id(); | 179 int lgrp_id = thr->lgrp_id(); |
557 | 537 |
558 void MutableNUMASpace::initialize(MemRegion mr, | 538 void MutableNUMASpace::initialize(MemRegion mr, |
559 bool clear_space, | 539 bool clear_space, |
560 bool mangle_space, | 540 bool mangle_space, |
561 bool setup_pages) { | 541 bool setup_pages) { |
562 assert(clear_space, "Reallocation will destroy data!"); | 542 assert(clear_space, "Reallocation will destory data!"); |
563 assert(lgrp_spaces()->length() > 0, "There should be at least one space"); | 543 assert(lgrp_spaces()->length() > 0, "There should be at least one space"); |
564 | 544 |
565 MemRegion old_region = region(), new_region; | 545 MemRegion old_region = region(), new_region; |
566 set_bottom(mr.start()); | 546 set_bottom(mr.start()); |
567 set_end(mr.end()); | 547 set_end(mr.end()); |
898 } | 878 } |
899 } | 879 } |
900 } | 880 } |
901 | 881 |
902 void MutableNUMASpace::verify() { | 882 void MutableNUMASpace::verify() { |
903 // This can be called after setting an arbitrary value to the space's top, | 883 // This can be called after setting an arbitary value to the space's top, |
904 // so an object can cross the chunk boundary. We ensure the parsability | 884 // so an object can cross the chunk boundary. We ensure the parsablity |
905 // of the space and just walk the objects in linear fashion. | 885 // of the space and just walk the objects in linear fashion. |
906 ensure_parsability(); | 886 ensure_parsability(); |
907 MutableSpace::verify(); | 887 MutableSpace::verify(); |
908 } | 888 } |
909 | 889 |