103 if (resolved_klass->is_objArray_klass()) {
104 // Find the element klass, if this is an array.
105 resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass();
106 }
107 if (resolved_klass->is_instance_klass()) {
108 Reflection::VerifyClassAccessResults result =
109 Reflection::verify_class_access(accessing_klass, InstanceKlass::cast(resolved_klass), true);
110 return result == Reflection::ACCESS_OK;
111 }
112 return true;
113 }
114
115 // ------------------------------------------------------------------
116 Klass* JVMCIEnv::get_klass_by_name_impl(Klass* accessing_klass,
117 const constantPoolHandle& cpool,
118 Symbol* sym,
119 bool require_local) {
120 JVMCI_EXCEPTION_CONTEXT;
121
122 // Now we need to check the SystemDictionary
123 if ((sym->char_at(0) == 'L' || sym->char_at(0) == 'Q') &&
124 sym->char_at(sym->utf8_length()-1) == ';') {
125 // This is a name from a signature. Strip off the trimmings.
126 // Call recursive to keep scope of strippedsym.
127 TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1,
128 sym->utf8_length()-2,
129 CHECK_NULL);
130 return get_klass_by_name_impl(accessing_klass, cpool, strippedsym, require_local);
131 }
132
133 Handle loader(THREAD, (oop)NULL);
134 Handle domain(THREAD, (oop)NULL);
135 if (accessing_klass != NULL) {
136 loader = Handle(THREAD, accessing_klass->class_loader());
137 domain = Handle(THREAD, accessing_klass->protection_domain());
138 }
139
140 Klass* found_klass = NULL;
141 {
142 ttyUnlocker ttyul; // release tty lock to avoid ordering problems
143 MutexLocker ml(Compile_lock);
144 if (!require_local) {
|
103 if (resolved_klass->is_objArray_klass()) {
104 // Find the element klass, if this is an array.
105 resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass();
106 }
107 if (resolved_klass->is_instance_klass()) {
108 Reflection::VerifyClassAccessResults result =
109 Reflection::verify_class_access(accessing_klass, InstanceKlass::cast(resolved_klass), true);
110 return result == Reflection::ACCESS_OK;
111 }
112 return true;
113 }
114
115 // ------------------------------------------------------------------
116 Klass* JVMCIEnv::get_klass_by_name_impl(Klass* accessing_klass,
117 const constantPoolHandle& cpool,
118 Symbol* sym,
119 bool require_local) {
120 JVMCI_EXCEPTION_CONTEXT;
121
122 // Now we need to check the SystemDictionary
123 if ((sym->starts_with('L') || sym->starts_with('Q')) &&
124 sym->ends_with(';')) {
125 // This is a name from a signature. Strip off the trimmings.
126 // Call recursive to keep scope of strippedsym.
127 TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1,
128 sym->utf8_length()-2,
129 CHECK_NULL);
130 return get_klass_by_name_impl(accessing_klass, cpool, strippedsym, require_local);
131 }
132
133 Handle loader(THREAD, (oop)NULL);
134 Handle domain(THREAD, (oop)NULL);
135 if (accessing_klass != NULL) {
136 loader = Handle(THREAD, accessing_klass->class_loader());
137 domain = Handle(THREAD, accessing_klass->protection_domain());
138 }
139
140 Klass* found_klass = NULL;
141 {
142 ttyUnlocker ttyul; // release tty lock to avoid ordering problems
143 MutexLocker ml(Compile_lock);
144 if (!require_local) {
|