equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2010, 2017, 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. |
41 // The next pointer is a compressed oop stored in the top 32 bits |
41 // The next pointer is a compressed oop stored in the top 32 bits |
42 res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next); |
42 res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next); |
43 } else { |
43 } else { |
44 res = (PromotedObject*)(_next & next_mask); |
44 res = (PromotedObject*)(_next & next_mask); |
45 } |
45 } |
46 assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res))); |
46 assert(oopDesc::is_oop_or_null(oop(res), true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res))); |
47 return res; |
47 return res; |
48 } |
48 } |
49 |
49 |
50 inline void PromotedObject::setNext(PromotedObject* x) { |
50 inline void PromotedObject::setNext(PromotedObject* x) { |
51 assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, " |
51 assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, " |
297 // count the number of objects with displaced headers |
297 // count the number of objects with displaced headers |
298 size_t numObjsWithDisplacedHdrs = 0; |
298 size_t numObjsWithDisplacedHdrs = 0; |
299 for (PromotedObject* curObj = _promoHead; curObj != NULL; curObj = curObj->next()) { |
299 for (PromotedObject* curObj = _promoHead; curObj != NULL; curObj = curObj->next()) { |
300 guarantee(space()->is_in_reserved((HeapWord*)curObj), "Containment"); |
300 guarantee(space()->is_in_reserved((HeapWord*)curObj), "Containment"); |
301 // the last promoted object may fail the mark() != NULL test of is_oop(). |
301 // the last promoted object may fail the mark() != NULL test of is_oop(). |
302 guarantee(curObj->next() == NULL || oop(curObj)->is_oop(), "must be an oop"); |
302 guarantee(curObj->next() == NULL || oopDesc::is_oop(oop(curObj)), "must be an oop"); |
303 if (curObj->hasDisplacedMark()) { |
303 if (curObj->hasDisplacedMark()) { |
304 numObjsWithDisplacedHdrs++; |
304 numObjsWithDisplacedHdrs++; |
305 } |
305 } |
306 } |
306 } |
307 // Count the number of displaced headers |
307 // Count the number of displaced headers |