< prev index next >

src/hotspot/share/opto/parseHelper.cpp

Print this page

        

@@ -27,10 +27,11 @@
 #include "classfile/systemDictionary.hpp"
 #include "compiler/compileLog.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/valueArrayKlass.hpp"
 #include "opto/addnode.hpp"
+#include "opto/castnode.hpp"
 #include "opto/memnode.hpp"
 #include "opto/mulnode.hpp"
 #include "opto/parse.hpp"
 #include "opto/rootnode.hpp"
 #include "opto/runtime.hpp"

@@ -211,10 +212,13 @@
     if (stopped()) {          // MUST uncommon-trap?
       set_control(ctrl);      // Then Don't Do It, just fall into the normal checking
     } else {                  // Cast array klass to exactness:
       // Use the exact constant value we know it is.
       replace_in_map(array_klass,con);
+      Node* cast = _gvn.transform(new CheckCastPPNode(control(), ary, extak->as_instance_type()));
+      replace_in_map(ary, cast);
+      
       CompileLog* log = C->log();
       if (log != NULL) {
         log->elem("cast_up reason='monomorphic_array' from='%d' to='(exact)'",
                   log->identify(tak->klass()));
       }
< prev index next >