// Solaris SPARC Compiler1 needs an additional check on the grandparent // of the top_frame when the parent of the top_frame is interpreted and // the grandparent is compiled. However, in this method we do not know // the relationship of the current _frame relative to the top_frame so // we implement a more broad sanity check. When the previous callee is // interpreted and the current sender is compiled, we verify that the // current sender is also walkable. If it is not walkable, then we mark // the current vframeStream as at the end. void vframeStreamForte::forte_next() { // handle frames with inlining if (_mode == compiled_mode && vframeStreamCommon::fill_in_compiled_inlined_sender()) { return; } // handle general case int loop_count = 0; int loop_max = MaxJavaStackTraceDepth * 2; do { loop_count++; // By the time we get here we should never see unsafe but better // safe then segv'd if (loop_count > loop_max || !_frame.safe_for_sender(_thread)) { _mode = at_end_mode; return; } _frame = _frame.sender(&_reg_map); } while (!fill_from_frame()); }
// Iteration void next() { // handle frames with inlining if (_mode == compiled_mode && fill_in_compiled_inlined_sender()) return; // handle general case do { _frame = _frame.sender(&_reg_map); } while (!fill_from_frame()); }
// top-frame will be skipped vframeStream::vframeStream(JavaThread* thread, frame top_frame, bool stop_at_java_call_stub) : vframeStreamCommon(thread) { _stop_at_java_call_stub = stop_at_java_call_stub; // skip top frame, as it may not be at safepoint _frame = top_frame.sender(&_reg_map); while (!fill_from_frame()) { _frame = _frame.sender(&_reg_map); } }
void vframeStreamCommon::next() { // handle frames with inlining #ifndef CORE if (_mode == compiled_mode && fill_in_compiled_inlined_sender()) return; #endif // handle general case nmethod* code = _mode == compiled_mode ? _code : NULL; do { _frame = _frame.sender(&_reg_map, (CodeBlob*)code); code = NULL; // After first iteration, we got no cached nmethod } while (!fill_from_frame()); }
// Constructors vframeStream(JavaThread* thread, bool stop_at_java_call_stub = false) : vframeStreamCommon(thread) { _stop_at_java_call_stub = stop_at_java_call_stub; if (!thread->has_last_Java_frame()) { _mode = at_end_mode; return; } _frame = _thread->last_frame(); while (!fill_from_frame()) { _frame = _frame.sender(&_reg_map); } }
vframeStreamForte::vframeStreamForte(JavaThread *jt, frame fr, bool stop_at_java_call_stub) : vframeStreamCommon(jt) { _stop_at_java_call_stub = stop_at_java_call_stub; _frame = fr; // We must always have a valid frame to start filling bool filled_in = fill_from_frame(); assert(filled_in, "invariant"); }