src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 46502 hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp@116a09d8f142
child 49592 77fb0be7d19f
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
29792
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 29208
diff changeset
     2
 * Copyright (c) 2002, 2015, 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
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    25
#ifndef SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_INLINE_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    26
#define SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_INLINE_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    28
#include "gc/parallel/parallelScavengeHeap.hpp"
46502
116a09d8f142 8180755: Remove use of bitMap.inline.hpp include from instanceKlass.hpp and c1_ValueSet.hpp
tschatzl
parents: 35901
diff changeset
    29
#include "gc/parallel/parMarkBitMap.inline.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    30
#include "gc/parallel/psOldGen.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    31
#include "gc/parallel/psPromotionLAB.inline.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    32
#include "gc/parallel/psPromotionManager.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    33
#include "gc/parallel/psScavenge.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
    34
#include "gc/shared/taskqueue.inline.hpp"
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
    35
#include "logging/log.hpp"
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29792
diff changeset
    36
#include "oops/oop.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
    37
31330
77061bb01b18 8081382: Make flags ParallelGCThreads and ConcGCThreads of type uint
david
parents: 30764
diff changeset
    38
inline PSPromotionManager* PSPromotionManager::manager_array(uint index) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  assert(_manager_array != NULL, "access of NULL manager_array");
31330
77061bb01b18 8081382: Make flags ParallelGCThreads and ConcGCThreads of type uint
david
parents: 30764
diff changeset
    40
  assert(index <= ParallelGCThreads, "out of range manager_array access");
19285
0a3b3f115402 8022880: False sharing between PSPromotionManager instances
stefank
parents: 18025
diff changeset
    41
  return &_manager_array[index];
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    44
template <class T>
30566
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
    45
inline void PSPromotionManager::push_depth(T* p) {
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
    46
  claimed_stack_depth()->push(p);
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
    47
}
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
    48
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
    49
