src/hotspot/share/classfile/javaAssertions.cpp
author simonis
Tue, 19 Jun 2018 09:43:53 +0200
changeset 50625 d9753e3db0c6
parent 49036 bc92debe57e4
child 58722 cba8afa5cfed
permissions -rw-r--r--
8204965: Fix '--disable-cds' and disable CDS on AIX by default Reviewed-by: erikj, jiangli, stuefe, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
46329
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 35498
diff changeset
     2
 * Copyright (c) 2000, 2017, 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: 4571
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4571
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: 4571
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 "classfile/javaAssertions.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
#include "classfile/javaClasses.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "classfile/systemDictionary.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "classfile/vmSymbols.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "memory/allocation.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "memory/oopFactory.hpp"
35498
392b50de06c6 8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents: 13728
diff changeset
    32
#include "oops/objArrayOop.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
#include "oops/oop.inline.hpp"
49036
bc92debe57e4 8197999: Accessors in typeArrayOopDesc should use new Access API
rkennke
parents: 47216
diff changeset
    34
#include "oops/typeArrayOop.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
#include "runtime/handles.inline.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
bool                            JavaAssertions::_userDefault = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
bool                            JavaAssertions::_sysDefault = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
JavaAssertions::OptionList*     JavaAssertions::_classes = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
JavaAssertions::OptionList*     JavaAssertions::_packages = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
JavaAssertions::OptionList::OptionList(const char* name, bool enabled,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  OptionList* next) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  assert(name != 0, "need a name");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  _name = name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  _enabled = enabled;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  _next = next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
int JavaAssertions::OptionList::count(OptionList* p) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  int rc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  for (rc = 0; p != 0; p = p->next(), ++rc) /* empty */;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  return rc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
void JavaAssertions::addOption(const char* name, bool enable) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  assert(name != 0, "must have a name");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  // Copy the name.  The storage needs to exist for the the lifetime of the vm;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  // it is never freed, so will be leaked (along with other option strings -
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // e.g., bootclasspath) if a process creates/destroys multiple VMs.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  int len = (int)strlen(name);
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 8921
diff changeset
    63
  char *name_copy = NEW_C_HEAP_ARRAY(char, len + 1, mtClass);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  strcpy(name_copy, name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  // Figure out which list the new item should go on.  Names that end in "..."
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  // go on the package tree list.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  OptionList** head = &_classes;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  if (len >= 3 && strcmp(name_copy + len - 3, "...") == 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    // Delete the "...".
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    len -= 3;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
    name_copy[len] = '\0';
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    head = &_packages;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  // Convert class/package names to internal format.  Will have to convert back
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  // when copying to java in createJavaAssertionStatusDirectives, but that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  // should happen only once.  Alternative would require that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  // JVM_DesiredAssertionStatus pass the external_name() to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  // JavaAssertion::enabled(), but that is done once per loaded class.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  for (int i = 0; i < len; ++i) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    if (name_copy[i] == '.') name_copy[i] = '/';
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  if (TraceJavaAssertions) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    tty->print_cr("JavaAssertions: adding %s %s=%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
      head == &_classes ? "class" : "package",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
      name_copy[0] != '\0' ? name_copy : "'default'",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
      enable);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  // Prepend a new item to the list.  Items added later take precedence, so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  // prepending allows us to stop searching the list after the first match.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  *head = new OptionList(name_copy, enable, *head);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
oop JavaAssertions::createAssertionStatusDirectives(TRAPS) {
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
    98
  Symbol* asd_sym = vmSymbols::java_lang_AssertionStatusDirectives();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    99
  Klass* k = SystemDictionary::resolve_or_fail(asd_sym, true, CHECK_NULL);
46329
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 35498
diff changeset
   100
  InstanceKlass* asd_klass = InstanceKlass::cast(k);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  asd_klass->initialize(CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  Handle h = asd_klass->allocate_instance_handle(CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  int len;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  typeArrayOop t;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  len = OptionList::count(_packages);
4571
80b553bddc26 6914300: ciEnv should export all well known classes
never
parents: 1
diff changeset
   107
  objArrayOop pn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  objArrayHandle pkgNames (THREAD, pn);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  typeArrayHandle pkgEnabled(THREAD, t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  fillJavaArrays(_packages, len, pkgNames, pkgEnabled, CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  len = OptionList::count(_classes);
4571
80b553bddc26 6914300: ciEnv should export all well known classes
never
parents: 1
diff changeset
   114
  objArrayOop cn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  objArrayHandle classNames (THREAD, cn);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  typeArrayHandle classEnabled(THREAD, t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  fillJavaArrays(_classes, len, classNames, classEnabled, CHECK_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  java_lang_AssertionStatusDirectives::set_packages(h(), pkgNames());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  java_lang_AssertionStatusDirectives::set_packageEnabled(h(), pkgEnabled());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  java_lang_AssertionStatusDirectives::set_classes(h(), classNames());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  java_lang_AssertionStatusDirectives::set_classEnabled(h(), classEnabled());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  java_lang_AssertionStatusDirectives::set_deflt(h(), userClassDefault());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  return h();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
void JavaAssertions::fillJavaArrays(const OptionList* p, int len,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
objArrayHandle names, typeArrayHandle enabled, TRAPS) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  // Fill in the parallel names and enabled (boolean) arrays.  Start at the end
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  // of the array and work backwards, so the order of items in the arrays
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  // matches the order on the command line (the list is in reverse order, since
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  // it was created by prepending successive items from the command line).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  int index;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  for (index = len - 1; p != 0; p = p->next(), --index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    assert(index >= 0, "length does not match list");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    Handle s = java_lang_String::create_from_str(p->name(), CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    s = java_lang_String::char_converter(s, '/', '.', CHECK);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    names->obj_at_put(index, s());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    enabled->bool_at_put(index, p->enabled());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  assert(index == -1, "length does not match list");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
inline JavaAssertions::OptionList*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
JavaAssertions::match_class(const char* classname) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  for (OptionList* p = _classes; p != 0; p = p->next()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    if (strcmp(p->name(), classname) == 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
      return p;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
JavaAssertions::OptionList*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
JavaAssertions::match_package(const char* classname) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // Search the package list for any items that apply to classname.  Each
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  // sub-package in classname is checked, from most-specific to least, until one
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  // is found.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  if (_packages == 0) return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  // Find the length of the "most-specific" package in classname.  If classname
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  // does not include a package, length will be 0 which will match items for the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  // default package (from options "-ea:..."  or "-da:...").
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  size_t len = strlen(classname);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  for (/* empty */; len > 0 && classname[len] != '/'; --len) /* empty */;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  do {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    assert(len == 0 || classname[len] == '/', "not a package name");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    for (OptionList* p = _packages; p != 0; p = p->next()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
      if (strncmp(p->name(), classname, len) == 0 && p->name()[len] == '\0') {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
        return p;
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
    // Find the length of the next package, taking care to avoid decrementing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
    // past 0 (len is unsigned).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
    while (len > 0 && classname[--len] != '/') /* empty */;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  } while (len > 0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
inline void JavaAssertions::trace(const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
const char* typefound, const char* namefound, bool enabled) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  if (TraceJavaAssertions) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    tty->print_cr("JavaAssertions:  search for %s found %s %s=%d",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
      name, typefound, namefound[0] != '\0' ? namefound : "'default'", enabled);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
bool JavaAssertions::enabled(const char* classname, bool systemClass) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  assert(classname != 0, "must have a classname");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  // This will be slow if the number of assertion options on the command line is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  // large--it traverses two lists, one of them multiple times.  Could use a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  // single n-ary tree instead of lists if someone ever notices.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  // First check options that apply to classes.  If we find a match we're done.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  OptionList* p;
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 46329
diff changeset
   201
  if ((p = match_class(classname))) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
    trace(classname, "class", p->name(), p->enabled());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    return p->enabled();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  // Now check packages, from most specific to least.
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 46329
diff changeset
   207
  if ((p = match_package(classname))) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    trace(classname, "package", p->name(), p->enabled());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    return p->enabled();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  // No match.  Return the default status.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  bool result = systemClass ? systemClassDefault() : userClassDefault();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  trace(classname, systemClass ? "system" : "user", "default", result);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  return result;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
}