1 /*
   2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "compiler/compileLog.hpp"
  27 #include "interpreter/linkResolver.hpp"
  28 #include "memory/universe.hpp"
  29 #include "oops/objArrayKlass.hpp"
  30 #include "oops/valueArrayKlass.hpp"
  31 #include "opto/addnode.hpp"
  32 #include "opto/castnode.hpp"
  33 #include "opto/memnode.hpp"
  34 #include "opto/parse.hpp"
  35 #include "opto/rootnode.hpp"
  36 #include "opto/runtime.hpp"
  37 #include "opto/subnode.hpp"
  38 #include "opto/valuetypenode.hpp"
  39 #include "runtime/deoptimization.hpp"
  40 #include "runtime/handles.inline.hpp"
  41 
  42 //=============================================================================
  43 // Helper methods for _get* and _put* bytecodes
  44 //=============================================================================
  45 bool Parse::static_field_ok_in_clinit(ciField *field, ciMethod *method) {
  46   // Could be the field_holder's <clinit> method, or <clinit> for a subklass.
  47   // Better to check now than to Deoptimize as soon as we execute
  48   assert( field->is_static(), "Only check if field is static");
  49   // is_being_initialized() is too generous.  It allows access to statics
  50   // by threads that are not running the <clinit> before the <clinit> finishes.
  51   // return field->holder()->is_being_initialized();
  52 
  53   // The following restriction is correct but conservative.
  54   // It is also desirable to allow compilation of methods called from <clinit>
  55   // but this generated code will need to be made safe for execution by
  56   // other threads, or the transition from interpreted to compiled code would
  57   // need to be guarded.
  58   ciInstanceKlass *field_holder = field->holder();
  59 
  60   bool access_OK = false;
  61   if (method->holder()->is_subclass_of(field_holder)) {
  62     if (method->is_static()) {
  63       if (method->name() == ciSymbol::class_initializer_name()) {
  64         // OK to access static fields inside initializer
  65         access_OK = true;
  66       }
  67     } else {
  68       if (method->name() == ciSymbol::object_initializer_name()) {
  69         // It's also OK to access static fields inside a constructor,
  70         // because any thread calling the constructor must first have
  71         // synchronized on the class by executing a '_new' bytecode.
  72         access_OK = true;
  73       }
  74     }
  75   }
  76 
  77   return access_OK;
  78 
  79 }
  80 
  81 
  82 void Parse::do_field_access(bool is_get, bool is_field) {
  83   bool will_link;
  84   ciField* field = iter().get_field(will_link);
  85   assert(will_link, "getfield: typeflow responsibility");
  86 
  87   ciInstanceKlass* field_holder = field->holder();
  88 
  89   if (is_field && field_holder->is_valuetype()) {
  90     assert(is_get, "value type field store not supported");
  91     BasicType bt = field->layout_type();
  92     ValueTypeNode* vt = pop()->as_ValueType();
  93     Node* value = vt->field_value_by_offset(field->offset());
  94     push_node(bt, value);
  95     return;
  96   }
  97 
  98   if (is_field == field->is_static()) {
  99     // Interpreter will throw java_lang_IncompatibleClassChangeError
 100     // Check this before allowing <clinit> methods to access static fields
 101     uncommon_trap(Deoptimization::Reason_unhandled,
 102                   Deoptimization::Action_none);
 103     return;
 104   }
 105 
 106   if (!is_field && !field_holder->is_initialized()) {
 107     if (!static_field_ok_in_clinit(field, method())) {
 108       uncommon_trap(Deoptimization::Reason_uninitialized,
 109                     Deoptimization::Action_reinterpret,
 110                     NULL, "!static_field_ok_in_clinit");
 111       return;
 112     }
 113   }
 114 
 115   // Deoptimize on putfield writes to call site target field.
 116   if (!is_get && field->is_call_site_target()) {
 117     uncommon_trap(Deoptimization::Reason_unhandled,
 118                   Deoptimization::Action_reinterpret,
 119                   NULL, "put to call site target field");
 120     return;
 121   }
 122 
 123   assert(field->will_link(method(), bc()), "getfield: typeflow responsibility");
 124 
 125   // Note:  We do not check for an unloaded field type here any more.
 126 
 127   // Generate code for the object pointer.
 128   Node* obj;
 129   if (is_field) {
 130     int obj_depth = is_get ? 0 : field->type()->size();
 131     obj = null_check(peek(obj_depth));
 132     // Compile-time detect of null-exception?
 133     if (stopped())  return;
 134 
 135 #ifdef ASSERT
 136     const TypeInstPtr *tjp = TypeInstPtr::make(TypePtr::NotNull, iter().get_declared_field_holder());
 137     assert(_gvn.type(obj)->higher_equal(tjp), "cast_up is no longer needed");
 138 #endif
 139 
 140     if (is_get) {
 141       (void) pop();  // pop receiver before getting
 142       do_get_xxx(obj, field, is_field);
 143     } else {
 144       do_put_xxx(obj, field, is_field);
 145       if (stopped()) {
 146         return;
 147       }
 148       (void) pop();  // pop receiver after putting
 149     }
 150   } else {
 151     const TypeInstPtr* tip = TypeInstPtr::make(field_holder->java_mirror());
 152     obj = _gvn.makecon(tip);
 153     if (is_get) {
 154       do_get_xxx(obj, field, is_field);
 155     } else {
 156       do_put_xxx(obj, field, is_field);
 157     }
 158   }
 159 }
 160 
 161 void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
 162   BasicType bt = field->layout_type();
 163 
 164   // Does this field have a constant value?  If so, just push the value.
 165   if (field->is_constant() &&
 166       // Keep consistent with types found by ciTypeFlow: for an
 167       // unloaded field type, ciTypeFlow::StateVector::do_getstatic()
 168       // speculates the field is null. The code in the rest of this
 169       // method does the same. We must not bypass it and use a non
 170       // null constant here.
 171       (bt != T_OBJECT || field->type()->is_loaded())) {
 172     // final or stable field
 173     Node* con = make_constant_from_field(field, obj);
 174     if (con != NULL) {
 175       push_node(field->layout_type(), con);
 176       return;
 177     }
 178   }
 179 
 180   ciType* field_klass = field->type();
 181   bool is_vol = field->is_volatile();
 182   bool flattened = field->is_flattened();
 183   bool flattenable = field->is_flattenable();
 184 
 185   // Compute address and memory type.
 186   int offset = field->offset_in_bytes();
 187   const TypePtr* adr_type = C->alias_type(field)->adr_type();
 188   Node *adr = basic_plus_adr(obj, obj, offset);
 189 
 190   // Build the resultant type of the load
 191   const Type *type;
 192 
 193   bool must_assert_null = false;
 194   if (bt == T_OBJECT || bt == T_VALUETYPE) {
 195     if (!field->type()->is_loaded()) {
 196       type = TypeInstPtr::BOTTOM;
 197       must_assert_null = true;
 198     } else if (field->is_static_constant()) {
 199       // This can happen if the constant oop is non-perm.
 200       ciObject* con = field->constant_value().as_object();
 201       // Do not "join" in the previous type; it doesn't add value,
 202       // and may yield a vacuous result if the field is of interface type.
 203       if (con->is_null_object()) {
 204         type = TypePtr::NULL_PTR;
 205       } else {
 206         type = TypeOopPtr::make_from_constant(con)->isa_oopptr();
 207       }
 208       assert(type != NULL, "field singleton type must be consistent");
 209     } else {
 210       type = TypeOopPtr::make_from_klass(field_klass->as_klass());
 211       if (bt == T_VALUETYPE && field->is_static()) {
 212         // Check if static value type field is already initialized
 213         assert(!flattened, "static fields should not be flattened");
 214         ciInstance* mirror = field->holder()->java_mirror();
 215         ciObject* val = mirror->field_value(field).as_object();
 216         if (!val->is_null_object()) {
 217           type = type->join_speculative(TypePtr::NOTNULL);
 218         }
 219       }
 220     }
 221   } else {
 222     type = Type::get_const_basic_type(bt);
 223   }
 224   if (support_IRIW_for_not_multiple_copy_atomic_cpu && field->is_volatile()) {
 225     insert_mem_bar(Op_MemBarVolatile);   // StoreLoad barrier
 226   }
 227 
 228   // Build the load.
 229   //
 230   MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
 231   bool needs_atomic_access = is_vol || AlwaysAtomicAccesses;
 232   Node* ld = NULL;
 233   if (flattened) {
 234     // Load flattened value type
 235     ld = ValueTypeNode::make_from_flattened(this, field_klass->as_value_klass(), obj, obj, field->holder(), offset);
 236   } else {
 237     if (bt == T_VALUETYPE && !flattenable) {
 238       // Non-flattenable value type field can be null and we
 239       // should not return the default value type in that case.
 240       bt = T_VALUETYPEPTR;
 241     }
 242     ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, needs_atomic_access);
 243   }
 244 
 245   // Adjust Java stack
 246   if (type2size[bt] == 1)
 247     push(ld);
 248   else
 249     push_pair(ld);
 250 
 251   if (must_assert_null) {
 252     // Do not take a trap here.  It's possible that the program
 253     // will never load the field's class, and will happily see
 254     // null values in this field forever.  Don't stumble into a
 255     // trap for such a program, or we might get a long series
 256     // of useless recompilations.  (Or, we might load a class
 257     // which should not be loaded.)  If we ever see a non-null
 258     // value, we will then trap and recompile.  (The trap will
 259     // not need to mention the class index, since the class will
 260     // already have been loaded if we ever see a non-null value.)
 261     // uncommon_trap(iter().get_field_signature_index());
 262     if (PrintOpto && (Verbose || WizardMode)) {
 263       method()->print_name(); tty->print_cr(" asserting nullness of field at bci: %d", bci());
 264     }
 265     if (C->log() != NULL) {
 266       C->log()->elem("assert_null reason='field' klass='%d'",
 267                      C->log()->identify(field->type()));
 268     }
 269     // If there is going to be a trap, put it at the next bytecode:
 270     set_bci(iter().next_bci());
 271     null_assert(peek());
 272     set_bci(iter().cur_bci()); // put it back
 273   }
 274 
 275   // If reference is volatile, prevent following memory ops from
 276   // floating up past the volatile read.  Also prevents commoning
 277   // another volatile read.
 278   if (field->is_volatile()) {
 279     // Memory barrier includes bogus read of value to force load BEFORE membar
 280     insert_mem_bar(Op_MemBarAcquire, ld);
 281   }
 282 }
 283 
 284 void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {
 285   bool is_vol = field->is_volatile();
 286   bool is_flattened = field->is_flattened();
 287   // If reference is volatile, prevent following memory ops from
 288   // floating down past the volatile write.  Also prevents commoning
 289   // another volatile read.
 290   if (is_vol)  insert_mem_bar(Op_MemBarRelease);
 291 
 292   // Compute address and memory type.
 293   int offset = field->offset_in_bytes();
 294   const TypePtr* adr_type = C->alias_type(field)->adr_type();
 295   Node* adr = basic_plus_adr(obj, obj, offset);
 296   BasicType bt = field->layout_type();
 297   // Value to be stored
 298   Node* val = type2size[bt] == 1 ? pop() : pop_pair();
 299   // Round doubles before storing
 300   if (bt == T_DOUBLE)  val = dstore_rounding(val);
 301 
 302   // Conservatively release stores of object references.
 303   const MemNode::MemOrd mo =
 304     is_vol ?
 305     // Volatile fields need releasing stores.
 306     MemNode::release :
 307     // Non-volatile fields also need releasing stores if they hold an
 308     // object reference, because the object reference might point to
 309     // a freshly created object.
 310     StoreNode::release_if_reference(bt);
 311 
 312   // Store the value.
 313   if (bt == T_OBJECT || bt == T_VALUETYPE) {
 314     const TypeOopPtr* field_type;
 315     if (!field->type()->is_loaded()) {
 316       field_type = TypeInstPtr::BOTTOM;
 317     } else {
 318       field_type = TypeOopPtr::make_from_klass(field->type()->as_klass());
 319     }
 320     if (field->is_flattenable() && !val->is_ValueType()) {
 321       // We can see a null constant here
 322       assert(val->bottom_type()->remove_speculative() == TypePtr::NULL_PTR, "Anything other than null?");
 323       push(null());
 324       uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none);
 325       assert(stopped(), "dead path");
 326       return;
 327     }
 328     if (is_flattened) {
 329       // Store flattened value type to a non-static field
 330       assert(bt == T_VALUETYPE, "flattening is only supported for value type fields");
 331       val->as_ValueType()->store_flattened(this, obj, obj, field->holder(), offset);
 332     } else {
 333       store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo);
 334     }
 335   } else {
 336     bool needs_atomic_access = is_vol || AlwaysAtomicAccesses;
 337     store_to_memory(control(), adr, val, bt, adr_type, mo, needs_atomic_access);
 338   }
 339 
 340   // If reference is volatile, prevent following volatiles ops from
 341   // floating up before the volatile write.
 342   if (is_vol) {
 343     // If not multiple copy atomic, we do the MemBarVolatile before the load.
 344     if (!support_IRIW_for_not_multiple_copy_atomic_cpu) {
 345       insert_mem_bar(Op_MemBarVolatile); // Use fat membar
 346     }
 347     // Remember we wrote a volatile field.
 348     // For not multiple copy atomic cpu (ppc64) a barrier should be issued
 349     // in constructors which have such stores. See do_exits() in parse1.cpp.
 350     if (is_field) {
 351       set_wrote_volatile(true);
 352     }
 353   }
 354 
 355   if (is_field) {
 356     set_wrote_fields(true);
 357   }
 358 
 359   // If the field is final, the rules of Java say we are in <init> or <clinit>.
 360   // Note the presence of writes to final non-static fields, so that we
 361   // can insert a memory barrier later on to keep the writes from floating
 362   // out of the constructor.
 363   // Any method can write a @Stable field; insert memory barriers after those also.
 364   if (is_field && (field->is_final() || field->is_stable())) {
 365     if (field->is_final()) {
 366         set_wrote_final(true);
 367     }
 368     if (field->is_stable()) {
 369         set_wrote_stable(true);
 370     }
 371 
 372     // Preserve allocation ptr to create precedent edge to it in membar
 373     // generated on exit from constructor.
 374     // Can't bind stable with its allocation, only record allocation for final field.
 375     if (field->is_final() && AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {
 376       set_alloc_with_final(obj);
 377     }
 378   }
 379 }
 380 
 381 //=============================================================================
 382 
 383 void Parse::do_newarray() {
 384   bool will_link;
 385   ciKlass* klass = iter().get_klass(will_link);
 386 
 387   // Uncommon Trap when class that array contains is not loaded
 388   // we need the loaded class for the rest of graph; do not
 389   // initialize the container class (see Java spec)!!!
 390   assert(will_link, "newarray: typeflow responsibility");
 391 
 392   ciArrayKlass* array_klass = ciArrayKlass::make(klass);
 393   // Check that array_klass object is loaded
 394   if (!array_klass->is_loaded()) {
 395     // Generate uncommon_trap for unloaded array_class
 396     uncommon_trap(Deoptimization::Reason_unloaded,
 397                   Deoptimization::Action_reinterpret,
 398                   array_klass);
 399     return;
 400   } else if (array_klass->element_klass() != NULL &&
 401              array_klass->element_klass()->is_valuetype() &&
 402              !array_klass->element_klass()->as_value_klass()->is_initialized()) {
 403     uncommon_trap(Deoptimization::Reason_uninitialized,
 404                   Deoptimization::Action_reinterpret,
 405                   NULL);
 406     return;
 407   }
 408 
 409   kill_dead_locals();
 410 
 411   const TypeKlassPtr* array_klass_type = TypeKlassPtr::make(array_klass);
 412   Node* count_val = pop();
 413   Node* obj = new_array(makecon(array_klass_type), count_val, 1);
 414   push(obj);
 415 }
 416 
 417 
 418 void Parse::do_newarray(BasicType elem_type) {
 419   kill_dead_locals();
 420 
 421   Node*   count_val = pop();
 422   const TypeKlassPtr* array_klass = TypeKlassPtr::make(ciTypeArrayKlass::make(elem_type));
 423   Node*   obj = new_array(makecon(array_klass), count_val, 1);
 424   // Push resultant oop onto stack
 425   push(obj);
 426 }
 427 
 428 // Expand simple expressions like new int[3][5] and new Object[2][nonConLen].
 429 // Also handle the degenerate 1-dimensional case of anewarray.
 430 Node* Parse::expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions, int nargs) {
 431   Node* length = lengths[0];
 432   assert(length != NULL, "");
 433   Node* array = new_array(makecon(TypeKlassPtr::make(array_klass)), length, nargs);
 434   if (ndimensions > 1) {
 435     jint length_con = find_int_con(length, -1);
 436     guarantee(length_con >= 0, "non-constant multianewarray");
 437     ciArrayKlass* array_klass_1 = array_klass->as_obj_array_klass()->element_klass()->as_array_klass();
 438     const TypePtr* adr_type = TypeAryPtr::OOPS;
 439     const TypeOopPtr*    elemtype = _gvn.type(array)->is_aryptr()->elem()->make_oopptr();
 440     const intptr_t header   = arrayOopDesc::base_offset_in_bytes(T_OBJECT);
 441     for (jint i = 0; i < length_con; i++) {
 442       Node*    elem   = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs);
 443       intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop);
 444       Node*    eaddr  = basic_plus_adr(array, offset);
 445       store_oop_to_array(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT, MemNode::unordered);
 446     }
 447   }
 448   return array;
 449 }
 450 
 451 void Parse::do_multianewarray() {
 452   int ndimensions = iter().get_dimensions();
 453 
 454   // the m-dimensional array
 455   bool will_link;
 456   ciArrayKlass* array_klass = iter().get_klass(will_link)->as_array_klass();
 457   assert(will_link, "multianewarray: typeflow responsibility");
 458 
 459   // Note:  Array classes are always initialized; no is_initialized check.
 460 
 461   kill_dead_locals();
 462 
 463   // get the lengths from the stack (first dimension is on top)
 464   Node** length = NEW_RESOURCE_ARRAY(Node*, ndimensions + 1);
 465   length[ndimensions] = NULL;  // terminating null for make_runtime_call
 466   int j;
 467   for (j = ndimensions-1; j >= 0 ; j--) length[j] = pop();
 468 
 469   // The original expression was of this form: new T[length0][length1]...
 470   // It is often the case that the lengths are small (except the last).
 471   // If that happens, use the fast 1-d creator a constant number of times.
 472   const int expand_limit = MIN2((int)MultiArrayExpandLimit, 100);
 473   int expand_count = 1;        // count of allocations in the expansion
 474   int expand_fanout = 1;       // running total fanout
 475   for (j = 0; j < ndimensions-1; j++) {
 476     int dim_con = find_int_con(length[j], -1);
 477     expand_fanout *= dim_con;
 478     expand_count  += expand_fanout; // count the level-J sub-arrays
 479     if (dim_con <= 0
 480         || dim_con > expand_limit
 481         || expand_count > expand_limit) {
 482       expand_count = 0;
 483       break;
 484     }
 485   }
 486 
 487   // Can use multianewarray instead of [a]newarray if only one dimension,
 488   // or if all non-final dimensions are small constants.
 489   if (ndimensions == 1 || (1 <= expand_count && expand_count <= expand_limit)) {
 490     Node* obj = NULL;
 491     // Set the original stack and the reexecute bit for the interpreter
 492     // to reexecute the multianewarray bytecode if deoptimization happens.
 493     // Do it unconditionally even for one dimension multianewarray.
 494     // Note: the reexecute bit will be set in GraphKit::add_safepoint_edges()
 495     // when AllocateArray node for newarray is created.
 496     { PreserveReexecuteState preexecs(this);
 497       inc_sp(ndimensions);
 498       // Pass 0 as nargs since uncommon trap code does not need to restore stack.
 499       obj = expand_multianewarray(array_klass, &length[0], ndimensions, 0);
 500     } //original reexecute and sp are set back here
 501     push(obj);
 502     return;
 503   }
 504 
 505   address fun = NULL;
 506   switch (ndimensions) {
 507   case 1: ShouldNotReachHere(); break;
 508   case 2: fun = OptoRuntime::multianewarray2_Java(); break;
 509   case 3: fun = OptoRuntime::multianewarray3_Java(); break;
 510   case 4: fun = OptoRuntime::multianewarray4_Java(); break;
 511   case 5: fun = OptoRuntime::multianewarray5_Java(); break;
 512   };
 513   Node* c = NULL;
 514 
 515   if (fun != NULL) {
 516     c = make_runtime_call(RC_NO_LEAF | RC_NO_IO,
 517                           OptoRuntime::multianewarray_Type(ndimensions),
 518                           fun, NULL, TypeRawPtr::BOTTOM,
 519                           makecon(TypeKlassPtr::make(array_klass)),
 520                           length[0], length[1], length[2],
 521                           (ndimensions > 2) ? length[3] : NULL,
 522                           (ndimensions > 3) ? length[4] : NULL);
 523   } else {
 524     // Create a java array for dimension sizes
 525     Node* dims = NULL;
 526     { PreserveReexecuteState preexecs(this);
 527       inc_sp(ndimensions);
 528       Node* dims_array_klass = makecon(TypeKlassPtr::make(ciArrayKlass::make(ciType::make(T_INT))));
 529       dims = new_array(dims_array_klass, intcon(ndimensions), 0);
 530 
 531       // Fill-in it with values
 532       for (j = 0; j < ndimensions; j++) {
 533         Node *dims_elem = array_element_address(dims, intcon(j), T_INT);
 534         store_to_memory(control(), dims_elem, length[j], T_INT, TypeAryPtr::INTS, MemNode::unordered);
 535       }
 536     }
 537 
 538     c = make_runtime_call(RC_NO_LEAF | RC_NO_IO,
 539                           OptoRuntime::multianewarrayN_Type(),
 540                           OptoRuntime::multianewarrayN_Java(), NULL, TypeRawPtr::BOTTOM,
 541                           makecon(TypeKlassPtr::make(array_klass)),
 542                           dims);
 543   }
 544   make_slow_call_ex(c, env()->Throwable_klass(), false);
 545 
 546   Node* res = _gvn.transform(new ProjNode(c, TypeFunc::Parms));
 547 
 548   const Type* type = TypeOopPtr::make_from_klass_raw(array_klass);
 549 
 550   // Improve the type:  We know it's not null, exact, and of a given length.
 551   type = type->is_ptr()->cast_to_ptr_type(TypePtr::NotNull);
 552   type = type->is_aryptr()->cast_to_exactness(true);
 553 
 554   const TypeInt* ltype = _gvn.find_int_type(length[0]);
 555   if (ltype != NULL)
 556     type = type->is_aryptr()->cast_to_size(ltype);
 557 
 558     // We cannot sharpen the nested sub-arrays, since the top level is mutable.
 559 
 560   Node* cast = _gvn.transform( new CheckCastPPNode(control(), res, type) );
 561   push(cast);
 562 
 563   // Possible improvements:
 564   // - Make a fast path for small multi-arrays.  (W/ implicit init. loops.)
 565   // - Issue CastII against length[*] values, to TypeInt::POS.
 566 }