@@ -672,13 +672,13 @@ void frame::print_on_error(outputStream* st, char* buf, int buflen, bool verbose
672
672
*/
673
673
class InterpreterFrameClosure : public OffsetClosure {
674
674
private:
675
- frame* _fr;
676
- OopClosure* _f;
677
- int _max_locals;
678
- int _max_stack;
675
+ const frame* _fr;
676
+ OopClosure* _f;
677
+ int _max_locals;
678
+ int _max_stack;
679
679
680
680
public:
681
- InterpreterFrameClosure (frame* fr, int max_locals, int max_stack,
681
+ InterpreterFrameClosure (const frame* fr, int max_locals, int max_stack,
682
682
OopClosure* f) {
683
683
_fr = fr;
684
684
_max_locals = max_locals;
@@ -709,16 +709,15 @@ class InterpreterFrameClosure : public OffsetClosure {
709
709
}
710
710
711
711
int max_locals () { return _max_locals; }
712
- frame* fr () { return _fr; }
713
712
};
714
713
715
714
716
715
class InterpretedArgumentOopFinder : public SignatureIterator {
717
716
private:
718
- OopClosure* _f; // Closure to invoke
719
- int _offset; // TOS-relative offset, decremented with each argument
720
- bool _has_receiver; // true if the callee has a receiver
721
- frame* _fr;
717
+ OopClosure* _f; // Closure to invoke
718
+ int _offset; // TOS-relative offset, decremented with each argument
719
+ bool _has_receiver; // true if the callee has a receiver
720
+ const frame* _fr;
722
721
723
722
friend class SignatureIterator ; // so do_parameters_on can call do_type
724
723
void do_type (BasicType type) {
@@ -733,7 +732,7 @@ class InterpretedArgumentOopFinder: public SignatureIterator {
733
732
}
734
733
735
734
public:
736
- InterpretedArgumentOopFinder (Symbol* signature, bool has_receiver, frame* fr, OopClosure* f) : SignatureIterator(signature), _has_receiver(has_receiver) {
735
+ InterpretedArgumentOopFinder (Symbol* signature, bool has_receiver, const frame* fr, OopClosure* f) : SignatureIterator(signature), _has_receiver(has_receiver) {
737
736
// compute size of arguments
738
737
int args_size = ArgumentSizeComputer (signature).size () + (has_receiver ? 1 : 0 );
739
738
assert (!fr->is_interpreted_frame () ||
@@ -769,10 +768,10 @@ class InterpretedArgumentOopFinder: public SignatureIterator {
769
768
// visits and GC's all the arguments in entry frame
770
769
class EntryFrameOopFinder : public SignatureIterator {
771
770
private:
772
- bool _is_static;
773
- int _offset;
774
- frame* _fr;
775
- OopClosure* _f;
771
+ bool _is_static;
772
+ int _offset;
773
+ const frame* _fr;
774
+ OopClosure* _f;
776
775
777
776
friend class SignatureIterator ; // so do_parameters_on can call do_type
778
777
void do_type (BasicType type) {
@@ -789,7 +788,7 @@ class EntryFrameOopFinder: public SignatureIterator {
789
788
}
790
789
791
790
public:
792
- EntryFrameOopFinder (frame* frame, Symbol* signature, bool is_static) : SignatureIterator(signature) {
791
+ EntryFrameOopFinder (const frame* frame, Symbol* signature, bool is_static) : SignatureIterator(signature) {
793
792
_f = NULL ; // will be set later
794
793
_fr = frame;
795
794
_is_static = is_static;
@@ -811,7 +810,7 @@ oop* frame::interpreter_callee_receiver_addr(Symbol* signature) {
811
810
}
812
811
813
812
814
- void frame::oops_interpreted_do (OopClosure* f, const RegisterMap* map, bool query_oop_map_cache) {
813
+ void frame::oops_interpreted_do (OopClosure* f, const RegisterMap* map, bool query_oop_map_cache) const {
815
814
assert (is_interpreted_frame (), " Not an interpreted frame" );
816
815
assert (map != NULL , " map must be set" );
817
816
Thread *thread = Thread::current ();
@@ -892,12 +891,12 @@ void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool quer
892
891
}
893
892
894
893
895
- void frame::oops_interpreted_arguments_do (Symbol* signature, bool has_receiver, OopClosure* f) {
894
+ void frame::oops_interpreted_arguments_do (Symbol* signature, bool has_receiver, OopClosure* f) const {
896
895
InterpretedArgumentOopFinder finder (signature, has_receiver, this , f);
897
896
finder.oops_do ();
898
897
}
899
898
900
- void frame::oops_code_blob_do (OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) {
899
+ void frame::oops_code_blob_do (OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) const {
901
900
assert (_cb != NULL , " sanity check" );
902
901
if (_cb->oop_maps () != NULL ) {
903
902
OopMapSet::oops_do (this , reg_map, f);
@@ -974,7 +973,7 @@ class CompiledArgumentOopFinder: public SignatureIterator {
974
973
};
975
974
976
975
void frame::oops_compiled_arguments_do (Symbol* signature, bool has_receiver, bool has_appendix,
977
- const RegisterMap* reg_map, OopClosure* f) {
976
+ const RegisterMap* reg_map, OopClosure* f) const {
978
977
ResourceMark rm;
979
978
CompiledArgumentOopFinder finder (signature, has_receiver, has_appendix, f, *this , reg_map);
980
979
finder.oops_do ();
@@ -1023,7 +1022,7 @@ oop frame::get_native_receiver() {
1023
1022
return owner;
1024
1023
}
1025
1024
1026
- void frame::oops_entry_do (OopClosure* f, const RegisterMap* map) {
1025
+ void frame::oops_entry_do (OopClosure* f, const RegisterMap* map) const {
1027
1026
assert (map != NULL , " map must be set" );
1028
1027
if (map->include_argument_oops ()) {
1029
1028
// must collect argument oops, as nobody else is doing it
@@ -1037,7 +1036,7 @@ void frame::oops_entry_do(OopClosure* f, const RegisterMap* map) {
1037
1036
}
1038
1037
1039
1038
1040
- void frame::oops_do_internal (OopClosure* f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) {
1039
+ void frame::oops_do_internal (OopClosure* f, CodeBlobClosure* cf, const RegisterMap* map, bool use_interpreter_oop_map_cache) const {
1041
1040
#ifndef PRODUCT
1042
1041
// simulate GC crash here to dump java thread in error report
1043
1042
if (CrashGCForDumpingJavaThread) {
@@ -1056,15 +1055,15 @@ void frame::oops_do_internal(OopClosure* f, CodeBlobClosure* cf, RegisterMap* ma
1056
1055
}
1057
1056
}
1058
1057
1059
- void frame::nmethods_do (CodeBlobClosure* cf) {
1058
+ void frame::nmethods_do (CodeBlobClosure* cf) const {
1060
1059
if (_cb != NULL && _cb->is_nmethod ()) {
1061
1060
cf->do_code_blob (_cb);
1062
1061
}
1063
1062
}
1064
1063
1065
1064
1066
1065
// Call f closure on the interpreted Method*s in the stack.
1067
- void frame::metadata_do (MetadataClosure* f) {
1066
+ void frame::metadata_do (MetadataClosure* f) const {
1068
1067
ResourceMark rm;
1069
1068
if (is_interpreted_frame ()) {
1070
1069
Method* m = this ->interpreter_frame_method ();
@@ -1073,7 +1072,7 @@ void frame::metadata_do(MetadataClosure* f) {
1073
1072
}
1074
1073
}
1075
1074
1076
- void frame::verify (const RegisterMap* map) {
1075
+ void frame::verify (const RegisterMap* map) const {
1077
1076
// for now make sure receiver type is correct
1078
1077
if (is_interpreted_frame ()) {
1079
1078
Method* method = interpreter_frame_method ();
@@ -1087,7 +1086,7 @@ void frame::verify(const RegisterMap* map) {
1087
1086
#if COMPILER2_OR_JVMCI
1088
1087
assert (DerivedPointerTable::is_empty (), " must be empty before verify" );
1089
1088
#endif
1090
- oops_do_internal (&VerifyOopClosure::verify_oop, NULL , (RegisterMap*) map, false );
1089
+ oops_do_internal (&VerifyOopClosure::verify_oop, NULL , map, false );
1091
1090
}
1092
1091
1093
1092
0 commit comments