template <class T>
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    50
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
    51
  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
    52
    oop o = oopDesc::load_decode_heap_oop_not_null(p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    if (o->is_forwarded()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
      o = o->forwardee();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
      // Card mark
17852
59b05e1db547 8015486: PSScavenge::is_obj_in_young is unnecessarily slow with UseCompressedOops
stefank
parents: 13925
diff changeset
    56
      if (PSScavenge::is_obj_in_young(o)) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
        PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
      }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    59
      oopDesc::encode_store_heap_oop_not_null(p, o);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
      push_depth(p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    66
template <class T>
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    67
inline void PSPromotionManager::claim_or_forward_depth(T* p) {
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
    68
  assert(should_scavenge(p, true), "revisiting object?");
30173
13cf7580b000 8077413: Avoid use of Universe::heap() inside collectors
pliden
parents: 30150
diff changeset
    69
  assert(ParallelScavengeHeap::heap()->is_in(p), "pointer outside heap");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  claim_or_forward_internal_depth(p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
28177
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    74
inline void PSPromotionManager::promotion_trace_event(oop new_obj, oop old_obj,
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    75
                                                      size_t obj_size,
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    76
                                                      uint age, bool tenured,
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    77
                                                      const PSPromotionLAB* lab) {
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    78
  // Skip if memory allocation failed
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    79
  if (new_obj != NULL) {
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    80
    const ParallelScavengeTracer* gc_tracer = PSScavenge::gc_tracer();
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    81
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    82
    if (lab != NULL) {
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    83
      // Promotion of object through newly allocated PLAB
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    84
      if (gc_tracer->should_report_promotion_in_new_plab_event()) {
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    85
        size_t obj_bytes = obj_size * HeapWordSize;
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    86
        size_t lab_size = lab->capacity();
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    87
        gc_tracer->report_promotion_in_new_plab_event(old_obj->klass(), obj_bytes,
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    88
                                                      age, tenured, lab_size);
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    89
      }
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    90
    } else {
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    91
      // Promotion of object directly to heap
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    92
      if (gc_tracer->should_report_promotion_outside_plab_event()) {
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    93
        size_t obj_bytes = obj_size * HeapWordSize;
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    94
        gc_tracer->report_promotion_outside_plab_event(old_obj->klass(), obj_bytes,
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    95
                                                       age, tenured);
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    96
      }
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    97
    }
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    98
  }
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
    99
}
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   100
29792
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 29208
diff changeset
   101
inline void PSPromotionManager::push_contents(oop obj) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29792
diff changeset
   102
  obj->ps_push_contents(this);
29792
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 29208
diff changeset
   103
}
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   104
//
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   105
// This method is pretty bulky. It would be nice to split it up
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   106
// into smaller submethods, but we need to be careful not to hurt
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   107
// performance.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   108
//
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   109
template<bool promote_immediately>
30566
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
   110
inline oop PSPromotionManager::copy_to_survivor_space(oop o) {
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   111
  assert(should_scavenge(&o), "Sanity");
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   112
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   113
  oop new_obj = NULL;
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   114
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   115
  // NOTE! We must be very careful with any methods that access the mark
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   116
  // in o. There may be multiple threads racing on it, and it may be forwarded
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   117
  // at any time. Do not use oop methods for accessing the mark!
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   118
  markOop test_mark = o->mark();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   119
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   120
  // The same test as "o->is_forwarded()"
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   121
  if (!test_mark->is_marked()) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   122
    bool new_obj_is_tenured = false;
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   123
    size_t new_obj_size = o->size();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   124
28177
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   125
    // Find the objects age, MT safe.
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   126
    uint age = (test_mark->has_displaced_mark_helper() /* o->has_displaced_mark() */) ?
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   127
      test_mark->displaced_mark_helper()->age() : test_mark->age();
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   128
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   129
    if (!promote_immediately) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   130
      // Try allocating obj in to-space (unless too old)
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   131
      if (age < PSScavenge::tenuring_threshold()) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   132
        new_obj = (oop) _young_lab.allocate(new_obj_size);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   133
        if (new_obj == NULL && !_young_gen_is_full) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   134
          // Do we allocate directly, or flush and refill?
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   135
          if (new_obj_size > (YoungPLABSize / 2)) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   136
            // Allocate this object directly
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   137
            new_obj = (oop)young_space()->cas_allocate(new_obj_size);
28177
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   138
            promotion_trace_event(new_obj, o, new_obj_size, age, false, NULL);
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   139
          } else {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   140
            // Flush and fill
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   141
            _young_lab.flush();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   142
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   143
            HeapWord* lab_base = young_space()->cas_allocate(YoungPLABSize);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   144
            if (lab_base != NULL) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   145
              _young_lab.initialize(MemRegion(lab_base, YoungPLABSize));
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   146
              // Try the young lab allocation again.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   147
              new_obj = (oop) _young_lab.allocate(new_obj_size);
28177
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   148
              promotion_trace_event(new_obj, o, new_obj_size, age, false, &_young_lab);
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   149
            } else {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   150
              _young_gen_is_full = true;
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   151
            }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   152
          }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   153
        }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   154
      }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   155
    }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   156
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   157
    // Otherwise try allocating obj tenured
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   158
    if (new_obj == NULL) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   159
#ifndef PRODUCT
30173
13cf7580b000 8077413: Avoid use of Universe::heap() inside collectors
pliden
parents: 30150
diff changeset
   160
      if (ParallelScavengeHeap::heap()->promotion_should_fail()) {
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   161
        return oop_promotion_failed(o, test_mark);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   162
      }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   163
#endif  // #ifndef PRODUCT
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   164
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   165
      new_obj = (oop) _old_lab.allocate(new_obj_size);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   166
      new_obj_is_tenured = true;
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   167
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   168
      if (new_obj == NULL) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   169
        if (!_old_gen_is_full) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   170
          // Do we allocate directly, or flush and refill?
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   171
          if (new_obj_size > (OldPLABSize / 2)) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   172
            // Allocate this object directly
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   173
            new_obj = (oop)old_gen()->cas_allocate(new_obj_size);
