Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8330159: [C2] Remove or clarify Compile::init_start #20715

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/hotspot/share/opto/compile.cpp
Original file line number Diff line number Diff line change
@@ -754,14 +754,14 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
init_tf(TypeFunc::make(domain, range));
StartNode* s = new StartOSRNode(root(), domain);
initial_gvn()->set_type_bottom(s);
DEBUG_ONLY(verify_start(s);)
verify_start(s);
cg = CallGenerator::for_osr(method(), entry_bci());
} else {
// Normal case.
init_tf(TypeFunc::make(method()));
StartNode* s = new StartNode(root(), tf()->domain());
initial_gvn()->set_type_bottom(s);
DEBUG_ONLY(verify_start(s);)
verify_start(s);
if (method()->intrinsic_id() == vmIntrinsics::_Reference_get) {
// With java.lang.ref.reference.get() we must go through the
// intrinsic - even when get() is the root
@@ -1107,7 +1107,7 @@ void Compile::Init(bool aliasing) {

#ifdef ASSERT
// Install the StartNode on this compile object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment needs to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the following may sound good briefly?: "Verify that the current StartNode is valid."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

void Compile::verify_start(StartNode* s) {
void Compile::verify_start(StartNode* s) const {
assert(failing() || s == start(), "should be StartNode");
}
#endif
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/compile.hpp
Original file line number Diff line number Diff line change
@@ -864,6 +864,7 @@ class Compile : public Phase {
RootNode* root() const { return _root; }
void set_root(RootNode* r) { _root = r; }
StartNode* start() const; // (Derived from root.)
void verify_start(StartNode* s) const NOT_DEBUG_RETURN;
Node* immutable_memory();

Node* recent_alloc_ctl() const { return _recent_alloc_ctl; }
@@ -884,7 +885,6 @@ class Compile : public Phase {
return (uint) val;
}
#ifdef ASSERT
void verify_start(StartNode* s);
void set_phase_optimize_finished() { _phase_optimize_finished = true; }
bool phase_optimize_finished() const { return _phase_optimize_finished; }
uint count_live_nodes_by_graph_walk();
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/generateOptoStub.cpp
Original file line number Diff line number Diff line change
@@ -261,7 +261,7 @@ void GraphKit::gen_stub(address C_function,
frameptr(),
returnadr());
root()->add_req(_gvn.transform(to_exc)); // bind to root to keep live
DEBUG_ONLY(C->verify_start(start);)
C->verify_start(start);

//-----------------------------
// If this is a normal subroutine return, issue the return and be done.