790 addr = (oop*)_fr->interpreter_frame_tos_at(_offset); |
790 addr = (oop*)_fr->interpreter_frame_tos_at(_offset); |
791 _f->do_oop(addr); |
791 _f->do_oop(addr); |
792 } |
792 } |
793 |
793 |
794 public: |
794 public: |
795 InterpretedArgumentOopFinder(symbolHandle signature, bool has_receiver, frame* fr, OopClosure* f) : SignatureInfo(signature), _has_receiver(has_receiver) { |
795 InterpretedArgumentOopFinder(Symbol* signature, bool has_receiver, frame* fr, OopClosure* f) : SignatureInfo(signature), _has_receiver(has_receiver) { |
796 // compute size of arguments |
796 // compute size of arguments |
797 int args_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); |
797 int args_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); |
798 assert(!fr->is_interpreted_frame() || |
798 assert(!fr->is_interpreted_frame() || |
799 args_size <= fr->interpreter_frame_expression_stack_size(), |
799 args_size <= fr->interpreter_frame_expression_stack_size(), |
800 "args cannot be on stack anymore"); |
800 "args cannot be on stack anymore"); |
844 oop* addr = (oop*) _fr->entry_frame_argument_at(offset); |
844 oop* addr = (oop*) _fr->entry_frame_argument_at(offset); |
845 _f->do_oop(addr); |
845 _f->do_oop(addr); |
846 } |
846 } |
847 |
847 |
848 public: |
848 public: |
849 EntryFrameOopFinder(frame* frame, symbolHandle signature, bool is_static) : SignatureInfo(signature) { |
849 EntryFrameOopFinder(frame* frame, Symbol* signature, bool is_static) : SignatureInfo(signature) { |
850 _f = NULL; // will be set later |
850 _f = NULL; // will be set later |
851 _fr = frame; |
851 _fr = frame; |
852 _is_static = is_static; |
852 _is_static = is_static; |
853 _offset = ArgumentSizeComputer(signature).size() - 1; // last parameter is at index 0 |
853 _offset = ArgumentSizeComputer(signature).size() - 1; // last parameter is at index 0 |
854 } |
854 } |
859 iterate_parameters(); |
859 iterate_parameters(); |
860 } |
860 } |
861 |
861 |
862 }; |
862 }; |
863 |
863 |
864 oop* frame::interpreter_callee_receiver_addr(symbolHandle signature) { |
864 oop* frame::interpreter_callee_receiver_addr(Symbol* signature) { |
865 ArgumentSizeComputer asc(signature); |
865 ArgumentSizeComputer asc(signature); |
866 int size = asc.size(); |
866 int size = asc.size(); |
867 return (oop *)interpreter_frame_tos_at(size); |
867 return (oop *)interpreter_frame_tos_at(size); |
868 } |
868 } |
869 |
869 |
920 } |
920 } |
921 #endif // PPC |
921 #endif // PPC |
922 |
922 |
923 int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals(); |
923 int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals(); |
924 |
924 |
925 symbolHandle signature; |
925 Symbol* signature = NULL; |
926 bool has_receiver = false; |
926 bool has_receiver = false; |
927 |
927 |
928 // Process a callee's arguments if we are at a call site |
928 // Process a callee's arguments if we are at a call site |
929 // (i.e., if we are at an invoke bytecode) |
929 // (i.e., if we are at an invoke bytecode) |
930 // This is used sometimes for calling into the VM, not for another |
930 // This is used sometimes for calling into the VM, not for another |
931 // interpreted or compiled frame. |
931 // interpreted or compiled frame. |
932 if (!m->is_native()) { |
932 if (!m->is_native()) { |
933 Bytecode_invoke call = Bytecode_invoke_check(m, bci); |
933 Bytecode_invoke call = Bytecode_invoke_check(m, bci); |
934 if (call.is_valid()) { |
934 if (call.is_valid()) { |
935 signature = symbolHandle(thread, call.signature()); |
935 signature = call.signature(); |
936 has_receiver = call.has_receiver(); |
936 has_receiver = call.has_receiver(); |
937 if (map->include_argument_oops() && |
937 if (map->include_argument_oops() && |
938 interpreter_frame_expression_stack_size() > 0) { |
938 interpreter_frame_expression_stack_size() > 0) { |
939 ResourceMark rm(thread); // is this right ??? |
939 ResourceMark rm(thread); // is this right ??? |
940 // we are at a call site & the expression stack is not empty |
940 // we are at a call site & the expression stack is not empty |
963 } |
963 } |
964 mask.iterate_oop(&blk); |
964 mask.iterate_oop(&blk); |
965 } |
965 } |
966 |
966 |
967 |
967 |
968 void frame::oops_interpreted_arguments_do(symbolHandle signature, bool has_receiver, OopClosure* f) { |
968 void frame::oops_interpreted_arguments_do(Symbol* signature, bool has_receiver, OopClosure* f) { |
969 InterpretedArgumentOopFinder finder(signature, has_receiver, this, f); |
969 InterpretedArgumentOopFinder finder(signature, has_receiver, this, f); |
970 finder.oops_do(); |
970 finder.oops_do(); |
971 } |
971 } |
972 |
972 |
973 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { |
973 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { |
1012 oop *loc = _fr.oopmapreg_to_location(reg, _reg_map); |
1012 oop *loc = _fr.oopmapreg_to_location(reg, _reg_map); |
1013 _f->do_oop(loc); |
1013 _f->do_oop(loc); |
1014 } |
1014 } |
1015 |
1015 |
1016 public: |
1016 public: |
1017 CompiledArgumentOopFinder(symbolHandle signature, bool has_receiver, OopClosure* f, frame fr, const RegisterMap* reg_map) |
1017 CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, OopClosure* f, frame fr, const RegisterMap* reg_map) |
1018 : SignatureInfo(signature) { |
1018 : SignatureInfo(signature) { |
1019 |
1019 |
1020 // initialize CompiledArgumentOopFinder |
1020 // initialize CompiledArgumentOopFinder |
1021 _f = f; |
1021 _f = f; |
1022 _offset = 0; |
1022 _offset = 0; |
1024 _fr = fr; |
1024 _fr = fr; |
1025 _reg_map = (RegisterMap*)reg_map; |
1025 _reg_map = (RegisterMap*)reg_map; |
1026 _arg_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); |
1026 _arg_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0); |
1027 |
1027 |
1028 int arg_size; |
1028 int arg_size; |
1029 _regs = SharedRuntime::find_callee_arguments(signature(), has_receiver, &arg_size); |
1029 _regs = SharedRuntime::find_callee_arguments(signature, has_receiver, &arg_size); |
1030 assert(arg_size == _arg_size, "wrong arg size"); |
1030 assert(arg_size == _arg_size, "wrong arg size"); |
1031 } |
1031 } |
1032 |
1032 |
1033 void oops_do() { |
1033 void oops_do() { |
1034 if (_has_receiver) { |
1034 if (_has_receiver) { |
1037 } |
1037 } |
1038 iterate_parameters(); |
1038 iterate_parameters(); |
1039 } |
1039 } |
1040 }; |
1040 }; |
1041 |
1041 |
1042 void frame::oops_compiled_arguments_do(symbolHandle signature, bool has_receiver, const RegisterMap* reg_map, OopClosure* f) { |
1042 void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, const RegisterMap* reg_map, OopClosure* f) { |
1043 ResourceMark rm; |
1043 ResourceMark rm; |
1044 CompiledArgumentOopFinder finder(signature, has_receiver, f, *this, reg_map); |
1044 CompiledArgumentOopFinder finder(signature, has_receiver, f, *this, reg_map); |
1045 finder.oops_do(); |
1045 finder.oops_do(); |
1046 } |
1046 } |
1047 |
1047 |
1097 assert(map != NULL, "map must be set"); |
1097 assert(map != NULL, "map must be set"); |
1098 if (map->include_argument_oops()) { |
1098 if (map->include_argument_oops()) { |
1099 // must collect argument oops, as nobody else is doing it |
1099 // must collect argument oops, as nobody else is doing it |
1100 Thread *thread = Thread::current(); |
1100 Thread *thread = Thread::current(); |
1101 methodHandle m (thread, entry_frame_call_wrapper()->callee_method()); |
1101 methodHandle m (thread, entry_frame_call_wrapper()->callee_method()); |
1102 symbolHandle signature (thread, m->signature()); |
1102 EntryFrameOopFinder finder(this, m->signature(), m->is_static()); |
1103 EntryFrameOopFinder finder(this, signature, m->is_static()); |
|
1104 finder.arguments_do(f); |
1103 finder.arguments_do(f); |
1105 } |
1104 } |
1106 // Traverse the Handle Block saved in the entry frame |
1105 // Traverse the Handle Block saved in the entry frame |
1107 entry_frame_call_wrapper()->oops_do(f); |
1106 entry_frame_call_wrapper()->oops_do(f); |
1108 } |
1107 } |