diff -r aa7b1ea52413 -r a57907813a83 src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp --- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp Fri Aug 30 20:39:38 2019 +0200 +++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp Mon Sep 02 19:42:46 2019 +0200 @@ -39,11 +39,11 @@ } } -JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, InstanceKlass* k) : - _klass(k), _methodid(id), _line(0), _bci(bci), _type(type) {} +JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, const Method* method) : + _method(method), _methodid(id), _line(0), _bci(bci), _type(type) {} JfrStackFrame::JfrStackFrame(const traceid& id, int bci, int type, int lineno) : - _klass(NULL), _methodid(id), _line(lineno), _bci(bci), _type(type) {} + _method(NULL), _methodid(id), _line(lineno), _bci(bci), _type(type) {} JfrStackTrace::JfrStackTrace(JfrStackFrame* frames, u4 max_frames) : _next(NULL), @@ -77,26 +77,6 @@ } } -void JfrStackTrace::operator=(const JfrStackTrace& trace) { - assert(_next == NULL, "invariant"); - assert(_frames_ownership, "invariant"); - - if (_id == trace._id) { - assert(_hash == trace._hash, "invariant"); - assert(_nr_of_frames == trace._nr_of_frames, "invariant"); - return; - } - _next = NULL; - _id = trace._id; - _hash = trace._hash; - _nr_of_frames = trace._nr_of_frames; - _max_frames = trace._max_frames; - _reached_root = trace._reached_root; - _lineno = trace._lineno; - _written = false; - copy_frames(&_frames, trace._nr_of_frames, trace._frames); -} - template static void write_stacktrace(Writer& w, traceid id, bool reached_root, u4 nr_of_frames, const JfrStackFrame* frames) { w.write((u8)id); @@ -220,7 +200,7 @@ const int lineno = method->line_number_from_bci(bci); // Can we determine if it's inlined? _hash = (_hash << 2) + (unsigned int)(((size_t)mid >> 2) + (bci << 4) + type); - _frames[count] = JfrStackFrame(mid, bci, type, method->constants()->pool_holder()); + _frames[count] = JfrStackFrame(mid, bci, type, method); st.samples_next(); count++; } @@ -231,12 +211,9 @@ } void JfrStackFrame::resolve_lineno() const { - assert(_klass, "no klass pointer"); + assert(_method, "no method pointer"); assert(_line == 0, "already have linenumber"); - const int id_num = _methodid & METHOD_ID_NUM_MASK; - const Method* const method = _klass->method_with_orig_idnum(id_num); - assert(method != NULL, "invariant"); - _line = method->line_number_from_bci(_bci); + _line = _method->line_number_from_bci(_bci); } void JfrStackTrace::resolve_linenos() const { @@ -275,7 +252,7 @@ } // Can we determine if it's inlined? _hash = (_hash << 2) + (unsigned int)(((size_t)mid >> 2) + (bci << 4) + type); - _frames[count] = JfrStackFrame(mid, bci, type, method->constants()->pool_holder()); + _frames[count] = JfrStackFrame(mid, bci, type, method); vfs.next(); count++; }