< prev index next >

src/hotspot/share/opto/convertnode.cpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 24,10 ***
--- 24,11 ---
  
  #include "precompiled.hpp"
  #include "opto/addnode.hpp"
  #include "opto/castnode.hpp"
  #include "opto/convertnode.hpp"
+ #include "opto/inlinetypenode.hpp"
  #include "opto/matcher.hpp"
  #include "opto/phaseX.hpp"
  #include "opto/subnode.hpp"
  #include "runtime/sharedRuntime.hpp"
  

*** 59,10 ***
--- 60,20 ---
    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_InlineTypePtr()) {
+     // Null checking a scalarized but nullable inline type. Check the is_init
+     // input instead of the oop input to avoid keeping buffer allocations alive.
+     set_req_X(1, in(1)->as_InlineTypePtr()->get_is_init(), phase);
+     return this;
+   }
+   return NULL;
+ }
  
  // The conversions operations are all Alpha sorted.  Please keep it that way!
  //=============================================================================
  //------------------------------Value------------------------------------------
  const Type* ConvD2FNode::Value(PhaseGVN* phase) const {
< prev index next >