1 /* |
1 /* |
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2011, 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. |
1194 static ParallelCompactData& summary_data() { return _summary_data; } |
1194 static ParallelCompactData& summary_data() { return _summary_data; } |
1195 |
1195 |
1196 static inline void adjust_pointer(oop* p) { adjust_pointer(p, false); } |
1196 static inline void adjust_pointer(oop* p) { adjust_pointer(p, false); } |
1197 static inline void adjust_pointer(narrowOop* p) { adjust_pointer(p, false); } |
1197 static inline void adjust_pointer(narrowOop* p) { adjust_pointer(p, false); } |
1198 |
1198 |
1199 template <class T> |
|
1200 static inline void adjust_pointer(T* p, |
|
1201 HeapWord* beg_addr, |
|
1202 HeapWord* end_addr); |
|
1203 |
|
1204 // Reference Processing |
1199 // Reference Processing |
1205 static ReferenceProcessor* const ref_processor() { return _ref_processor; } |
1200 static ReferenceProcessor* const ref_processor() { return _ref_processor; } |
1206 |
1201 |
1207 // Return the SpaceId for the given address. |
1202 // Return the SpaceId for the given address. |
1208 static SpaceId space_id(HeapWord* addr); |
1203 static SpaceId space_id(HeapWord* addr); |
1406 |
1401 |
1407 inline bool PSParallelCompact::should_update_klass(klassOop k) { |
1402 inline bool PSParallelCompact::should_update_klass(klassOop k) { |
1408 return ((HeapWord*) k) >= dense_prefix(perm_space_id); |
1403 return ((HeapWord*) k) >= dense_prefix(perm_space_id); |
1409 } |
1404 } |
1410 |
1405 |
1411 template <class T> |
|
1412 inline void PSParallelCompact::adjust_pointer(T* p, |
|
1413 HeapWord* beg_addr, |
|
1414 HeapWord* end_addr) { |
|
1415 if (is_in((HeapWord*)p, beg_addr, end_addr)) { |
|
1416 adjust_pointer(p); |
|
1417 } |
|
1418 } |
|
1419 |
|
1420 #ifdef ASSERT |
1406 #ifdef ASSERT |
1421 inline void |
1407 inline void |
1422 PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr) |
1408 PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr) |
1423 { |
1409 { |
1424 assert(old_addr >= new_addr || space_id(old_addr) != space_id(new_addr), |
1410 assert(old_addr >= new_addr || space_id(old_addr) != space_id(new_addr), |