src/share/vm/opto/graphKit.cpp

changeset 5658
edb5ab0f3fe5
parent 5637
29aa8936f03c
child 5799
d8d059e90ec1
child 5860
69944b868a32
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Mon Sep 09 19:53:28 2013 +0200
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Tue Sep 10 14:51:48 2013 -0700
     1.3 @@ -3825,8 +3825,13 @@
     1.4                                                     TypeAry::make(TypeInt::CHAR,TypeInt::POS),
     1.5                                                     ciTypeArrayKlass::make(T_CHAR), true, 0);
     1.6    int value_field_idx = C->get_alias_index(value_field_type);
     1.7 -  return make_load(ctrl, basic_plus_adr(str, str, value_offset),
     1.8 -                   value_type, T_OBJECT, value_field_idx);
     1.9 +  Node* load = make_load(ctrl, basic_plus_adr(str, str, value_offset),
    1.10 +                         value_type, T_OBJECT, value_field_idx);
    1.11 +  // String.value field is known to be @Stable.
    1.12 +  if (UseImplicitStableValues) {
    1.13 +    load = cast_array_to_stable(load, value_type);
    1.14 +  }
    1.15 +  return load;
    1.16  }
    1.17  
    1.18  void GraphKit::store_String_offset(Node* ctrl, Node* str, Node* value) {
    1.19 @@ -3844,9 +3849,6 @@
    1.20    const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
    1.21                                                       false, NULL, 0);
    1.22    const TypePtr* value_field_type = string_type->add_offset(value_offset);
    1.23 -  const TypeAryPtr*  value_type = TypeAryPtr::make(TypePtr::NotNull,
    1.24 -                                                   TypeAry::make(TypeInt::CHAR,TypeInt::POS),
    1.25 -                                                   ciTypeArrayKlass::make(T_CHAR), true, 0);
    1.26    int value_field_idx = C->get_alias_index(value_field_type);
    1.27    store_to_memory(ctrl, basic_plus_adr(str, value_offset),
    1.28                    value, T_OBJECT, value_field_idx);
    1.29 @@ -3861,3 +3863,9 @@
    1.30    store_to_memory(ctrl, basic_plus_adr(str, count_offset),
    1.31                    value, T_INT, count_field_idx);
    1.32  }
    1.33 +
    1.34 +Node* GraphKit::cast_array_to_stable(Node* ary, const TypeAryPtr* ary_type) {
    1.35 +  // Reify the property as a CastPP node in Ideal graph to comply with monotonicity
    1.36 +  // assumption of CCP analysis.
    1.37 +  return _gvn.transform(new(C) CastPPNode(ary, ary_type->cast_to_stable(true)));
    1.38 +}

mercurial