src/share/vm/opto/macro.cpp

changeset 3157
a92cdbac8b9e
parent 3052
1af104d6cf99
child 3311
1bd45abaa507
     1.1 --- a/src/share/vm/opto/macro.cpp	Sun Sep 25 16:03:29 2011 -0700
     1.2 +++ b/src/share/vm/opto/macro.cpp	Mon Sep 26 10:24:05 2011 -0700
     1.3 @@ -1685,9 +1685,21 @@
     1.4  
     1.5  void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
     1.6    Node* length = alloc->in(AllocateNode::ALength);
     1.7 +  InitializeNode* init = alloc->initialization();
     1.8 +  Node* klass_node = alloc->in(AllocateNode::KlassNode);
     1.9 +  ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass();
    1.10 +  address slow_call_address;  // Address of slow call
    1.11 +  if (init != NULL && init->is_complete_with_arraycopy() &&
    1.12 +      k->is_type_array_klass()) {
    1.13 +    // Don't zero type array during slow allocation in VM since
    1.14 +    // it will be initialized later by arraycopy in compiled code.
    1.15 +    slow_call_address = OptoRuntime::new_array_nozero_Java();
    1.16 +  } else {
    1.17 +    slow_call_address = OptoRuntime::new_array_Java();
    1.18 +  }
    1.19    expand_allocate_common(alloc, length,
    1.20                           OptoRuntime::new_array_Type(),
    1.21 -                         OptoRuntime::new_array_Java());
    1.22 +                         slow_call_address);
    1.23  }
    1.24  
    1.25  //-----------------------mark_eliminated_locking_nodes-----------------------

mercurial