hotspot/src/share/vm/memory/specialized_oop_closures.hpp
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1 489c9b5090e2
child 1374 4c24294029a9
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
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
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
// The following OopClosure types get specialized versions of
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
// "oop_oop_iterate" that invoke the closures' do_oop methods
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
// non-virtually, using a mechanism defined in this file.  Extend these
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// macros in the obvious way to add specializations for new closures.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// Forward declarations.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
class OopClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class OopsInGenClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// DefNew
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
class ScanClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
class FastScanClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
class FilteringClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// ParNew
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
class ParScanWithBarrierClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
class ParScanWithoutBarrierClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// CMS
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
class MarkRefsIntoAndScanClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
class Par_MarkRefsIntoAndScanClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
class PushAndMarkClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
class Par_PushAndMarkClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
class PushOrMarkClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
class Par_PushOrMarkClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
class CMSKeepAliveClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
class CMSInnerParMarkAndPushClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// This macro applies an argument macro to all OopClosures for which we
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
// want specialized bodies of "oop_oop_iterate".  The arguments to "f" are:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
//   "f(closureType, non_virtual)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
// where "closureType" is the name of the particular subclass of OopClosure,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
// and "non_virtual" will be the string "_nv" if the closure type should
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
// have its "do_oop" method invoked non-virtually, or else the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
// string "_v".  ("OopClosure" itself will be the only class in the latter
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
// category.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
// This is split into several because of a Visual C++ 6.0 compiler bug
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
// where very long macros cause the compiler to crash
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  f(ScanClosure,_nv)                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  f(FastScanClosure,_nv)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  f(FilteringClosure,_nv)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  f(ParScanWithBarrierClosure,_nv)                      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  f(ParScanWithoutBarrierClosure,_nv)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
#else  // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f)       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)             \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_3(f)       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  f(MarkRefsIntoAndScanClosure,_nv)                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  f(Par_MarkRefsIntoAndScanClosure,_nv)                 \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  f(PushAndMarkClosure,_nv)                             \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  f(Par_PushAndMarkClosure,_nv)                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  f(PushOrMarkClosure,_nv)                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  f(Par_PushOrMarkClosure,_nv)                          \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  f(CMSKeepAliveClosure,_nv)                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  f(CMSInnerParMarkAndPushClosure,_nv)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
#else  // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_3(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
// We separate these out, because sometime the general one has
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
// a different definition from the specialized ones, and sometimes it
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
// doesn't.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
#define ALL_OOP_OOP_ITERATE_CLOSURES_1(f)               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  f(OopClosure,_v)                                      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
#define ALL_OOP_OOP_ITERATE_CLOSURES_3(f)               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_3(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
// This macro applies an argument macro to all OopClosures for which we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
// want specialized bodies of a family of methods related to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
// "par_oop_iterate".  The arguments to f are the same as above.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
// The "root_class" is the most general class to define; this may be
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
// "OopClosure" in some applications and "OopsInGenClosure" in others.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
#define SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f)        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  f(MarkRefsIntoAndScanClosure,_nv)                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  f(PushAndMarkClosure,_nv)                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  f(Par_MarkRefsIntoAndScanClosure,_nv)                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  f(Par_PushAndMarkClosure,_nv)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
#define ALL_PAR_OOP_ITERATE_CLOSURES(f)                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  f(OopClosure,_v)                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
// This macro applies an argument macro to all OopClosures for which we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
// want specialized bodies of a family of methods related to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
// "oops_since_save_marks_do".  The arguments to f are the same as above.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
// The "root_class" is the most general class to define; this may be
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
// "OopClosure" in some applications and "OopsInGenClosure" in others.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  f(ScanClosure,_nv)                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  f(FastScanClosure,_nv)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  f(ParScanWithBarrierClosure,_nv)                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  f(ParScanWithoutBarrierClosure,_nv)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
#else  // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f)  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f)      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
// We separate these out, because sometime the general one has
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
// a different definition from the specialized ones, and sometimes it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
// doesn't.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
// NOTE:   One of the valid criticisms of this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
// specialize-oop_oop_iterate-for-specific-closures idiom is that it is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
// easy to have a silent performance bug: if you fail to de-virtualize,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
// things still work, just slower.  The "SpecializationStats" mode is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
// intended to at least make such a failure easy to detect.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
// *Not* using the ALL_SINCE_SAVE_MARKS_CLOSURES(f) macro defined
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
// below means that *only* closures for which oop_oop_iterate specializations
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
// exist above may be applied to "oops_since_save_marks".  That is,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
// this form of the performance bug is caught statically.  When you add
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
// a definition for the general type, this property goes away.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
// Make sure you test with SpecializationStats to find such bugs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
// when introducing a new closure where you don't want virtual dispatch.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
#define ALL_SINCE_SAVE_MARKS_CLOSURES(f)                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  f(OopsInGenClosure,_v)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
// For keeping stats on effectiveness.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
#define ENABLE_SPECIALIZATION_STATS 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
class SpecializationStats {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  enum Kind {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    ik,             // instanceKlass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    irk,            // instanceRefKlass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
    oa,             // objArrayKlass
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
    NUM_Kinds
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
#if ENABLE_SPECIALIZATION_STATS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  static int _numCallsAll;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  static int _numCallsTotal[NUM_Kinds];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  static int _numCalls_nv[NUM_Kinds];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  static int _numDoOopCallsTotal[NUM_Kinds];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  static int _numDoOopCalls_nv[NUM_Kinds];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  static void clear()  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  static inline void record_call()  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  static inline void record_iterate_call_v(Kind k)  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  static inline void record_iterate_call_nv(Kind k)  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  static inline void record_do_oop_call_v(Kind k)  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  static inline void record_do_oop_call_nv(Kind k)  PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  static void print() PRODUCT_RETURN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
#if ENABLE_SPECIALIZATION_STATS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
inline void SpecializationStats::record_call() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  _numCallsAll++;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
inline void SpecializationStats::record_iterate_call_v(Kind k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  _numCallsTotal[k]++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
inline void SpecializationStats::record_iterate_call_nv(Kind k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  _numCallsTotal[k]++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  _numCalls_nv[k]++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
inline void SpecializationStats::record_do_oop_call_v(Kind k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  _numDoOopCallsTotal[k]++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
inline void SpecializationStats::record_do_oop_call_nv(Kind k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  _numDoOopCallsTotal[k]++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  _numDoOopCalls_nv[k]++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
#else   // !ENABLE_SPECIALIZATION_STATS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
inline void SpecializationStats::record_call() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
inline void SpecializationStats::record_iterate_call_v(Kind k) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
inline void SpecializationStats::record_iterate_call_nv(Kind k) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
inline void SpecializationStats::record_do_oop_call_v(Kind k) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
inline void SpecializationStats::record_do_oop_call_nv(Kind k) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
inline void SpecializationStats::clear() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
inline void SpecializationStats::print() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
#endif  // ENABLE_SPECIALIZATION_STATS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
#endif  // !PRODUCT