Mercurial > hg > truffle
comparison src/share/vm/opto/macro.cpp @ 3961:a92cdbac8b9e
7081933: Use zeroing elimination optimization for large array
Summary: Don't zero new typeArray during runtime call if the allocation is followed by arraycopy into it.
Reviewed-by: twisti
author | kvn |
---|---|
date | Mon, 26 Sep 2011 10:24:05 -0700 |
parents | 1af104d6cf99 |
children | 1bd45abaa507 |
comparison
equal
deleted
inserted
replaced
3960:f08d439fab8c | 3961:a92cdbac8b9e |
---|---|
1683 OptoRuntime::new_instance_Java()); | 1683 OptoRuntime::new_instance_Java()); |
1684 } | 1684 } |
1685 | 1685 |
1686 void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) { | 1686 void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) { |
1687 Node* length = alloc->in(AllocateNode::ALength); | 1687 Node* length = alloc->in(AllocateNode::ALength); |
1688 InitializeNode* init = alloc->initialization(); | |
1689 Node* klass_node = alloc->in(AllocateNode::KlassNode); | |
1690 ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass(); | |
1691 address slow_call_address; // Address of slow call | |
1692 if (init != NULL && init->is_complete_with_arraycopy() && | |
1693 k->is_type_array_klass()) { | |
1694 // Don't zero type array during slow allocation in VM since | |
1695 // it will be initialized later by arraycopy in compiled code. | |
1696 slow_call_address = OptoRuntime::new_array_nozero_Java(); | |
1697 } else { | |
1698 slow_call_address = OptoRuntime::new_array_Java(); | |
1699 } | |
1688 expand_allocate_common(alloc, length, | 1700 expand_allocate_common(alloc, length, |
1689 OptoRuntime::new_array_Type(), | 1701 OptoRuntime::new_array_Type(), |
1690 OptoRuntime::new_array_Java()); | 1702 slow_call_address); |
1691 } | 1703 } |
1692 | 1704 |
1693 //-----------------------mark_eliminated_locking_nodes----------------------- | 1705 //-----------------------mark_eliminated_locking_nodes----------------------- |
1694 // During EA obj may point to several objects but after few ideal graph | 1706 // During EA obj may point to several objects but after few ideal graph |
1695 // transformations (CCP) it may point to only one non escaping object | 1707 // transformations (CCP) it may point to only one non escaping object |