src/hotspot/share/prims/jvmtiManageCapabilities.cpp
author amenkov
Mon, 12 Mar 2018 14:11:54 -0700
changeset 49379 2d1d0c66966b
parent 48877 e4d80042ff19
child 50578 e2a7f431f65c
permissions -rw-r--r--
8193369: post_field_access does not work for some functions, possibly related to fast_getfield Reviewed-by: sspitsyn, cjplummer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
49379
2d1d0c66966b 8193369: post_field_access does not work for some functions, possibly related to fast_getfield
amenkov
parents: 48877
diff changeset
     2
 * Copyright (c) 2003, 2018, 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: 5353
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5353
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: 5353
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#include "jvmtifiles/jvmtiEnv.hpp"
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
    27
#include "logging/log.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "prims/jvmtiExport.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "prims/jvmtiManageCapabilities.hpp"
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
static const jint CAPA_SIZE = (JVMTI_INTERNAL_CAPABILITY_COUNT + 7) / 8;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  // capabilities which are always potentially available
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
jvmtiCapabilities JvmtiManageCapabilities::always_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  // capabilities which are potentially available during OnLoad
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
jvmtiCapabilities JvmtiManageCapabilities::onload_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  // capabilities which are always potentially available
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  // but to only one environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
jvmtiCapabilities JvmtiManageCapabilities::always_solo_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  // capabilities which are potentially available during OnLoad
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  // but to only one environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
jvmtiCapabilities JvmtiManageCapabilities::onload_solo_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // remaining capabilities which are always potentially available
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  // but to only one environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
jvmtiCapabilities JvmtiManageCapabilities::always_solo_remaining_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  // remaining capabilities which are potentially available during OnLoad
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  // but to only one environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
jvmtiCapabilities JvmtiManageCapabilities::onload_solo_remaining_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  // all capabilities ever acquired
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
jvmtiCapabilities JvmtiManageCapabilities::acquired_capabilities;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
void JvmtiManageCapabilities::initialize() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  always_capabilities = init_always_capabilities();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  onload_capabilities = init_onload_capabilities();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  always_solo_capabilities = init_always_solo_capabilities();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  onload_solo_capabilities = init_onload_solo_capabilities();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  always_solo_remaining_capabilities = init_always_solo_capabilities();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  onload_solo_remaining_capabilities = init_onload_solo_capabilities();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  memset(&acquired_capabilities, 0, sizeof(acquired_capabilities));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
// corresponding init functions
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
jvmtiCapabilities JvmtiManageCapabilities::init_always_capabilities() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  jvmtiCapabilities jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  memset(&jc, 0, sizeof(jc));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  jc.can_get_bytecodes = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  jc.can_signal_thread = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  jc.can_get_source_file_name = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  jc.can_get_line_numbers = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  jc.can_get_synthetic_attribute = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  jc.can_get_monitor_info = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  jc.can_get_constant_pool = 1;
48877
e4d80042ff19 8161605: The '!UseSharedSpaces' check is not need in JvmtiManageCapabilities::recompute_always_capabilities
amenkov
parents: 47216
diff changeset
    81
  jc.can_generate_all_class_hook_events = 1;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  jc.can_generate_monitor_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  jc.can_generate_garbage_collection_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  jc.can_generate_compiled_method_load_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  jc.can_generate_native_method_bind_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  jc.can_generate_vm_object_alloc_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  if (os::is_thread_cpu_time_supported()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    jc.can_get_current_thread_cpu_time = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
    jc.can_get_thread_cpu_time = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  jc.can_redefine_classes = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  jc.can_redefine_any_class = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  jc.can_retransform_classes = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  jc.can_retransform_any_class = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  jc.can_set_native_method_prefix = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  jc.can_tag_objects = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  jc.can_generate_object_free_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  jc.can_generate_resource_exhaustion_heap_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  jc.can_generate_resource_exhaustion_threads_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  return jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
jvmtiCapabilities JvmtiManageCapabilities::init_onload_capabilities() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  jvmtiCapabilities jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  memset(&jc, 0, sizeof(jc));
22836
e7e511228518 8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents: 9098
diff changeset
   107
#ifndef ZERO
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  jc.can_pop_frame = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  jc.can_force_early_return = 1;
22836
e7e511228518 8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents: 9098
diff changeset
   110
#endif // !ZERO
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  jc.can_get_source_debug_extension = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  jc.can_access_local_variables = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  jc.can_maintain_original_method_order = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  jc.can_generate_single_step_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  jc.can_generate_exception_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  jc.can_generate_frame_pop_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  jc.can_generate_method_entry_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  jc.can_generate_method_exit_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  jc.can_get_owned_monitor_info = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  jc.can_get_owned_monitor_stack_depth_info = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  jc.can_get_current_contended_monitor = 1;
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 25950
diff changeset
   122
  jc.can_generate_early_vmstart = 1;
38110
22bb1ed67962 8153749: New capability can_generate_early_class_hook_events
sspitsyn
parents: 37992
diff changeset
   123
  jc.can_generate_early_class_hook_events = 1;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  return jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
jvmtiCapabilities JvmtiManageCapabilities::init_always_solo_capabilities() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  jvmtiCapabilities jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  memset(&jc, 0, sizeof(jc));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  jc.can_suspend = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  return jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
jvmtiCapabilities JvmtiManageCapabilities::init_onload_solo_capabilities() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  jvmtiCapabilities jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  memset(&jc, 0, sizeof(jc));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  jc.can_generate_field_modification_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  jc.can_generate_field_access_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  jc.can_generate_breakpoint_events = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  return jc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
jvmtiCapabilities *JvmtiManageCapabilities::either(const jvmtiCapabilities *a, const jvmtiCapabilities *b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
                                                   jvmtiCapabilities *result) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  char *ap = (char *)a;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  char *bp = (char *)b;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  char *resultp = (char *)result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  for (int i = 0; i < CAPA_SIZE; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
    *resultp++ = *ap++ | *bp++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  return result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
jvmtiCapabilities *JvmtiManageCapabilities::both(const jvmtiCapabilities *a, const jvmtiCapabilities *b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
                                                    jvmtiCapabilities *result) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  char *ap = (char *)a;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  char *bp = (char *)b;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  char *resultp = (char *)result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  for (int i = 0; i < CAPA_SIZE; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    *resultp++ = *ap++ & *bp++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  return result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
jvmtiCapabilities *JvmtiManageCapabilities::exclude(const jvmtiCapabilities *a, const jvmtiCapabilities *b,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
                                                    jvmtiCapabilities *result) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  char *ap = (char *)a;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  char *bp = (char *)b;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  char *resultp = (char *)result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  for (int i = 0; i < CAPA_SIZE; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
    *resultp++ = *ap++ & ~*bp++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  return result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
bool JvmtiManageCapabilities::has_some(const jvmtiCapabilities *a) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  char *ap = (char *)a;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  for (int i = 0; i < CAPA_SIZE; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
    if (*ap++ != 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
void JvmtiManageCapabilities::copy_capabilities(const jvmtiCapabilities *from, jvmtiCapabilities *to) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  char *ap = (char *)from;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  char *resultp = (char *)to;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  for (int i = 0; i < CAPA_SIZE; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    *resultp++ = *ap++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
void JvmtiManageCapabilities::get_potential_capabilities(const jvmtiCapabilities *current,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
                                                         const jvmtiCapabilities *prohibited,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
                                                         jvmtiCapabilities *result) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  // exclude prohibited capabilities, must be before adding current
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  exclude(&always_capabilities, prohibited, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  // must include current since it may possess solo capabilities and now prohibited
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  either(result, current, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  // add other remaining
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  either(result, &always_solo_remaining_capabilities, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  // if this is during OnLoad more capabilities are available
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    either(result, &onload_capabilities, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    either(result, &onload_solo_remaining_capabilities, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
jvmtiError JvmtiManageCapabilities::add_capabilities(const jvmtiCapabilities *current,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
                                                     const jvmtiCapabilities *prohibited,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
                                                     const jvmtiCapabilities *desired,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
                                                     jvmtiCapabilities *result) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  // check that the capabilities being added are potential capabilities
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  jvmtiCapabilities temp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  get_potential_capabilities(current, prohibited, &temp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  if (has_some(exclude(desired, &temp, &temp))) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
    return JVMTI_ERROR_NOT_AVAILABLE;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  // add to the set of ever acquired capabilities
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  either(&acquired_capabilities, desired, &acquired_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  // onload capabilities that got added are now permanent - so, also remove from onload
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  both(&onload_capabilities, desired, &temp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  either(&always_capabilities, &temp, &always_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  exclude(&onload_capabilities, &temp, &onload_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  // same for solo capabilities (transferred capabilities in the remaining sets handled as part of standard grab - below)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  both(&onload_solo_capabilities, desired, &temp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  either(&always_solo_capabilities, &temp, &always_solo_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  exclude(&onload_solo_capabilities, &temp, &onload_solo_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  // remove solo capabilities that are now taken
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  exclude(&always_solo_remaining_capabilities, desired, &always_solo_remaining_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  exclude(&onload_solo_remaining_capabilities, desired, &onload_solo_remaining_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  // return the result
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  either(current, desired, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  update();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
  return JVMTI_ERROR_NONE;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
void JvmtiManageCapabilities::relinquish_capabilities(const jvmtiCapabilities *current,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
                                                      const jvmtiCapabilities *unwanted,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
                                                      jvmtiCapabilities *result) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  jvmtiCapabilities to_trash;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
  jvmtiCapabilities temp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  // can't give up what you don't have
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  both(current, unwanted, &to_trash);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  // restore solo capabilities but only those that belong
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
  either(&always_solo_remaining_capabilities, both(&always_solo_capabilities, &to_trash, &temp),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
         &always_solo_remaining_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  either(&onload_solo_remaining_capabilities, both(&onload_solo_capabilities, &to_trash, &temp),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
         &onload_solo_remaining_capabilities);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  update();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  // return the result
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  exclude(current, unwanted, result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
void JvmtiManageCapabilities::update() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  jvmtiCapabilities avail;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  // all capabilities
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  either(&always_capabilities, &always_solo_capabilities, &avail);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  bool interp_events =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
    avail.can_generate_field_access_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
    avail.can_generate_field_modification_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
    avail.can_generate_single_step_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
    avail.can_generate_frame_pop_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
    avail.can_generate_method_entry_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
    avail.can_generate_method_exit_events;
25950
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents: 22836
diff changeset
   304
#ifdef ZERO
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  bool enter_all_methods =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
    interp_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
    avail.can_generate_breakpoint_events;
9098
458f0d0809b9 6385687: UseFastEmptyMethods/UseFastAccessorMethods considered harmful
never
parents: 7397
diff changeset
   308
  if (enter_all_methods) {
458f0d0809b9 6385687: UseFastEmptyMethods/UseFastAccessorMethods considered harmful
never
parents: 7397
diff changeset
   309
    // Disable these when tracking the bytecodes
458f0d0809b9 6385687: UseFastEmptyMethods/UseFastAccessorMethods considered harmful
never
parents: 7397
diff changeset
   310
    UseFastEmptyMethods = false;
458f0d0809b9 6385687: UseFastEmptyMethods/UseFastAccessorMethods considered harmful
never
parents: 7397
diff changeset
   311
    UseFastAccessorMethods = false;
458f0d0809b9 6385687: UseFastEmptyMethods/UseFastAccessorMethods considered harmful
never
parents: 7397
diff changeset
   312
  }
25950
b5c40ed1d349 8003426: Remove UseFastAccessors and UseFastEmptyMethods except for zero
coleenp
parents: 22836
diff changeset
   313
#endif // ZERO
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
49379
2d1d0c66966b 8193369: post_field_access does not work for some functions, possibly related to fast_getfield
amenkov
parents: 48877
diff changeset
   315
  if (avail.can_generate_breakpoint_events
2d1d0c66966b 8193369: post_field_access does not work for some functions, possibly related to fast_getfield
amenkov
parents: 48877
diff changeset
   316
       || avail.can_generate_field_access_events
2d1d0c66966b 8193369: post_field_access does not work for some functions, possibly related to fast_getfield
amenkov
parents: 48877
diff changeset
   317
       || avail.can_generate_field_modification_events)
2d1d0c66966b 8193369: post_field_access does not work for some functions, possibly related to fast_getfield
amenkov
parents: 48877
diff changeset
   318
  {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
    RewriteFrequentPairs = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  // If can_redefine_classes is enabled in the onload phase then we know that the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
  // dependency information recorded by the compiler is complete.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
  if ((avail.can_redefine_classes || avail.can_retransform_classes) &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
      JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
    JvmtiExport::set_all_dependencies_are_recorded(true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  JvmtiExport::set_can_get_source_debug_extension(avail.can_get_source_debug_extension);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  JvmtiExport::set_can_maintain_original_method_order(avail.can_maintain_original_method_order);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
  JvmtiExport::set_can_post_interpreter_events(interp_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
  JvmtiExport::set_can_hotswap_or_post_breakpoint(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
    avail.can_generate_breakpoint_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
    avail.can_redefine_classes ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
    avail.can_retransform_classes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
  JvmtiExport::set_can_modify_any_class(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
    avail.can_generate_breakpoint_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
    avail.can_generate_all_class_hook_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  JvmtiExport::set_can_walk_any_space(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
    avail.can_tag_objects);   // disable sharing in onload phase
5353
30f4b75f8005 6943485: JVMTI always on capabilities change code generation too much
never
parents: 4761
diff changeset
   341
  // This controls whether the compilers keep extra locals live to
30f4b75f8005 6943485: JVMTI always on capabilities change code generation too much
never
parents: 4761
diff changeset
   342
  // improve the debugging experience so only set them if the selected
30f4b75f8005 6943485: JVMTI always on capabilities change code generation too much
never
parents: 4761
diff changeset
   343
  // capabilities look like a debugger.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  JvmtiExport::set_can_access_local_variables(
5353
30f4b75f8005 6943485: JVMTI always on capabilities change code generation too much
never
parents: 4761
diff changeset
   345
    avail.can_access_local_variables ||
30f4b75f8005 6943485: JVMTI always on capabilities change code generation too much
never
parents: 4761
diff changeset
   346
    avail.can_generate_breakpoint_events ||
30f4b75f8005 6943485: JVMTI always on capabilities change code generation too much
never
parents: 4761
diff changeset
   347
    avail.can_generate_frame_pop_events);
4761
bdb7375a1fee 6902182: 4/4 Starting with jdwp agent should not incur performance penalty
dcubed
parents: 4448
diff changeset
   348
  JvmtiExport::set_can_post_on_exceptions(
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
    avail.can_generate_exception_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
    avail.can_generate_frame_pop_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
    avail.can_generate_method_exit_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
  JvmtiExport::set_can_post_breakpoint(avail.can_generate_breakpoint_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
  JvmtiExport::set_can_post_field_access(avail.can_generate_field_access_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
  JvmtiExport::set_can_post_field_modification(avail.can_generate_field_modification_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
  JvmtiExport::set_can_post_method_entry(avail.can_generate_method_entry_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
  JvmtiExport::set_can_post_method_exit(avail.can_generate_method_exit_events ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
                                        avail.can_generate_frame_pop_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
  JvmtiExport::set_can_pop_frame(avail.can_pop_frame);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
  JvmtiExport::set_can_force_early_return(avail.can_force_early_return);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
  JvmtiExport::set_should_clean_up_heap_objects(avail.can_generate_breakpoint_events);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
void JvmtiManageCapabilities:: print(const jvmtiCapabilities* cap) {
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   366
  log_trace(jvmti)("----- capabilities -----");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
  if (cap->can_tag_objects)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   368
    log_trace(jvmti)("can_tag_objects");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
  if (cap->can_generate_field_modification_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   370
    log_trace(jvmti)("can_generate_field_modification_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
  if (cap->can_generate_field_access_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   372
    log_trace(jvmti)("can_generate_field_access_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  if (cap->can_get_bytecodes)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   374
    log_trace(jvmti)("can_get_bytecodes");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  if (cap->can_get_synthetic_attribute)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   376
    log_trace(jvmti)("can_get_synthetic_attribute");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  if (cap->can_get_owned_monitor_info)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   378
    log_trace(jvmti)("can_get_owned_monitor_info");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  if (cap->can_get_current_contended_monitor)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   380
    log_trace(jvmti)("can_get_current_contended_monitor");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
  if (cap->can_get_monitor_info)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   382
    log_trace(jvmti)("can_get_monitor_info");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  if (cap->can_get_constant_pool)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   384
    log_trace(jvmti)("can_get_constant_pool");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  if (cap->can_pop_frame)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   386
    log_trace(jvmti)("can_pop_frame");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  if (cap->can_force_early_return)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   388
    log_trace(jvmti)("can_force_early_return");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  if (cap->can_redefine_classes)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   390
    log_trace(jvmti)("can_redefine_classes");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  if (cap->can_retransform_classes)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   392
    log_trace(jvmti)("can_retransform_classes");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
  if (cap->can_signal_thread)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   394
    log_trace(jvmti)("can_signal_thread");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  if (cap->can_get_source_file_name)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   396
    log_trace(jvmti)("can_get_source_file_name");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  if (cap->can_get_line_numbers)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   398
    log_trace(jvmti)("can_get_line_numbers");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
  if (cap->can_get_source_debug_extension)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   400
    log_trace(jvmti)("can_get_source_debug_extension");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
  if (cap->can_access_local_variables)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   402
    log_trace(jvmti)("can_access_local_variables");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  if (cap->can_maintain_original_method_order)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   404
    log_trace(jvmti)("can_maintain_original_method_order");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
  if (cap->can_generate_single_step_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   406
    log_trace(jvmti)("can_generate_single_step_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
  if (cap->can_generate_exception_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   408
    log_trace(jvmti)("can_generate_exception_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
  if (cap->can_generate_frame_pop_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   410
    log_trace(jvmti)("can_generate_frame_pop_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  if (cap->can_generate_breakpoint_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   412
    log_trace(jvmti)("can_generate_breakpoint_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  if (cap->can_suspend)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   414
    log_trace(jvmti)("can_suspend");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  if (cap->can_redefine_any_class )
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   416
    log_trace(jvmti)("can_redefine_any_class");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
  if (cap->can_retransform_any_class )
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   418
    log_trace(jvmti)("can_retransform_any_class");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
  if (cap->can_get_current_thread_cpu_time)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   420
    log_trace(jvmti)("can_get_current_thread_cpu_time");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  if (cap->can_get_thread_cpu_time)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   422
    log_trace(jvmti)("can_get_thread_cpu_time");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  if (cap->can_generate_method_entry_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   424
    log_trace(jvmti)("can_generate_method_entry_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  if (cap->can_generate_method_exit_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   426
    log_trace(jvmti)("can_generate_method_exit_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
  if (cap->can_generate_all_class_hook_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   428
    log_trace(jvmti)("can_generate_all_class_hook_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
  if (cap->can_generate_compiled_method_load_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   430
    log_trace(jvmti)("can_generate_compiled_method_load_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
  if (cap->can_generate_monitor_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   432
    log_trace(jvmti)("can_generate_monitor_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
  if (cap->can_generate_vm_object_alloc_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   434
    log_trace(jvmti)("can_generate_vm_object_alloc_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
  if (cap->can_generate_native_method_bind_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   436
    log_trace(jvmti)("can_generate_native_method_bind_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
  if (cap->can_generate_garbage_collection_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   438
    log_trace(jvmti)("can_generate_garbage_collection_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
  if (cap->can_generate_object_free_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   440
    log_trace(jvmti)("can_generate_object_free_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
  if (cap->can_generate_resource_exhaustion_heap_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   442
    log_trace(jvmti)("can_generate_resource_exhaustion_heap_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
  if (cap->can_generate_resource_exhaustion_threads_events)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   444
    log_trace(jvmti)("can_generate_resource_exhaustion_threads_events");
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 25950
diff changeset
   445
  if (cap->can_generate_early_vmstart)
37992
c7ec6a3275f7 8154041: JVMTI trace to Unified Logging
rehn
parents: 36508
diff changeset
   446
    log_trace(jvmti)("can_generate_early_vmstart");
38110
22bb1ed67962 8153749: New capability can_generate_early_class_hook_events
sspitsyn
parents: 37992
diff changeset
   447
  if (cap->can_generate_early_class_hook_events)
22bb1ed67962 8153749: New capability can_generate_early_class_hook_events
sspitsyn
parents: 37992
diff changeset
   448
    log_trace(jvmti)("can_generate_early_class_hook_events");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
#endif