From 9c65f9a832b87e7bd120023f6c08b6e864358dfe Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Thu, 17 Oct 2024 23:02:17 +0200 Subject: [PATCH] Review Vladimir --- src/hotspot/share/opto/predicates.cpp | 15 ++++++++------- src/hotspot/share/opto/predicates.hpp | 6 ------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/opto/predicates.cpp b/src/hotspot/share/opto/predicates.cpp index 8fab7701c5461..153a2bcd44223 100644 --- a/src/hotspot/share/opto/predicates.cpp +++ b/src/hotspot/share/opto/predicates.cpp @@ -42,8 +42,14 @@ Node* AssertionPredicatesWithHalt::find_entry(Node* start_proj) { return entry; } +// An Assertion Predicate has always a true projection on the success path. +bool may_be_assertion_predicate_if(const Node* node) { + assert(node != nullptr, "should not be null"); + return node->is_IfTrue() && RegularPredicate::may_be_predicate_if(node->as_IfProj()); +} + bool AssertionPredicateWithHalt::is_predicate(const Node* maybe_success_proj) { - if (!AssertionPredicate::may_be_predicate_if(maybe_success_proj)) { + if (!may_be_assertion_predicate_if(maybe_success_proj)) { return false; } return has_assertion_predicate_opaque(maybe_success_proj) && has_halt(maybe_success_proj); @@ -131,15 +137,10 @@ bool RuntimePredicate::is_predicate(Node* node, Deoptimization::DeoptReason deop return RegularPredicateWithUCT::is_predicate(node, deopt_reason); } -// An Assertion Predicate has always a true projection on the success path. -bool AssertionPredicate::may_be_predicate_if(const Node* node) { - return node->is_IfTrue() && RegularPredicate::may_be_predicate_if(node->as_IfProj()); -} - // A Template Assertion Predicate has an If/RangeCheckNode and either an UCT or a halt node depending on where it // was created. bool TemplateAssertionPredicate::is_predicate(Node* node) { - if (!AssertionPredicate::may_be_predicate_if(node)) { + if (!may_be_assertion_predicate_if(node)) { return false; } IfNode* if_node = node->in(0)->as_If(); diff --git a/src/hotspot/share/opto/predicates.hpp b/src/hotspot/share/opto/predicates.hpp index 08d96b1c55dd6..4df5667303552 100644 --- a/src/hotspot/share/opto/predicates.hpp +++ b/src/hotspot/share/opto/predicates.hpp @@ -369,12 +369,6 @@ class RuntimePredicate : public Predicate { static bool is_predicate(Node* node, Deoptimization::DeoptReason deopt_reason); }; -// Utility class to represent an Assertion Predicate. -class AssertionPredicate : public StackObj { - public: - static bool may_be_predicate_if(const Node* node); -}; - // Class to represent a Template Assertion Predicate. class TemplateAssertionPredicate : public Predicate { IfTrueNode* _success_proj;