src/share/vm/opto/parse2.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/opto/parse2.cpp

src/share/vm/opto/parse2.cpp

Print this page
rev 9360 : 8137168: Replace IfNode with a new RangeCheckNode for range checks
Summary: new RangeCheckNode to enable optimization of explicit library level range checks
Reviewed-by:

*** 134,145 **** // Test length vs index (standard trick using unsigned compare) Node* chk = _gvn.transform( new CmpUNode(idx, len) ); BoolTest::mask btest = BoolTest::lt; tst = _gvn.transform( new BoolNode(chk, btest) ); } // Branch to failure if out of bounds ! { BuildCutout unless(this, tst, PROB_MAX); if (C->allow_range_check_smearing()) { // Do not use builtin_throw, since range checks are sometimes // made more stringent by an optimistic transformation. // This creates "tentative" range checks at this point, // which are not guaranteed to throw exceptions. --- 134,153 ---- // Test length vs index (standard trick using unsigned compare) Node* chk = _gvn.transform( new CmpUNode(idx, len) ); BoolTest::mask btest = BoolTest::lt; tst = _gvn.transform( new BoolNode(chk, btest) ); } + RangeCheckNode* rc = new RangeCheckNode(control(), tst, PROB_MAX, COUNT_UNKNOWN); + _gvn.set_type(rc, rc->Value(&_gvn)); + if (!tst->is_Con()) { + record_for_igvn(rc); + } + set_control(_gvn.transform(new IfTrueNode(rc))); // Branch to failure if out of bounds ! { ! PreserveJVMState pjvms(this); ! set_control(_gvn.transform(new IfFalseNode(rc))); if (C->allow_range_check_smearing()) { // Do not use builtin_throw, since range checks are sometimes // made more stringent by an optimistic transformation. // This creates "tentative" range checks at this point, // which are not guaranteed to throw exceptions.
src/share/vm/opto/parse2.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File