79 // JavaAssertion::enabled(), but that is done once per loaded class.
80 for (int i = 0; i < len; ++i) {
81 if (name_copy[i] == '.') name_copy[i] = '/';
82 }
83
84 if (TraceJavaAssertions) {
85 tty->print_cr("JavaAssertions: adding %s %s=%d",
86 head == &_classes ? "class" : "package",
87 name_copy[0] != '\0' ? name_copy : "'default'",
88 enable);
89 }
90
91 // Prepend a new item to the list. Items added later take precedence, so
92 // prepending allows us to stop searching the list after the first match.
93 *head = new OptionList(name_copy, enable, *head);
94 }
95
96 oop JavaAssertions::createAssertionStatusDirectives(TRAPS) {
97 Symbol* asd_sym = vmSymbols::java_lang_AssertionStatusDirectives();
98 Klass* k = SystemDictionary::resolve_or_fail(asd_sym, true, CHECK_NULL);
99 instanceKlassHandle asd_klass (THREAD, k);
100 asd_klass->initialize(CHECK_NULL);
101 Handle h = asd_klass->allocate_instance_handle(CHECK_NULL);
102
103 int len;
104 typeArrayOop t;
105 len = OptionList::count(_packages);
106 objArrayOop pn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL);
107 objArrayHandle pkgNames (THREAD, pn);
108 t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL);
109 typeArrayHandle pkgEnabled(THREAD, t);
110 fillJavaArrays(_packages, len, pkgNames, pkgEnabled, CHECK_NULL);
111
112 len = OptionList::count(_classes);
113 objArrayOop cn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL);
114 objArrayHandle classNames (THREAD, cn);
115 t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL);
116 typeArrayHandle classEnabled(THREAD, t);
117 fillJavaArrays(_classes, len, classNames, classEnabled, CHECK_NULL);
118
119 java_lang_AssertionStatusDirectives::set_packages(h(), pkgNames());
|
79 // JavaAssertion::enabled(), but that is done once per loaded class.
80 for (int i = 0; i < len; ++i) {
81 if (name_copy[i] == '.') name_copy[i] = '/';
82 }
83
84 if (TraceJavaAssertions) {
85 tty->print_cr("JavaAssertions: adding %s %s=%d",
86 head == &_classes ? "class" : "package",
87 name_copy[0] != '\0' ? name_copy : "'default'",
88 enable);
89 }
90
91 // Prepend a new item to the list. Items added later take precedence, so
92 // prepending allows us to stop searching the list after the first match.
93 *head = new OptionList(name_copy, enable, *head);
94 }
95
96 oop JavaAssertions::createAssertionStatusDirectives(TRAPS) {
97 Symbol* asd_sym = vmSymbols::java_lang_AssertionStatusDirectives();
98 Klass* k = SystemDictionary::resolve_or_fail(asd_sym, true, CHECK_NULL);
99 InstanceKlass* asd_klass = InstanceKlass::cast(k);
100 asd_klass->initialize(CHECK_NULL);
101 Handle h = asd_klass->allocate_instance_handle(CHECK_NULL);
102
103 int len;
104 typeArrayOop t;
105 len = OptionList::count(_packages);
106 objArrayOop pn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL);
107 objArrayHandle pkgNames (THREAD, pn);
108 t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL);
109 typeArrayHandle pkgEnabled(THREAD, t);
110 fillJavaArrays(_packages, len, pkgNames, pkgEnabled, CHECK_NULL);
111
112 len = OptionList::count(_classes);
113 objArrayOop cn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL);
114 objArrayHandle classNames (THREAD, cn);
115 t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL);
116 typeArrayHandle classEnabled(THREAD, t);
117 fillJavaArrays(_classes, len, classNames, classEnabled, CHECK_NULL);
118
119 java_lang_AssertionStatusDirectives::set_packages(h(), pkgNames());
|