< prev index next >

src/share/vm/runtime/frame.cpp

Print this page




 989 
 990 class CompiledArgumentOopFinder: public SignatureInfo {
 991  protected:
 992   OopClosure*     _f;
 993   int             _offset;        // the current offset, incremented with each argument
 994   bool            _has_receiver;  // true if the callee has a receiver
 995   bool            _has_appendix;  // true if the call has an appendix
 996   frame           _fr;
 997   RegisterMap*    _reg_map;
 998   int             _arg_size;
 999   VMRegPair*      _regs;        // VMReg list of arguments
1000 
1001   void set(int size, BasicType type) {
1002     if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) handle_oop_offset();
1003     _offset += size;
1004   }
1005 
1006   virtual void handle_oop_offset() {
1007     // Extract low order register number from register array.
1008     // In LP64-land, the high-order bits are valid but unhelpful.

1009     VMReg reg = _regs[_offset].first();
1010     oop *loc = _fr.oopmapreg_to_location(reg, _reg_map);
1011     _f->do_oop(loc);
1012   }
1013 
1014  public:
1015   CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr,  const RegisterMap* reg_map)
1016     : SignatureInfo(signature) {
1017 
1018     // initialize CompiledArgumentOopFinder
1019     _f         = f;
1020     _offset    = 0;
1021     _has_receiver = has_receiver;
1022     _has_appendix = has_appendix;
1023     _fr        = fr;
1024     _reg_map   = (RegisterMap*)reg_map;
1025     _arg_size  = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0) + (has_appendix ? 1 : 0);
1026 
1027     int arg_size;
1028     _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &arg_size);
1029     assert(arg_size == _arg_size, "wrong arg size");
1030   }
1031 
1032   void oops_do() {
1033     if (_has_receiver) {
1034       handle_oop_offset();
1035       _offset++;
1036     }
1037     iterate_parameters();
1038     if (_has_appendix) {
1039       handle_oop_offset();
1040       _offset++;
1041     }
1042   }
1043 };
1044 
1045 void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix,
1046                                        const RegisterMap* reg_map, OopClosure* f) {
1047   ResourceMark rm;
1048   CompiledArgumentOopFinder finder(signature, has_receiver, has_appendix, f, *this, reg_map);
1049   finder.oops_do();




 989 
 990 class CompiledArgumentOopFinder: public SignatureInfo {
 991  protected:
 992   OopClosure*     _f;
 993   int             _offset;        // the current offset, incremented with each argument
 994   bool            _has_receiver;  // true if the callee has a receiver
 995   bool            _has_appendix;  // true if the call has an appendix
 996   frame           _fr;
 997   RegisterMap*    _reg_map;
 998   int             _arg_size;
 999   VMRegPair*      _regs;        // VMReg list of arguments
1000 
1001   void set(int size, BasicType type) {
1002     if (type == T_OBJECT || type == T_ARRAY || type == T_VALUETYPE) handle_oop_offset();
1003     _offset += size;
1004   }
1005 
1006   virtual void handle_oop_offset() {
1007     // Extract low order register number from register array.
1008     // In LP64-land, the high-order bits are valid but unhelpful.
1009     assert(_offset < _arg_size, "out of bounds");
1010     VMReg reg = _regs[_offset].first();
1011     oop *loc = _fr.oopmapreg_to_location(reg, _reg_map);
1012     _f->do_oop(loc);
1013   }
1014 
1015  public:
1016   CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr, const RegisterMap* reg_map)
1017     : SignatureInfo(signature) {
1018 
1019     // initialize CompiledArgumentOopFinder
1020     _f         = f;
1021     _offset    = 0;
1022     _has_receiver = has_receiver;
1023     _has_appendix = has_appendix;
1024     _fr        = fr;
1025     _reg_map   = (RegisterMap*)reg_map;
1026     _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &_arg_size);




1027   }
1028 
1029   void oops_do() {
1030     if (_has_receiver) {
1031       handle_oop_offset();
1032       _offset++;
1033     }
1034     iterate_parameters();
1035     if (_has_appendix) {
1036       handle_oop_offset();
1037       _offset++;
1038     }
1039   }
1040 };
1041 
1042 void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix,
1043                                        const RegisterMap* reg_map, OopClosure* f) {
1044   ResourceMark rm;
1045   CompiledArgumentOopFinder finder(signature, has_receiver, has_appendix, f, *this, reg_map);
1046   finder.oops_do();


< prev index next >