28177
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   174
            promotion_trace_event(new_obj, o, new_obj_size, age, true, NULL);
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   175
          } else {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   176
            // Flush and fill
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   177
            _old_lab.flush();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   178
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   179
            HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   180
            if(lab_base != NULL) {
13924
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   181
#ifdef ASSERT
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   182
              // Delay the initialization of the promotion lab (plab).
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   183
              // This exposes uninitialized plabs to card table processing.
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   184
              if (GCWorkerDelayMillis > 0) {
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   185
                os::sleep(Thread::current(), GCWorkerDelayMillis, false);
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   186
              }
159131321ed4 7199349: NPG: PS: Crash seen in jprt
jmasa
parents: 13728
diff changeset
   187
#endif
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   188
              _old_lab.initialize(MemRegion(lab_base, OldPLABSize));
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   189
              // Try the old lab allocation again.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   190
              new_obj = (oop) _old_lab.allocate(new_obj_size);
28177
318600b0d7db 8066442: Add PS and ParOld support for promotion event
sfriberg
parents: 25905
diff changeset
   191
              promotion_trace_event(new_obj, o, new_obj_size, age, true, &_old_lab);
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   192
            }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   193
          }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   194
        }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   195
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   196
        // This is the promotion failed test, and code handling.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   197
        // The code belongs here for two reasons. It is slightly
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17852
diff changeset
   198
        // different than the code below, and cannot share the
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   199
        // CAS testing code. Keeping the code here also minimizes
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   200
        // the impact on the common case fast path code.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   201
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   202
        if (new_obj == NULL) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   203
          _old_gen_is_full = true;
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   204
          return oop_promotion_failed(o, test_mark);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   205
        }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   206
      }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   207
    }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   208
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   209
    assert(new_obj != NULL, "allocation should have succeeded");
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   210
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   211
    // Copy obj
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   212
    Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   213
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   214
    // Now we have to CAS in the header.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   215
    if (o->cas_forward_to(new_obj, test_mark)) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   216
      // We won any races, we "own" this object.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   217
      assert(new_obj == o->forwardee(), "Sanity");
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   218
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   219
      // Increment age if obj still in new generation. Now that
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   220
      // we're dealing with a markOop that cannot change, it is
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   221
      // okay to use the non mt safe oop methods.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   222
      if (!new_obj_is_tenured) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   223
        new_obj->incr_age();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   224
        assert(young_space()->contains(new_obj), "Attempt to push non-promoted obj");
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   225
      }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   226
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   227
      // Do the size comparison first with new_obj_size, which we
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   228
      // already have. Hopefully, only a few objects are larger than
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   229
      // _min_array_size_for_chunking, and most of them will be arrays.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   230
      // So, the is->objArray() test would be very infrequent.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   231
      if (new_obj_size > _min_array_size_for_chunking &&
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   232
          new_obj->is_objArray() &&
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   233
          PSChunkLargeArrays) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   234
        // we'll chunk it
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   235
        oop* const masked_o = mask_chunked_array_oop(o);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   236
        push_depth(masked_o);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   237
        TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   238
      } else {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   239
        // we'll just push its contents
29792
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 29208
diff changeset
   240
        push_contents(new_obj);
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   241
      }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   242
    }  else {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   243
      // We lost, someone else "owns" this object
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   244
      guarantee(o->is_forwarded(), "Object must be forwarded if the cas failed.");
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   245
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   246
      // Try to deallocate the space.  If it was directly allocated we cannot
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   247
      // deallocate it, so we have to test.  If the deallocation fails,
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   248
      // overwrite with a filler object.
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   249
      if (new_obj_is_tenured) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   250
        if (!_old_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   251
          CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   252
        }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   253
      } else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   254
        CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size);
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   255
      }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   256
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   257
      // don't update this before the unallocation!
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   258
      new_obj = o->forwardee();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   259
    }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   260
  } else {
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   261
    assert(o->is_forwarded(), "Sanity");
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   262
    new_obj = o->forwardee();
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   263
  }
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   264
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   265
  // This code must come after the CAS test, or it will print incorrect
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   266
  // information.
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
   267
  log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
   268
                                  should_scavenge(&new_obj) ? "copying" : "tenuring",
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
   269
                                  new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   270
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   271
  return new_obj;
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   272
}
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   273
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   274
// Attempt to "claim" oop at p via CAS, push the new obj if successful
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   275
// This version tests the oop* to make sure it is within the heap before
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   276
// attempting marking.
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   277
template <class T, bool promote_immediately>
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   278
inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) {
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   279
  assert(should_scavenge(p, true), "revisiting object?");
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   280
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   281
  oop o = oopDesc::load_decode_heap_oop_not_null(p);
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   282
  oop new_obj = o->is_forwarded()
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   283
        ? o->forwardee()
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   284
        : copy_to_survivor_space<promote_immediately>(o);
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   285
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   286
  // This code must come after the CAS test, or it will print incorrect
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   287
  // information.
35901
f5028c67e7cb 8147918: Rename develop_log_is_enabled() to log_develop_is_enabled()
pliden
parents: 35061
diff changeset
   288
  if (log_develop_is_enabled(Trace, gc, scavenge) && o->is_forwarded()) {
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
   289
    log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
   290
                      "forwarding",
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 34174
diff changeset
   291
                      new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   292
  }
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   293
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   294
  oopDesc::encode_store_heap_oop_not_null(p, new_obj);
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   295
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   296
  // We cannot mark without test, as some code passes us pointers
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   297
  // that are outside the heap. These pointers are either from roots
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   298
  // or from metadata.
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   299
  if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) &&
