< prev index next >

src/share/vm/runtime/frame.cpp

Print this page




 950 
 951 class CompiledArgumentOopFinder: public SignatureInfo {
 952  protected:
 953   OopClosure*     _f;
 954   int             _offset;        // the current offset, incremented with each argument
 955   bool            _has_receiver;  // true if the callee has a receiver
 956   bool            _has_appendix;  // true if the call has an appendix
 957   frame           _fr;
 958   RegisterMap*    _reg_map;
 959   int             _arg_size;
 960   VMRegPair*      _regs;        // VMReg list of arguments
 961 
 962   void set(int size, BasicType type) {
 963     if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) handle_oop_offset();
 964     _offset += size;
 965   }
 966 
 967   virtual void handle_oop_offset() {
 968     // Extract low order register number from register array.
 969     // In LP64-land, the high-order bits are valid but unhelpful.

 970     VMReg reg = _regs[_offset].first();
 971     oop *loc = _fr.oopmapreg_to_location(reg, _reg_map);
 972     _f->do_oop(loc);
 973   }
 974 
 975  public:
 976   CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr,  const RegisterMap* reg_map)
 977     : SignatureInfo(signature) {
 978 
 979     // initialize CompiledArgumentOopFinder
 980     _f         = f;
 981     _offset    = 0;
 982     _has_receiver = has_receiver;
 983     _has_appendix = has_appendix;
 984     _fr        = fr;
 985     _reg_map   = (RegisterMap*)reg_map;
 986     _arg_size  = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0) + (has_appendix ? 1 : 0);
 987 
 988     int arg_size;
 989     _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &arg_size);
 990     assert(arg_size == _arg_size, "wrong arg size");
 991   }
 992 
 993   void oops_do() {
 994     if (_has_receiver) {
 995       handle_oop_offset();
 996       _offset++;
 997     }
 998     iterate_parameters();
 999     if (_has_appendix) {
1000       handle_oop_offset();
1001       _offset++;
1002     }
1003   }
1004 };
1005 
1006 void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix,
1007                                        const RegisterMap* reg_map, OopClosure* f) {
1008   ResourceMark rm;
1009   CompiledArgumentOopFinder finder(signature, has_receiver, has_appendix, f, *this, reg_map);
1010   finder.oops_do();




 950 
 951 class CompiledArgumentOopFinder: public SignatureInfo {
 952  protected:
 953   OopClosure*     _f;
 954   int             _offset;        // the current offset, incremented with each argument
 955   bool            _has_receiver;  // true if the callee has a receiver
 956   bool            _has_appendix;  // true if the call has an appendix
 957   frame           _fr;
 958   RegisterMap*    _reg_map;
 959   int             _arg_size;
 960   VMRegPair*      _regs;        // VMReg list of arguments
 961 
 962   void set(int size, BasicType type) {
 963     if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) handle_oop_offset();
 964     _offset += size;
 965   }
 966 
 967   virtual void handle_oop_offset() {
 968     // Extract low order register number from register array.
 969     // In LP64-land, the high-order bits are valid but unhelpful.
 970     assert(_offset < _arg_size, "out of bounds");
 971     VMReg reg = _regs[_offset].first();
 972     oop *loc = _fr.oopmapreg_to_location(reg, _reg_map);
 973     _f->do_oop(loc);
 974   }
 975 
 976  public:
 977   CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr, const RegisterMap* reg_map)
 978     : SignatureInfo(signature) {
 979 
 980     // initialize CompiledArgumentOopFinder
 981     _f         = f;
 982     _offset    = 0;
 983     _has_receiver = has_receiver;
 984     _has_appendix = has_appendix;
 985     _fr        = fr;
 986     _reg_map   = (RegisterMap*)reg_map;
 987     _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &_arg_size);




 988   }
 989 
 990   void oops_do() {
 991     if (_has_receiver) {
 992       handle_oop_offset();
 993       _offset++;
 994     }
 995     iterate_parameters();
 996     if (_has_appendix) {
 997       handle_oop_offset();
 998       _offset++;
 999     }
1000   }
1001 };
1002 
1003 void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix,
1004                                        const RegisterMap* reg_map, OopClosure* f) {
1005   ResourceMark rm;
1006   CompiledArgumentOopFinder finder(signature, has_receiver, has_appendix, f, *this, reg_map);
1007   finder.oops_do();


< prev index next >