1.1 --- a/src/share/vm/opto/callnode.cpp Wed Jul 16 10:08:57 2008 -0700 1.2 +++ b/src/share/vm/opto/callnode.cpp Wed Jul 16 16:04:39 2008 -0700 1.3 @@ -631,61 +631,13 @@ 1.4 bool CallNode::may_modify(const TypePtr *addr_t, PhaseTransform *phase) { 1.5 const TypeOopPtr *adrInst_t = addr_t->isa_oopptr(); 1.6 1.7 - // if not an InstPtr or not an instance type, assume the worst 1.8 - if (adrInst_t == NULL || !adrInst_t->is_known_instance_field()) { 1.9 + // If not an OopPtr or not an instance type, assume the worst. 1.10 + // Note: currently this method is called only for instance types. 1.11 + if (adrInst_t == NULL || !adrInst_t->is_known_instance()) { 1.12 return true; 1.13 } 1.14 - Compile *C = phase->C; 1.15 - int offset = adrInst_t->offset(); 1.16 - assert(adrInst_t->klass_is_exact() && offset >= 0, "should be valid offset"); 1.17 - ciKlass* adr_k = adrInst_t->klass(); 1.18 - assert(adr_k->is_loaded() && 1.19 - adr_k->is_java_klass() && 1.20 - !adr_k->is_interface(), 1.21 - "only non-abstract classes are expected"); 1.22 - 1.23 - int base_idx = C->get_alias_index(adrInst_t); 1.24 - int size = BytesPerLong; // If we don't know the size, assume largest. 1.25 - if (adrInst_t->isa_instptr()) { 1.26 - ciField* field = C->alias_type(base_idx)->field(); 1.27 - if (field != NULL) { 1.28 - size = field->size_in_bytes(); 1.29 - } 1.30 - } else { 1.31 - assert(adrInst_t->isa_aryptr(), "only arrays are expected"); 1.32 - size = type2aelembytes(adr_k->as_array_klass()->element_type()->basic_type()); 1.33 - } 1.34 - 1.35 - ciMethod * meth = is_CallStaticJava() ? as_CallStaticJava()->method() : NULL; 1.36 - BCEscapeAnalyzer *bcea = (meth != NULL) ? meth->get_bcea() : NULL; 1.37 - 1.38 - const TypeTuple * d = tf()->domain(); 1.39 - for (uint i = TypeFunc::Parms; i < d->cnt(); i++) { 1.40 - const Type* t = d->field_at(i); 1.41 - Node *arg = in(i); 1.42 - const Type *at = phase->type(arg); 1.43 - if (at == TypePtr::NULL_PTR || at == Type::TOP) 1.44 - continue; // null can't affect anything 1.45 - 1.46 - const TypeOopPtr *at_ptr = at->isa_oopptr(); 1.47 - if (!arg->is_top() && (t->isa_oopptr() != NULL || 1.48 - t->isa_ptr() && at_ptr != NULL)) { 1.49 - assert(at_ptr != NULL, "expecting an OopPtr"); 1.50 - ciKlass* at_k = at_ptr->klass(); 1.51 - if ((adrInst_t->base() == at_ptr->base()) && 1.52 - at_k->is_loaded() && 1.53 - at_k->is_java_klass()) { 1.54 - // If we have found an argument matching addr_t, check if the field 1.55 - // at the specified offset is modified. 1.56 - if ((at_k->is_interface() || adr_k == at_k || 1.57 - adr_k->is_subclass_of(at_k) && !at_ptr->klass_is_exact()) && 1.58 - (bcea == NULL || 1.59 - bcea->is_arg_modified(i - TypeFunc::Parms, offset, size))) { 1.60 - return true; 1.61 - } 1.62 - } 1.63 - } 1.64 - } 1.65 + // The instance_id is set only for scalar-replaceable allocations which 1.66 + // are not passed as arguments according to Escape Analysis. 1.67 return false; 1.68 } 1.69