Skip to content

Commit

Permalink
do verification under ifdef ASSERT
Browse files Browse the repository at this point in the history
  • Loading branch information
adinn committed Nov 19, 2024
1 parent 3736262 commit a708172
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/stubCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void StubCodeGenerator::stub_epilog(StubCodeDesc* cdesc) {
}
}

#ifndef PRODUCT
#ifdef ASSERT
void StubCodeGenerator::verify_stub(StubGenStubId stub_id) {
assert(StubRoutines::stub_to_blob(stub_id) == blob_id(), "wrong blob %s for generation of stub %s", StubRoutines::get_blob_name(blob_id()), StubRoutines::get_stub_name(stub_id));
}
Expand All @@ -136,7 +136,7 @@ StubCodeMark::StubCodeMark(StubCodeGenerator* cgen, const char* group, const cha
}

StubCodeMark::StubCodeMark(StubCodeGenerator* cgen, StubGenStubId stub_id) : StubCodeMark(cgen, "StubRoutines", StubRoutines::get_stub_name(stub_id)) {
#ifndef PRODUCT
#ifdef ASSERT
cgen->verify_stub(stub_id);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/stubCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class StubCodeGenerator: public StackObj {
virtual void stub_prolog(StubCodeDesc* cdesc); // called by StubCodeMark constructor
virtual void stub_epilog(StubCodeDesc* cdesc); // called by StubCodeMark destructor

#ifndef PRODUCT
#ifdef ASSERT
void verify_stub(StubGenStubId stub_id);
#endif
};
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/stubRoutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const char* StubRoutines::get_stub_name(StubGenStubId id) {
return _stub_names[id];
}

#ifndef PRODUCT
#ifdef ASSERT

// array holding start and end indices for stub ids associated with a
// given blob. Given a blob with id (StubGenBlobId) blob_id for any
Expand Down Expand Up @@ -232,7 +232,7 @@ StubGenBlobId StubRoutines::stub_to_blob(StubGenStubId stubId) {
return blobId;
}

#endif // !PRODUCT
#endif // ASSERT

// Initialization
//
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/stubRoutines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class StubRoutines: AllStatic {

#undef DEFINE_BLOB_GETTER

#ifndef PRODUCT
#ifdef ASSERT
// provide a translation from stub id to its associated blob id
static StubGenBlobId stub_to_blob(StubGenStubId stubId);
#endif
Expand Down

0 comments on commit a708172

Please sign in to comment.