comparison src/share/vm/prims/stackwalk.cpp @ 13526:f5dd157e3889

8186439: [MVT] ClassFileParser should ignore JVM_ACC_VALUE for class file version < 53.1 Reviewed-by: dsimms
author thartmann
date Mon, 21 Aug 2017 12:26:21 +0200
parents da4c9eef4316
children
comparison
equal deleted inserted replaced
12:6e64cad7fbe3 13:8927a4584902
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp" 26 #include "classfile/javaClasses.hpp"
27 #include "classfile/javaClasses.inline.hpp" 27 #include "classfile/javaClasses.inline.hpp"
28 #include "classfile/vmSymbols.hpp" 28 #include "classfile/vmSymbols.hpp"
29 #include "logging/log.hpp" 29 #include "logging/log.hpp"
30 #include "logging/logStream.hpp"
30 #include "memory/oopFactory.hpp" 31 #include "memory/oopFactory.hpp"
31 #include "oops/oop.inline.hpp" 32 #include "oops/oop.inline.hpp"
32 #include "oops/objArrayOop.inline.hpp" 33 #include "oops/objArrayOop.inline.hpp"
33 #include "prims/stackwalk.hpp" 34 #include "prims/stackwalk.hpp"
34 #include "runtime/globals.hpp" 35 #include "runtime/globals.hpp"
119 120
120 // skip hidden frames for default StackWalker option (i.e. SHOW_HIDDEN_FRAMES 121 // skip hidden frames for default StackWalker option (i.e. SHOW_HIDDEN_FRAMES
121 // not set) and when StackWalker::getCallerClass is called 122 // not set) and when StackWalker::getCallerClass is called
122 if (!ShowHiddenFrames && (skip_hidden_frames(mode) || get_caller_class(mode))) { 123 if (!ShowHiddenFrames && (skip_hidden_frames(mode) || get_caller_class(mode))) {
123 if (method->is_hidden()) { 124 if (method->is_hidden()) {
124 if (log_is_enabled(Debug, stackwalk)) { 125 LogTarget(Debug, stackwalk) lt;
126 if (lt.is_enabled()) {
125 ResourceMark rm(THREAD); 127 ResourceMark rm(THREAD);
126 outputStream* st = Log(stackwalk)::debug_stream(); 128 LogStream ls(lt);
127 st->print(" hidden method: "); 129 ls.print(" hidden method: ");
128 method->print_short_name(st); 130 method->print_short_name(&ls);
129 st->cr(); 131 ls.cr();
130 } 132 }
131 continue; 133 continue;
132 } 134 }
133 } 135 }
134 136
135 int index = end_index++; 137 int index = end_index++;
136 if (log_is_enabled(Debug, stackwalk)) { 138 LogTarget(Debug, stackwalk) lt;
139 if (lt.is_enabled()) {
137 ResourceMark rm(THREAD); 140 ResourceMark rm(THREAD);
138 outputStream* st = Log(stackwalk)::debug_stream(); 141 LogStream ls(lt);
139 st->print(" %d: frame method: ", index); 142 ls.print(" %d: frame method: ", index);
140 method->print_short_name(st); 143 method->print_short_name(&ls);
141 st->print_cr(" bci=%d", stream.bci()); 144 ls.print_cr(" bci=%d", stream.bci());
142 } 145 }
143 146
144 if (!need_method_info(mode) && get_caller_class(mode) && 147 if (!need_method_info(mode) && get_caller_class(mode) &&
145 index == start_index && method->caller_sensitive()) { 148 index == start_index && method->caller_sensitive()) {
146 ResourceMark rm(THREAD); 149 ResourceMark rm(THREAD);
362 if (ik != stackWalker_klass && 365 if (ik != stackWalker_klass &&
363 ik != abstractStackWalker_klass && ik->super() != abstractStackWalker_klass) { 366 ik != abstractStackWalker_klass && ik->super() != abstractStackWalker_klass) {
364 break; 367 break;
365 } 368 }
366 369
367 if (log_is_enabled(Debug, stackwalk)) { 370 LogTarget(Debug, stackwalk) lt;
371 if (lt.is_enabled()) {
368 ResourceMark rm(THREAD); 372 ResourceMark rm(THREAD);
369 outputStream* st = Log(stackwalk)::debug_stream(); 373 LogStream ls(lt);
370 st->print(" skip "); 374 ls.print(" skip ");
371 stream.method()->print_short_name(st); 375 stream.method()->print_short_name(&ls);
372 st->cr(); 376 ls.cr();
373 } 377 }
374 stream.next(); 378 stream.next();
375 } 379 }
376 380
377 // stack frame has been traversed individually and resume stack walk 381 // stack frame has been traversed individually and resume stack walk
378 // from the stack frame at depth == skip_frames. 382 // from the stack frame at depth == skip_frames.
379 for (int n=0; n < skip_frames && !stream.at_end(); stream.next(), n++) { 383 for (int n=0; n < skip_frames && !stream.at_end(); stream.next(), n++) {
380 if (log_is_enabled(Debug, stackwalk)) { 384 LogTarget(Debug, stackwalk) lt;
385 if (lt.is_enabled()) {
381 ResourceMark rm(THREAD); 386 ResourceMark rm(THREAD);
382 outputStream* st = Log(stackwalk)::debug_stream(); 387 LogStream ls(lt);
383 st->print(" skip "); 388 ls.print(" skip ");
384 stream.method()->print_short_name(st); 389 stream.method()->print_short_name(&ls);
385 st->cr(); 390 ls.cr();
386 } 391 }
387 } 392 }
388 } 393 }
389 394
390 int end_index = start_index; 395 int end_index = start_index;