src/share/vm/opto/graphKit.cpp

changeset 1260
8f5825e0aeaa
parent 1215
c96bf21b756f
child 1262
bf3489cc0aa0
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Fri Jun 26 07:26:10 2009 -0700
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Fri Jun 26 13:03:29 2009 -0700
     1.3 @@ -1378,7 +1378,7 @@
     1.4                             Node* adr,
     1.5                             uint adr_idx,
     1.6                             Node *val,
     1.7 -                           const Type* val_type,
     1.8 +                           const TypeOopPtr* val_type,
     1.9                             BasicType bt) {
    1.10    BarrierSet* bs = Universe::heap()->barrier_set();
    1.11    set_control(ctl);
    1.12 @@ -1436,7 +1436,7 @@
    1.13                                      Node* adr,
    1.14                                      const TypePtr* adr_type,
    1.15                                      Node *val,
    1.16 -                                    const Type* val_type,
    1.17 +                                    const TypeOopPtr* val_type,
    1.18                                      BasicType bt) {
    1.19    uint adr_idx = C->get_alias_index(adr_type);
    1.20    Node* store;
    1.21 @@ -1451,7 +1451,7 @@
    1.22                                     Node* adr,
    1.23                                     const TypePtr* adr_type,
    1.24                                     Node *val,
    1.25 -                                   const Type* val_type,
    1.26 +                                   const TypeOopPtr* val_type,
    1.27                                     BasicType bt) {
    1.28    uint adr_idx = C->get_alias_index(adr_type);
    1.29    Node* store;
    1.30 @@ -1466,12 +1466,29 @@
    1.31                                       Node* adr,
    1.32                                       const TypePtr* adr_type,
    1.33                                       Node *val,
    1.34 -                                     const Type* val_type,
    1.35                                       BasicType bt) {
    1.36 -  uint adr_idx = C->get_alias_index(adr_type);
    1.37 -  Node* store;
    1.38 +  Compile::AliasType* at = C->alias_type(adr_type);
    1.39 +  const TypeOopPtr* val_type = NULL;
    1.40 +  if (adr_type->isa_instptr()) {
    1.41 +    if (at->field() != NULL) {
    1.42 +      // known field.  This code is a copy of the do_put_xxx logic.
    1.43 +      ciField* field = at->field();
    1.44 +      if (!field->type()->is_loaded()) {
    1.45 +        val_type = TypeInstPtr::BOTTOM;
    1.46 +      } else {
    1.47 +        val_type = TypeOopPtr::make_from_klass(field->type()->as_klass());
    1.48 +      }
    1.49 +    }
    1.50 +  } else if (adr_type->isa_aryptr()) {
    1.51 +    val_type = adr_type->is_aryptr()->elem()->isa_oopptr();
    1.52 +  }
    1.53 +  if (val_type == NULL) {
    1.54 +    val_type = TypeInstPtr::BOTTOM;
    1.55 +  }
    1.56 +
    1.57 +  uint adr_idx = at->index();
    1.58    pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt);
    1.59 -  store = store_to_memory(control(), adr, val, bt, adr_idx);
    1.60 +  Node* store = store_to_memory(control(), adr, val, bt, adr_idx);
    1.61    post_barrier(control(), store, obj, adr, adr_idx, val, bt, true);
    1.62    return store;
    1.63  }
    1.64 @@ -3202,7 +3219,7 @@
    1.65                                      Node* adr,
    1.66                                      uint alias_idx,
    1.67                                      Node* val,
    1.68 -                                    const Type* val_type,
    1.69 +                                    const TypeOopPtr* val_type,
    1.70                                      BasicType bt) {
    1.71    IdealKit ideal(gvn(), control(), merged_memory(), true);
    1.72  #define __ ideal.

mercurial