hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
author stefank
Tue, 23 Nov 2010 13:22:55 -0800
changeset 7397 5b173b4ca846
parent 6248 2e661807cef0
child 11753 c9e420473a11
permissions -rw-r--r--
6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
6067
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
     2
 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3262
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3262
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3262
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    25
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    26
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    28
#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    29
#include "gc_implementation/parallelScavenge/psScavenge.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
  assert(_manager_array != NULL, "access of NULL manager_array");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  return _manager_array[index];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    37
template <class T>
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    38
inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    39
  if (p != NULL) { // XXX: error if p != NULL here
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    40
    oop o = oopDesc::load_decode_heap_oop_not_null(p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    if (o->is_forwarded()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
      o = o->forwardee();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
      // Card mark
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
      if (PSScavenge::is_obj_in_young((HeapWord*) o)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
        PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
      }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    47
      oopDesc::encode_store_heap_oop_not_null(p, o);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
      push_depth(p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    54
template <class T>
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    55
inline void PSPromotionManager::claim_or_forward_depth(T* p) {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    56
  assert(PSScavenge::should_scavenge(p, true), "revisiting object?");
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    57
  assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    58
         "Sanity");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  assert(Universe::heap()->is_in(p), "pointer outside heap");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  claim_or_forward_internal_depth(p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    64
inline void PSPromotionManager::process_popped_location_depth(StarTask p) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  if (is_oop_masked(p)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    assert(PSChunkLargeArrays, "invariant");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    oop const old = unmask_chunked_array_oop(p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
    process_array_chunk(old);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  } else {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    70
    if (p.is_narrow()) {
3262
30d1c247fc25 6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents: 670
diff changeset
    71
      assert(UseCompressedOops, "Error");
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    72
      PSScavenge::copy_and_push_safe_barrier(this, (narrowOop*)p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    73
    } else {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    74
      PSScavenge::copy_and_push_safe_barrier(this, (oop*)p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    75
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
}
6067
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    78
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    79
#if TASKQUEUE_STATS
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    80
void PSPromotionManager::record_steal(StarTask& p) {
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    81
  if (is_oop_masked(p)) {
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    82
    ++_masked_steals;
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    83
  }
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    84
}
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    85
#endif // TASKQUEUE_STATS
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    86
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    87
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP