comparison src/share/vm/opto/escape.cpp @ 1543:1a1603f975b5

Merge
author kvn
date Wed, 19 May 2010 10:22:39 -0700
parents c52275c698d1
children c18cbe5936b8
comparison
equal deleted inserted replaced
1542:eb79484f795f 1543:1a1603f975b5
1987 1987
1988 switch (call->Opcode()) { 1988 switch (call->Opcode()) {
1989 case Op_Allocate: 1989 case Op_Allocate:
1990 { 1990 {
1991 Node *k = call->in(AllocateNode::KlassNode); 1991 Node *k = call->in(AllocateNode::KlassNode);
1992 const TypeKlassPtr *kt; 1992 const TypeKlassPtr *kt = k->bottom_type()->isa_klassptr();
1993 if (k->Opcode() == Op_LoadKlass) {
1994 kt = k->as_Load()->type()->isa_klassptr();
1995 } else {
1996 // Also works for DecodeN(LoadNKlass).
1997 kt = k->as_Type()->type()->isa_klassptr();
1998 }
1999 assert(kt != NULL, "TypeKlassPtr required."); 1993 assert(kt != NULL, "TypeKlassPtr required.");
2000 ciKlass* cik = kt->klass(); 1994 ciKlass* cik = kt->klass();
2001 ciInstanceKlass* ciik = cik->as_instance_klass();
2002 1995
2003 PointsToNode::EscapeState es; 1996 PointsToNode::EscapeState es;
2004 uint edge_to; 1997 uint edge_to;
2005 if (cik->is_subclass_of(_compile->env()->Thread_klass()) || ciik->has_finalizer()) { 1998 if (cik->is_subclass_of(_compile->env()->Thread_klass()) ||
1999 !cik->is_instance_klass() || // StressReflectiveCode
2000 cik->as_instance_klass()->has_finalizer()) {
2006 es = PointsToNode::GlobalEscape; 2001 es = PointsToNode::GlobalEscape;
2007 edge_to = _phantom_object; // Could not be worse 2002 edge_to = _phantom_object; // Could not be worse
2008 } else { 2003 } else {
2009 es = PointsToNode::NoEscape; 2004 es = PointsToNode::NoEscape;
2010 edge_to = call_idx; 2005 edge_to = call_idx;
2015 break; 2010 break;
2016 } 2011 }
2017 2012
2018 case Op_AllocateArray: 2013 case Op_AllocateArray:
2019 { 2014 {
2020 int length = call->in(AllocateNode::ALength)->find_int_con(-1); 2015
2021 if (length < 0 || length > EliminateAllocationArraySizeLimit) { 2016 Node *k = call->in(AllocateNode::KlassNode);
2022 // Not scalar replaceable if the length is not constant or too big. 2017 const TypeKlassPtr *kt = k->bottom_type()->isa_klassptr();
2023 ptnode_adr(call_idx)->_scalar_replaceable = false; 2018 assert(kt != NULL, "TypeKlassPtr required.");
2024 } 2019 ciKlass* cik = kt->klass();
2025 set_escape_state(call_idx, PointsToNode::NoEscape); 2020
2026 add_pointsto_edge(resproj_idx, call_idx); 2021 PointsToNode::EscapeState es;
2022 uint edge_to;
2023 if (!cik->is_array_klass()) { // StressReflectiveCode
2024 es = PointsToNode::GlobalEscape;
2025 edge_to = _phantom_object;
2026 } else {
2027 es = PointsToNode::NoEscape;
2028 edge_to = call_idx;
2029 int length = call->in(AllocateNode::ALength)->find_int_con(-1);
2030 if (length < 0 || length > EliminateAllocationArraySizeLimit) {
2031 // Not scalar replaceable if the length is not constant or too big.
2032 ptnode_adr(call_idx)->_scalar_replaceable = false;
2033 }
2034 }
2035 set_escape_state(call_idx, es);
2036 add_pointsto_edge(resproj_idx, edge_to);
2027 _processed.set(resproj_idx); 2037 _processed.set(resproj_idx);
2028 break; 2038 break;
2029 } 2039 }
2030 2040
2031 case Op_CallStaticJava: 2041 case Op_CallStaticJava: