< prev index next >

src/hotspot/share/runtime/frame.cpp

Print this page

        

*** 35,44 **** --- 35,45 ---- #include "memory/universe.hpp" #include "oops/markOop.hpp" #include "oops/method.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" + #include "oops/valueKlass.hpp" #include "oops/verifyOopClosure.hpp" #include "prims/methodHandles.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp"
*** 678,688 **** int _max_locals; int _max_stack; public: InterpreterFrameClosure(frame* fr, int max_locals, int max_stack, ! OopClosure* f) { _fr = fr; _max_locals = max_locals; _max_stack = max_stack; _f = f; } --- 679,689 ---- int _max_locals; int _max_stack; public: InterpreterFrameClosure(frame* fr, int max_locals, int max_stack, ! OopClosure* f, BufferedValueClosure* bvt_f) { _fr = fr; _max_locals = max_locals; _max_stack = max_stack; _f = f; }
*** 690,700 **** void offset_do(int offset) { oop* addr; if (offset < _max_locals) { addr = (oop*) _fr->interpreter_frame_local_at(offset); assert((intptr_t*)addr >= _fr->sp(), "must be inside the frame"); ! _f->do_oop(addr); } else { addr = (oop*) _fr->interpreter_frame_expression_stack_at((offset - _max_locals)); // In case of exceptions, the expression stack is invalid and the esp will be reset to express // this condition. Therefore, we call f only if addr is 'inside' the stack (i.e., addr >= esp for Intel). bool in_stack; --- 691,703 ---- void offset_do(int offset) { oop* addr; if (offset < _max_locals) { addr = (oop*) _fr->interpreter_frame_local_at(offset); assert((intptr_t*)addr >= _fr->sp(), "must be inside the frame"); ! if (_f != NULL) { ! _f->do_oop(addr); ! } } else { addr = (oop*) _fr->interpreter_frame_expression_stack_at((offset - _max_locals)); // In case of exceptions, the expression stack is invalid and the esp will be reset to express // this condition. Therefore, we call f only if addr is 'inside' the stack (i.e., addr >= esp for Intel). bool in_stack;
*** 702,712 **** in_stack = (intptr_t*)addr <= _fr->interpreter_frame_tos_address(); } else { in_stack = (intptr_t*)addr >= _fr->interpreter_frame_tos_address(); } if (in_stack) { ! _f->do_oop(addr); } } } int max_locals() { return _max_locals; } --- 705,717 ---- in_stack = (intptr_t*)addr <= _fr->interpreter_frame_tos_address(); } else { in_stack = (intptr_t*)addr >= _fr->interpreter_frame_tos_address(); } if (in_stack) { ! if (_f != NULL) { ! _f->do_oop(addr); ! } } } } int max_locals() { return _max_locals; }
*** 721,731 **** bool _has_receiver; // true if the callee has a receiver frame* _fr; void set(int size, BasicType type) { _offset -= size; ! if (type == T_OBJECT || type == T_ARRAY) oop_offset_do(); } void oop_offset_do() { oop* addr; addr = (oop*)_fr->interpreter_frame_tos_at(_offset); --- 726,736 ---- bool _has_receiver; // true if the callee has a receiver frame* _fr; void set(int size, BasicType type) { _offset -= size; ! if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) oop_offset_do(); } void oop_offset_do() { oop* addr; addr = (oop*)_fr->interpreter_frame_tos_at(_offset);
*** 774,784 **** frame* _fr; OopClosure* _f; void set(int size, BasicType type) { assert (_offset >= 0, "illegal offset"); ! if (type == T_OBJECT || type == T_ARRAY) oop_at_offset_do(_offset); _offset -= size; } void oop_at_offset_do(int offset) { assert (offset >= 0, "illegal offset"); --- 779,789 ---- frame* _fr; OopClosure* _f; void set(int size, BasicType type) { assert (_offset >= 0, "illegal offset"); ! if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) oop_at_offset_do(_offset); _offset -= size; } void oop_at_offset_do(int offset) { assert (offset >= 0, "illegal offset");
*** 875,885 **** oops_interpreted_arguments_do(signature, has_receiver, f); } } } ! InterpreterFrameClosure blk(this, max_locals, m->max_stack(), f); // process locals & expression stack InterpreterOopMap mask; if (query_oop_map_cache) { m->mask_for(bci, &mask); --- 880,890 ---- oops_interpreted_arguments_do(signature, has_receiver, f); } } } ! InterpreterFrameClosure blk(this, max_locals, m->max_stack(), f, NULL); // process locals & expression stack InterpreterOopMap mask; if (query_oop_map_cache) { m->mask_for(bci, &mask);
*** 887,896 **** --- 892,918 ---- OopMapCache::compute_one_oop_map(m, bci, &mask); } mask.iterate_oop(&blk); } + void frame::buffered_values_interpreted_do(BufferedValueClosure* f) { + assert(is_interpreted_frame(), "Not an interpreted frame"); + Thread *thread = Thread::current(); + methodHandle m (thread, interpreter_frame_method()); + jint bci = interpreter_frame_bci(); + + assert(m->is_method(), "checking frame value"); + assert(!m->is_native() && bci >= 0 && bci < m->code_size(), + "invalid bci value"); + + InterpreterFrameClosure blk(this, m->max_locals(), m->max_stack(), NULL, f); + + // process locals & expression stack + InterpreterOopMap mask; + m->mask_for(bci, &mask); + mask.iterate_oop(&blk); + } void frame::oops_interpreted_arguments_do(Symbol* signature, bool has_receiver, OopClosure* f) { InterpretedArgumentOopFinder finder(signature, has_receiver, this, f); finder.oops_do(); }
*** 925,962 **** RegisterMap* _reg_map; int _arg_size; VMRegPair* _regs; // VMReg list of arguments void set(int size, BasicType type) { ! if (type == T_OBJECT || type == T_ARRAY) handle_oop_offset(); _offset += size; } virtual void handle_oop_offset() { // Extract low order register number from register array. // In LP64-land, the high-order bits are valid but unhelpful. VMReg reg = _regs[_offset].first(); oop *loc = _fr.oopmapreg_to_location(reg, _reg_map); _f->do_oop(loc); } public: ! CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr, const RegisterMap* reg_map) : SignatureInfo(signature) { // initialize CompiledArgumentOopFinder _f = f; _offset = 0; _has_receiver = has_receiver; _has_appendix = has_appendix; _fr = fr; _reg_map = (RegisterMap*)reg_map; ! _arg_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0) + (has_appendix ? 1 : 0); ! ! int arg_size; ! _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &arg_size); ! assert(arg_size == _arg_size, "wrong arg size"); } void oops_do() { if (_has_receiver) { handle_oop_offset(); --- 947,981 ---- RegisterMap* _reg_map; int _arg_size; VMRegPair* _regs; // VMReg list of arguments void set(int size, BasicType type) { ! if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) handle_oop_offset(); _offset += size; } virtual void handle_oop_offset() { // Extract low order register number from register array. // In LP64-land, the high-order bits are valid but unhelpful. + assert(_offset < _arg_size, "out of bounds"); VMReg reg = _regs[_offset].first(); oop *loc = _fr.oopmapreg_to_location(reg, _reg_map); _f->do_oop(loc); } public: ! CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr, const RegisterMap* reg_map) : SignatureInfo(signature) { // initialize CompiledArgumentOopFinder _f = f; _offset = 0; _has_receiver = has_receiver; _has_appendix = has_appendix; _fr = fr; _reg_map = (RegisterMap*)reg_map; ! _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &_arg_size); } void oops_do() { if (_has_receiver) { handle_oop_offset();
< prev index next >