30173
13cf7580b000 8077413: Avoid use of Universe::heap() inside collectors
pliden
parents: 30150
diff changeset
   300
      ParallelScavengeHeap::heap()->is_in_reserved(p)) {
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   301
    if (PSScavenge::is_obj_in_young(new_obj)) {
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   302
      PSScavenge::card_table()->inline_write_ref_field_gc(p, new_obj);
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   303
    }
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   304
  }
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   305
}
11753
c9e420473a11 7144296: PS: Optimize nmethods processing
iveresov
parents: 7397
diff changeset
   306
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   307
inline void PSPromotionManager::process_popped_location_depth(StarTask p) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  if (is_oop_masked(p)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
    assert(PSChunkLargeArrays, "invariant");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
    oop const old = unmask_chunked_array_oop(p);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
    process_array_chunk(old);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  } else {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   313
    if (p.is_narrow()) {
3262
30d1c247fc25 6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents: 670
diff changeset
   314
      assert(UseCompressedOops, "Error");
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   315
      copy_and_push_safe_barrier<narrowOop, /*promote_immediately=*/false>(p);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   316
    } else {
29208
b570d043f295 8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents: 28177
diff changeset
   317
      copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(p);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   318
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
}
6067
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   321
30566
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
   322
inline bool PSPromotionManager::steal_depth(int queue_num, int* seed, StarTask& t) {
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
   323
  return stack_array_depth()->steal(queue_num, seed, t);
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
   324
}
18eb9aa972d0 8076177: Remove usage of stack.inline.hpp functions from taskqueue.hpp
stefank
parents: 30173
diff changeset
   325
6067
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   326
#if TASKQUEUE_STATS
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   327
void PSPromotionManager::record_steal(StarTask& p) {
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   328
  if (is_oop_masked(p)) {
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   329
    ++_masked_steals;
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   330
  }
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   331
}
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
   332
#endif // TASKQUEUE_STATS
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6248
diff changeset
   333
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30566
diff changeset
   334
#endif // SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_INLINE_HPP