/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/javaAssertions.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/oopFactory.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
OptionList* next) {
}
int rc;
return rc;
}
// Copy the name. The storage needs to exist for the the lifetime of the vm;
// it is never freed, so will be leaked (along with other option strings -
// Figure out which list the new item should go on. Names that end in "..."
// go on the package tree list.
// Delete the "...".
len -= 3;
}
// when copying to java in createJavaAssertionStatusDirectives, but that
// should happen only once. Alternative would require that
// JVM_DesiredAssertionStatus pass the external_name() to
// JavaAssertion::enabled(), but that is done once per loaded class.
for (int i = 0; i < len; ++i) {
}
if (TraceJavaAssertions) {
enable);
}
// Prepend a new item to the list. Items added later take precedence, so
// prepending allows us to stop searching the list after the first match.
}
int len;
typeArrayOop t;
return h();
}
// Fill in the parallel names and enabled (boolean) arrays. Start at the end
// of the array and work backwards, so the order of items in the arrays
// matches the order on the command line (the list is in reverse order, since
// it was created by prepending successive items from the command line).
int index;
}
}
inline JavaAssertions::OptionList*
return p;
}
}
return 0;
}
// Search the package list for any items that apply to classname. Each
// sub-package in classname is checked, from most-specific to least, until one
// is found.
if (_packages == 0) return 0;
// Find the length of the "most-specific" package in classname. If classname
// does not include a package, length will be 0 which will match items for the
// default package (from options "-ea:..." or "-da:...").
do {
return p;
}
}
// Find the length of the next package, taking care to avoid decrementing
// past 0 (len is unsigned).
} while (len > 0);
return 0;
}
if (TraceJavaAssertions) {
}
}
// This will be slow if the number of assertion options on the command line is
// large--it traverses two lists, one of them multiple times. Could use a
// single n-ary tree instead of lists if someone ever notices.
// First check options that apply to classes. If we find a match we're done.
OptionList* p;
if (p = match_class(classname)) {
return p->enabled();
}
// Now check packages, from most specific to least.
if (p = match_package(classname)) {
return p->enabled();
}
// No match. Return the default status.
return result;
}