diff options
author | never <none@none> | 2008-04-24 11:13:03 -0700 |
---|---|---|
committer | never <none@none> | 2008-04-24 11:13:03 -0700 |
commit | 6643de849e24d9a6146a7ba45c0eb59a2026f453 (patch) | |
tree | 380ed3d6918c99f061a187676ae080010163ad1c /src/share/vm/opto/cfgnode.cpp | |
parent | 280953ff80bc4fca99f2983e8d649521ca3eb6de (diff) | |
download | jdk8u_hotspot-6643de849e24d9a6146a7ba45c0eb59a2026f453.tar.gz |
6663848: assert(i < Max(),"oob") in C2 with -Xcomp
Summary: NeverBranchNodes aren't handled properly
Reviewed-by: kvn, sgoldman, rasbold, jrose
Diffstat (limited to 'src/share/vm/opto/cfgnode.cpp')
-rw-r--r-- | src/share/vm/opto/cfgnode.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/share/vm/opto/cfgnode.cpp b/src/share/vm/opto/cfgnode.cpp index ebf6eaeb8..30ab6a59e 100644 --- a/src/share/vm/opto/cfgnode.cpp +++ b/src/share/vm/opto/cfgnode.cpp @@ -2019,6 +2019,28 @@ Node *CreateExNode::Identity( PhaseTransform *phase ) { } //============================================================================= +//------------------------------Value------------------------------------------ +// Check for being unreachable. +const Type *NeverBranchNode::Value( PhaseTransform *phase ) const { + if (!in(0) || in(0)->is_top()) return Type::TOP; + return bottom_type(); +} + +//------------------------------Ideal------------------------------------------ +// Check for no longer being part of a loop +Node *NeverBranchNode::Ideal(PhaseGVN *phase, bool can_reshape) { + if (can_reshape && !in(0)->is_Loop()) { + // Dead code elimination can sometimes delete this projection so + // if it's not there, there's nothing to do. + Node* fallthru = proj_out(0); + if (fallthru != NULL) { + phase->is_IterGVN()->subsume_node(fallthru, in(0)); + } + return phase->C->top(); + } + return NULL; +} + #ifndef PRODUCT void NeverBranchNode::format( PhaseRegAlloc *ra_, outputStream *st) const { st->print("%s", Name()); |