src/share/vm/runtime/vframe.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/vframe.cpp	Mon Mar 25 16:56:08 2013
--- new/src/share/vm/runtime/vframe.cpp	Mon Mar 25 16:56:08 2013

*** 389,433 **** --- 389,420 ---- // Step back n frames, skip any pseudo frames in between. // This function is used in Class.forName, Class.newInstance, Method.Invoke, // AccessController.doPrivileged. void vframeStreamCommon::security_get_caller_frame(int depth) { ! bool use_new_reflection = JDK_Version::is_gte_jdk14x_version() && UseNewReflection; ! while (!at_end()) { ! if (Universe::reflect_invoke_cache()->is_same_method(method())) { // This is Method.invoke() -- skip it } else if (use_new_reflection && method()->method_holder() ->is_subclass_of(SystemDictionary::reflect_MethodAccessorImpl_klass())) { // This is an auxilary frame -- skip it } else if (method()->is_method_handle_intrinsic() || method()->is_compiled_lambda_form()) { // This is an internal adapter frame for method handles -- skip it } else { // This is non-excluded frame, we need to count it against the depth if (depth-- <= 0) { // we have reached the desired depth, we are done break; ! assert(depth >= 0, err_msg("invalid depth: %d", depth)); + for (int n = 0; !at_end(); security_next()) { ! if (!method()->is_ignored_by_security_stack_walk()) { ! if (n == depth) { + // We have reached the desired depth; return. + return; + } + n++; // this is a non-skipped frame; count it against the depth } } + // NOTE: At this point there were not enough frames on the stack + // to walk to depth. Callers of this method have to check for at_end. + } + + + void vframeStreamCommon::security_next() { if (method()->is_prefixed_native()) { skip_prefixed_method_and_wrappers(); + skip_prefixed_method_and_wrappers(); // calls next() } else { next(); } } void vframeStreamCommon::skip_prefixed_method_and_wrappers() { ResourceMark rm;

src/share/vm/runtime/vframe.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File