hotspot/src/share/vm/oops/instanceKlass.inline.hpp
author simonis
Fri, 11 Mar 2016 16:39:38 +0100
changeset 37092 0e56e3c9d545
parent 32606 fdaa30d06ada
child 40887 8d35e19f5548
permissions -rw-r--r--
8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support Reviewed-by: coleenp, stuefe Contributed-by: matthias.baesken@sap.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     1
/*
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     4
 *
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     8
 *
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    13
 * accompanied this code).
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    14
 *
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    18
 *
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    21
 * questions.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    22
 *
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    23
 */
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    24
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    25
#ifndef SHARE_VM_OOPS_INSTANCEKLASS_INLINE_HPP
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    26
#define SHARE_VM_OOPS_INSTANCEKLASS_INLINE_HPP
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    27
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    28
#include "memory/iterator.hpp"
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    29
#include "oops/instanceKlass.hpp"
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30151
diff changeset
    30
#include "oops/klass.hpp"
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    31
#include "oops/oop.inline.hpp"
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    32
#include "utilities/debug.hpp"
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    33
#include "utilities/globalDefinitions.hpp"
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    34
#include "utilities/macros.hpp"
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    35
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    36
// The iteration over the oops in objects is a hot path in the GC code.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    37
// By force inlining the following functions, we get similar GC performance
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    38
// as the previous macro based implementation.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    39
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    40
template <bool nv, typename T, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
    41
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    42
  T* p         = (T*)obj->obj_field_addr<T>(map->offset());
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    43
  T* const end = p + map->count();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    44
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    45
  for (; p < end; ++p) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    46
    Devirtualizer<nv>::do_oop(closure, p);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    47
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    48
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    49
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    50
#if INCLUDE_ALL_GCS
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    51
template <bool nv, typename T, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
    52
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    53
  T* const start = (T*)obj->obj_field_addr<T>(map->offset());
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    54
  T*       p     = start + map->count();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    55
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    56
  while (start < p) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    57
    --p;
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    58
    Devirtualizer<nv>::do_oop(closure, p);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    59
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    60
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    61
#endif
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    62
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    63
template <bool nv, typename T, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
    64
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    65
  T* p   = (T*)obj->obj_field_addr<T>(map->offset());
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    66
  T* end = p + map->count();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    67
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    68
  T* const l   = (T*)mr.start();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    69
  T* const h   = (T*)mr.end();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    70
  assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 &&
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    71
         mask_bits((intptr_t)h, sizeof(T)-1) == 0,
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    72
         "bounded region must be properly aligned");
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    73
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    74
  if (p < l) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    75
    p = l;
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    76
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    77
  if (end > h) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    78
    end = h;
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    79
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    80
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    81
  for (;p < end; ++p) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    82
    Devirtualizer<nv>::do_oop(closure, p);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    83
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    84
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    85
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    86
template <bool nv, typename T, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
    87
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized(oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    88
  OopMapBlock* map           = start_of_nonstatic_oop_maps();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    89
  OopMapBlock* const end_map = map + nonstatic_oop_map_count();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    90
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    91
  for (; map < end_map; ++map) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    92
    oop_oop_iterate_oop_map<nv, T>(map, obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    93
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    94
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    95
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    96
#if INCLUDE_ALL_GCS
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    97
template <bool nv, typename T, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
    98
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
    99
  OopMapBlock* const start_map = start_of_nonstatic_oop_maps();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   100
  OopMapBlock* map             = start_map + nonstatic_oop_map_count();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   101
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   102
  while (start_map < map) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   103
    --map;
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   104
    oop_oop_iterate_oop_map_reverse<nv, T>(map, obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   105
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   106
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   107
#endif
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   108
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   109
template <bool nv, typename T, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   110
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   111
  OopMapBlock* map           = start_of_nonstatic_oop_maps();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   112
  OopMapBlock* const end_map = map + nonstatic_oop_map_count();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   113
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   114
  for (;map < end_map; ++map) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   115
    oop_oop_iterate_oop_map_bounded<nv, T>(map, obj, closure, mr);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   116
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   117
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   118
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   119
template <bool nv, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   120
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   121
  if (UseCompressedOops) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   122
    oop_oop_iterate_oop_maps_specialized<nv, narrowOop>(obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   123
  } else {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   124
    oop_oop_iterate_oop_maps_specialized<nv, oop>(obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   125
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   126
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   127
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   128
#if INCLUDE_ALL_GCS
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   129
template <bool nv, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   130
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   131
  if (UseCompressedOops) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   132
    oop_oop_iterate_oop_maps_specialized_reverse<nv, narrowOop>(obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   133
  } else {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   134
    oop_oop_iterate_oop_maps_specialized_reverse<nv, oop>(obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   135
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   136
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   137
#endif
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   138
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   139
template <bool nv, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   140
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   141
  if (UseCompressedOops) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   142
    oop_oop_iterate_oop_maps_specialized_bounded<nv, narrowOop>(obj, closure, mr);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   143
  } else {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   144
    oop_oop_iterate_oop_maps_specialized_bounded<nv, oop>(obj, closure, mr);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   145
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   146
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   147
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   148
template <bool nv, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   149
ALWAYSINLINE int InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   150
  if (Devirtualizer<nv>::do_metadata(closure)) {
30151
c7cdaa576875 8076456: Remove unnecessary oopDesc::klass() calls
stefank
parents: 30150
diff changeset
   151
    Devirtualizer<nv>::do_klass(closure, this);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   152
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   153
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   154
  oop_oop_iterate_oop_maps<nv>(obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   155
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   156
  return size_helper();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   157
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   158
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   159
#if INCLUDE_ALL_GCS
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   160
template <bool nv, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   161
ALWAYSINLINE int InstanceKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   162
  assert(!Devirtualizer<nv>::do_metadata(closure),
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   163
      "Code to handle metadata is not implemented");
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   164
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   165
  oop_oop_iterate_oop_maps_reverse<nv>(obj, closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   166
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   167
  return size_helper();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   168
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   169
#endif
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   170
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   171
template <bool nv, class OopClosureType>
37092
0e56e3c9d545 8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents: 32606
diff changeset
   172
ALWAYSINLINE int InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   173
  if (Devirtualizer<nv>::do_metadata(closure)) {
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   174
    if (mr.contains(obj)) {
30151
c7cdaa576875 8076456: Remove unnecessary oopDesc::klass() calls
stefank
parents: 30150
diff changeset
   175
      Devirtualizer<nv>::do_klass(closure, this);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   176
    }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   177
  }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   178
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   179
  oop_oop_iterate_oop_maps_bounded<nv>(obj, closure, mr);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   180
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   181
  return size_helper();
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   182
}
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   183
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   184
#define ALL_INSTANCE_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)  \
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30151
diff changeset
   185
  OOP_OOP_ITERATE_DEFN(          InstanceKlass, OopClosureType, nv_suffix)  \
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30151
diff changeset
   186
  OOP_OOP_ITERATE_DEFN_BOUNDED(  InstanceKlass, OopClosureType, nv_suffix)  \
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30151
diff changeset
   187
  OOP_OOP_ITERATE_DEFN_BACKWARDS(InstanceKlass, OopClosureType, nv_suffix)
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   188
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff changeset
   189
#endif // SHARE_VM_OOPS_INSTANCEKLASS_INLINE_HPP