Mercurial > hg > truffle
comparison src/share/vm/oops/markOop.hpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d1603768966 |
children | 22b8d3d181d9 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2012, 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. |
259 inline bool must_be_preserved_with_bias_for_promotion_failure(oop obj_containing_mark) const; | 259 inline bool must_be_preserved_with_bias_for_promotion_failure(oop obj_containing_mark) const; |
260 | 260 |
261 // Should this header be preserved during a scavenge where CMS is | 261 // Should this header be preserved during a scavenge where CMS is |
262 // the old generation? | 262 // the old generation? |
263 // (This is basically the same body as must_be_preserved_for_promotion_failure(), | 263 // (This is basically the same body as must_be_preserved_for_promotion_failure(), |
264 // but takes the klassOop as argument instead) | 264 // but takes the Klass* as argument instead) |
265 inline bool must_be_preserved_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const; | 265 inline bool must_be_preserved_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const; |
266 inline bool must_be_preserved_with_bias_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const; | 266 inline bool must_be_preserved_with_bias_for_cms_scavenge(Klass* klass_of_obj_containing_mark) const; |
267 | 267 |
268 // WARNING: The following routines are used EXCLUSIVELY by | 268 // WARNING: The following routines are used EXCLUSIVELY by |
269 // synchronization functions. They are not really gc safe. | 269 // synchronization functions. They are not really gc safe. |
270 // They must get updated if markOop layout get changed. | 270 // They must get updated if markOop layout get changed. |
271 markOop set_unlocked() const { | 271 markOop set_unlocked() const { |
329 // used to encode pointers during GC | 329 // used to encode pointers during GC |
330 markOop clear_lock_bits() { return markOop(value() & ~lock_mask_in_place); } | 330 markOop clear_lock_bits() { return markOop(value() & ~lock_mask_in_place); } |
331 | 331 |
332 // age operations | 332 // age operations |
333 markOop set_marked() { return markOop((value() & ~lock_mask_in_place) | marked_value); } | 333 markOop set_marked() { return markOop((value() & ~lock_mask_in_place) | marked_value); } |
334 markOop set_unmarked() { return markOop((value() & ~lock_mask_in_place) | unlocked_value); } | |
334 | 335 |
335 int age() const { return mask_bits(value() >> age_shift, age_mask); } | 336 int age() const { return mask_bits(value() >> age_shift, age_mask); } |
336 markOop set_age(int v) const { | 337 markOop set_age(int v) const { |
337 assert((v & ~age_mask) == 0, "shouldn't overflow age field"); | 338 assert((v & ~age_mask) == 0, "shouldn't overflow age field"); |
338 return markOop((value() & ~age_mask_in_place) | (((intptr_t)v & age_mask) << age_shift)); | 339 return markOop((value() & ~age_mask_in_place) | (((intptr_t)v & age_mask) << age_shift)); |
362 // Prepare address of oop for placement into mark | 363 // Prepare address of oop for placement into mark |
363 inline static markOop encode_pointer_as_mark(void* p) { return markOop(p)->set_marked(); } | 364 inline static markOop encode_pointer_as_mark(void* p) { return markOop(p)->set_marked(); } |
364 | 365 |
365 // Recover address of oop from encoded form used in mark | 366 // Recover address of oop from encoded form used in mark |
366 inline void* decode_pointer() { if (UseBiasedLocking && has_bias_pattern()) return NULL; return clear_lock_bits(); } | 367 inline void* decode_pointer() { if (UseBiasedLocking && has_bias_pattern()) return NULL; return clear_lock_bits(); } |
367 | |
368 // see the definition in markOop.cpp for the gory details | |
369 bool should_not_be_cached() const; | |
370 | 368 |
371 // These markOops indicate cms free chunk blocks and not objects. | 369 // These markOops indicate cms free chunk blocks and not objects. |
372 // In 64 bit, the markOop is set to distinguish them from oops. | 370 // In 64 bit, the markOop is set to distinguish them from oops. |
373 // These are defined in 32 bit mode for vmStructs. | 371 // These are defined in 32 bit mode for vmStructs. |
374 const static uintptr_t cms_free_chunk_pattern = 0x1; | 372 const static uintptr_t cms_free_chunk_pattern = 0x1; |