1198
1199 // Check that action object understands "Object run()"
1200 Handle h_context;
1201 if (context != NULL) {
1202 h_context = Handle(THREAD, JNIHandles::resolve(context));
1203 bool authorized = is_authorized(h_context, klass, CHECK_NULL);
1204 if (!authorized) {
1205 // Create an unprivileged access control object and call it's run function
1206 // instead.
1207 oop noprivs = create_dummy_access_control_context(CHECK_NULL);
1208 h_context = Handle(THREAD, noprivs);
1209 }
1210 }
1211
1212 // Check that action object understands "Object run()"
1213 Handle object (THREAD, JNIHandles::resolve(action));
1214
1215 // get run() method
1216 Method* m_oop = object->klass()->uncached_lookup_method(
1217 vmSymbols::run_method_name(),
1218 vmSymbols::void_object_signature());
1219 methodHandle m (THREAD, m_oop);
1220 if (m.is_null() || !m->is_method() || !m()->is_public() || m()->is_static()) {
1221 THROW_MSG_0(vmSymbols::java_lang_InternalError(), "No run method");
1222 }
1223
1224 // Stack allocated list of privileged stack elements
1225 PrivilegedElement pi;
1226 if (!vfst.at_end()) {
1227 pi.initialize(&vfst, h_context(), thread->privileged_stack_top(), CHECK_NULL);
1228 thread->set_privileged_stack_top(&pi);
1229 }
1230
1231
1232 // invoke the Object run() in the action object. We cannot use call_interface here, since the static type
1233 // is not really known - it is either java.security.PrivilegedAction or java.security.PrivilegedExceptionAction
1234 Handle pending_exception;
1235 JavaValue result(T_OBJECT);
1236 JavaCallArguments args(object);
1237 JavaCalls::call(&result, m, &args, THREAD);
1238
|
1198
1199 // Check that action object understands "Object run()"
1200 Handle h_context;
1201 if (context != NULL) {
1202 h_context = Handle(THREAD, JNIHandles::resolve(context));
1203 bool authorized = is_authorized(h_context, klass, CHECK_NULL);
1204 if (!authorized) {
1205 // Create an unprivileged access control object and call it's run function
1206 // instead.
1207 oop noprivs = create_dummy_access_control_context(CHECK_NULL);
1208 h_context = Handle(THREAD, noprivs);
1209 }
1210 }
1211
1212 // Check that action object understands "Object run()"
1213 Handle object (THREAD, JNIHandles::resolve(action));
1214
1215 // get run() method
1216 Method* m_oop = object->klass()->uncached_lookup_method(
1217 vmSymbols::run_method_name(),
1218 vmSymbols::void_object_signature(),
1219 false);
1220 methodHandle m (THREAD, m_oop);
1221 if (m.is_null() || !m->is_method() || !m()->is_public() || m()->is_static()) {
1222 THROW_MSG_0(vmSymbols::java_lang_InternalError(), "No run method");
1223 }
1224
1225 // Stack allocated list of privileged stack elements
1226 PrivilegedElement pi;
1227 if (!vfst.at_end()) {
1228 pi.initialize(&vfst, h_context(), thread->privileged_stack_top(), CHECK_NULL);
1229 thread->set_privileged_stack_top(&pi);
1230 }
1231
1232
1233 // invoke the Object run() in the action object. We cannot use call_interface here, since the static type
1234 // is not really known - it is either java.security.PrivilegedAction or java.security.PrivilegedExceptionAction
1235 Handle pending_exception;
1236 JavaValue result(T_OBJECT);
1237 JavaCallArguments args(object);
1238 JavaCalls::call(&result, m, &args, THREAD);
1239
|