Skip to content

Commit

Permalink
8330159: [C2] Remove or clarify Compile::init_start
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, dlong
  • Loading branch information
nelanbu authored and chhagedorn committed Sep 6, 2024
1 parent 9e0ccb8 commit 7db4d46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions src/hotspot/share/opto/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
init_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);
init_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
Expand Down Expand Up @@ -1105,13 +1105,12 @@ void Compile::Init(bool aliasing) {
probe_alias_cache(nullptr)->_index = AliasIdxTop;
}

//---------------------------init_start----------------------------------------
// Install the StartNode on this compile object.
void Compile::init_start(StartNode* s) {
if (failing())
return; // already failing
assert(s == start(), "");
#ifdef ASSERT
// Verify that the current StartNode is valid.
void Compile::verify_start(StartNode* s) const {
assert(failing() || s == start(), "should be StartNode");
}
#endif

/**
* Return the 'StartNode'. We must not have a pending failure, since the ideal graph
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/compile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +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 init_start(StartNode* s);
void verify_start(StartNode* s) const NOT_DEBUG_RETURN;
Node* immutable_memory();

Node* recent_alloc_ctl() const { return _recent_alloc_ctl; }
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/generateOptoStub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
C->init_start(start);
C->verify_start(start);

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

0 comments on commit 7db4d46

Please sign in to comment.