< prev index next >

src/hotspot/share/opto/convertnode.cpp

Print this page
*** 25,10 ***
--- 25,11 ---
  #include "precompiled.hpp"
  #include "opto/addnode.hpp"
  #include "opto/castnode.hpp"
  #include "opto/connode.hpp"
  #include "opto/convertnode.hpp"
+ #include "opto/inlinetypenode.hpp"
  #include "opto/matcher.hpp"
  #include "opto/movenode.hpp"
  #include "opto/phaseX.hpp"
  #include "opto/subnode.hpp"
  #include "runtime/stubRoutines.hpp"

*** 62,11 ***
--- 63,18 ---
    const TypeInt *ti = t->is_int();
    if( ti->_hi < 0 || ti->_lo > 0 ) return TypeInt::ONE;
    return TypeInt::BOOL;
  }
  
+ //------------------------------Ideal------------------------------------------
  Node* Conv2BNode::Ideal(PhaseGVN* phase, bool can_reshape) {
+   if (in(1)->is_InlineType()) {
+     // Null checking a scalarized but nullable inline type. Check the IsInit
+     // input instead of the oop input to avoid keeping buffer allocations alive.
+     set_req_X(1, in(1)->as_InlineType()->get_is_init(), phase);
+     return this;
+   }
    if (!Matcher::match_rule_supported(Op_Conv2B)) {
      if (phase->C->post_loop_opts_phase()) {
        // Get type of comparison to make
        const Type* t = phase->type(in(1));
        Node* cmp = nullptr;
< prev index next >