annotate src/hotspot/share/classfile/javaAssertions.hpp @ 54048:744dc9c33676

8217417: Decorator name typo: C2_TIGHLY_COUPLED_ALLOC Summary: Fixed typo in decorator name, variables, and comments. Reviewed-by: tschatzl
author kbarrett
date Mon, 11 Mar 2019 02:05:07 -0400
parents 71c04702a3d5
children
rev   line source
duke@1 1 /*
coleenp@53244 2 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
coleenp@53244 25 #ifndef SHARE_CLASSFILE_JAVAASSERTIONS_HPP
coleenp@53244 26 #define SHARE_CLASSFILE_JAVAASSERTIONS_HPP
stefank@7397 27
stefank@7397 28 #include "oops/objArrayOop.hpp"
stefank@7397 29 #include "oops/typeArrayOop.hpp"
stefank@7397 30 #include "utilities/exceptions.hpp"
stefank@7397 31 #include "utilities/ostream.hpp"
stefank@7397 32
duke@1 33 class JavaAssertions: AllStatic {
duke@1 34 public:
duke@1 35 static inline bool userClassDefault();
duke@1 36 static inline void setUserClassDefault(bool enabled);
duke@1 37 static inline bool systemClassDefault();
duke@1 38 static inline void setSystemClassDefault(bool enabled);
duke@1 39
duke@1 40 // Add a command-line option. A name ending in "..." applies to a package and
duke@1 41 // any subpackages; other names apply to a single class.
duke@1 42 static void addOption(const char* name, bool enable);
duke@1 43
duke@1 44 // Return true if command-line options have enabled assertions for the named
duke@1 45 // class. Should be called only after all command-line options have been
duke@1 46 // processed. Note: this only consults command-line options and does not
duke@1 47 // account for any dynamic changes to assertion status.
duke@1 48 static bool enabled(const char* classname, bool systemClass);
duke@1 49
duke@1 50 // Create an instance of java.lang.AssertionStatusDirectives and fill in the
duke@1 51 // fields based on the command-line assertion options.
duke@1 52 static oop createAssertionStatusDirectives(TRAPS);
duke@1 53
duke@1 54 private:
duke@1 55 class OptionList;
duke@1 56 static void fillJavaArrays(const OptionList* p, int len, objArrayHandle names,
duke@1 57 typeArrayHandle status, TRAPS);
duke@1 58
duke@1 59 static inline void trace(const char* name, const char* typefound,
duke@1 60 const char* namefound, bool enabled);
duke@1 61
duke@1 62 static inline OptionList* match_class(const char* classname);
duke@1 63 static OptionList* match_package(const char* classname);
duke@1 64
duke@1 65 static bool _userDefault; // User class default (-ea/-da).
duke@1 66 static bool _sysDefault; // System class default (-esa/-dsa).
duke@1 67 static OptionList* _classes; // Options for classes.
duke@1 68 static OptionList* _packages; // Options for package trees.
duke@1 69 };
duke@1 70
zgu@13195 71 class JavaAssertions::OptionList: public CHeapObj<mtClass> {
duke@1 72 public:
duke@1 73 inline OptionList(const char* name, bool enable, OptionList* next);
duke@1 74
duke@1 75 inline const char* name() const { return _name; }
duke@1 76 inline bool enabled() const { return _enabled; }
duke@1 77 inline OptionList* next() const { return _next; }
duke@1 78
duke@1 79 static int count(OptionList* p);
duke@1 80
duke@1 81 private:
duke@1 82 const char* _name;
duke@1 83 OptionList* _next;
duke@1 84 bool _enabled;
duke@1 85 };
duke@1 86
duke@1 87 inline bool JavaAssertions::userClassDefault() {
duke@1 88 return _userDefault;
duke@1 89 }
duke@1 90
duke@1 91 inline void JavaAssertions::setUserClassDefault(bool enabled) {
duke@1 92 if (TraceJavaAssertions)
duke@1 93 tty->print_cr("JavaAssertions::setUserClassDefault(%d)", enabled);
duke@1 94 _userDefault = enabled;
duke@1 95 }
duke@1 96
duke@1 97 inline bool JavaAssertions::systemClassDefault() {
duke@1 98 return _sysDefault;
duke@1 99 }
duke@1 100
duke@1 101 inline void JavaAssertions::setSystemClassDefault(bool enabled) {
duke@1 102 if (TraceJavaAssertions)
duke@1 103 tty->print_cr("JavaAssertions::setSystemClassDefault(%d)", enabled);
duke@1 104 _sysDefault = enabled;
duke@1 105 }
stefank@7397 106
coleenp@53244 107 #endif // SHARE_CLASSFILE_JAVAASSERTIONS_HPP