Mercurial > hg > truffle
diff src/share/vm/opto/graphKit.cpp @ 74:2a9af0b9cb1c
6674600: (Escape Analysis) Optimize memory graph for instance's fields
Summary: EA gives opportunite to do more aggressive memory optimizations.
Reviewed-by: never, jrose
author | kvn |
---|---|
date | Thu, 20 Mar 2008 15:11:44 -0700 |
parents | eac007780a58 |
children | ba764ed4b6f2 |
line wrap: on
line diff
--- a/src/share/vm/opto/graphKit.cpp Thu Mar 20 13:51:55 2008 -0700 +++ b/src/share/vm/opto/graphKit.cpp Thu Mar 20 15:11:44 2008 -0700 @@ -2922,10 +2922,22 @@ const TypeOopPtr* oop_type = tklass->as_instance_type(); // Now generate allocation code + + // With escape analysis, the entire memory state is needed to be able to + // eliminate the allocation. If the allocations cannot be eliminated, this + // will be optimized to the raw slice when the allocation is expanded. + Node *mem; + if (C->do_escape_analysis()) { + mem = reset_memory(); + set_all_memory(mem); + } else { + mem = memory(Compile::AliasIdxRaw); + } + AllocateNode* alloc = new (C, AllocateNode::ParmLimit) AllocateNode(C, AllocateNode::alloc_type(), - control(), memory(Compile::AliasIdxRaw), i_o(), + control(), mem, i_o(), size, klass_node, initial_slow_test); @@ -3056,11 +3068,23 @@ } // Now generate allocation code + + // With escape analysis, the entire memory state is needed to be able to + // eliminate the allocation. If the allocations cannot be eliminated, this + // will be optimized to the raw slice when the allocation is expanded. + Node *mem; + if (C->do_escape_analysis()) { + mem = reset_memory(); + set_all_memory(mem); + } else { + mem = memory(Compile::AliasIdxRaw); + } + // Create the AllocateArrayNode and its result projections AllocateArrayNode* alloc = new (C, AllocateArrayNode::ParmLimit) AllocateArrayNode(C, AllocateArrayNode::alloc_type(), - control(), memory(Compile::AliasIdxRaw), i_o(), + control(), mem, i_o(), size, klass_node, initial_slow_test, length);