src/share/vm/oops/objArrayKlass.cpp

changeset 4280
80e866b1d053
parent 4278
070d523b96a7
child 4304
90273fc0a981
     1.1 --- a/src/share/vm/oops/objArrayKlass.cpp	Fri Nov 16 09:59:08 2012 +0100
     1.2 +++ b/src/share/vm/oops/objArrayKlass.cpp	Fri Nov 16 09:19:12 2012 -0500
     1.3 @@ -81,7 +81,7 @@
     1.4        Array<Klass*>* element_supers = element_klass->secondary_supers();
     1.5        for( int i = element_supers->length()-1; i >= 0; i-- ) {
     1.6          Klass* elem_super = element_supers->at(i);
     1.7 -        if (Klass::cast(elem_super)->array_klass_or_null() == NULL) {
     1.8 +        if (elem_super->array_klass_or_null() == NULL) {
     1.9            supers_exist = false;
    1.10            break;
    1.11          }
    1.12 @@ -172,7 +172,7 @@
    1.13    } else {
    1.14      bk = element_klass();
    1.15    }
    1.16 -  assert(bk != NULL && (Klass::cast(bk)->oop_is_instance() || Klass::cast(bk)->oop_is_typeArray()), "invalid bottom klass");
    1.17 +  assert(bk != NULL && (bk->oop_is_instance() || bk->oop_is_typeArray()), "invalid bottom klass");
    1.18    this->set_bottom_klass(bk);
    1.19    this->set_class_loader_data(bk->class_loader_data());
    1.20  
    1.21 @@ -254,7 +254,7 @@
    1.22      // We have to make sure all elements conform to the destination array
    1.23      Klass* bound = ObjArrayKlass::cast(d->klass())->element_klass();
    1.24      Klass* stype = ObjArrayKlass::cast(s->klass())->element_klass();
    1.25 -    if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) {
    1.26 +    if (stype == bound || stype->is_subtype_of(bound)) {
    1.27        // elements are guaranteed to be subtypes, so no check necessary
    1.28        bs->write_ref_array_pre(dst, length);
    1.29        Copy::conjoint_oops_atomic(src, dst, length);
    1.30 @@ -271,7 +271,7 @@
    1.31          oop new_val = element_is_null ? oop(NULL)
    1.32                                        : oopDesc::decode_heap_oop_not_null(element);
    1.33          if (element_is_null ||
    1.34 -            Klass::cast((new_val->klass()))->is_subtype_of(bound)) {
    1.35 +            (new_val->klass())->is_subtype_of(bound)) {
    1.36            bs->write_ref_field_pre(p, new_val);
    1.37            *p = *from;
    1.38          } else {
    1.39 @@ -381,7 +381,7 @@
    1.40  
    1.41  GrowableArray<Klass*>* ObjArrayKlass::compute_secondary_supers(int num_extra_slots) {
    1.42    // interfaces = { cloneable_klass, serializable_klass, elemSuper[], ... };
    1.43 -  Array<Klass*>* elem_supers = Klass::cast(element_klass())->secondary_supers();
    1.44 +  Array<Klass*>* elem_supers = element_klass()->secondary_supers();
    1.45    int num_elem_supers = elem_supers == NULL ? 0 : elem_supers->length();
    1.46    int num_secondaries = num_extra_slots + 2 + num_elem_supers;
    1.47    if (num_secondaries == 2) {
    1.48 @@ -411,7 +411,7 @@
    1.49  }
    1.50  
    1.51  void ObjArrayKlass::initialize(TRAPS) {
    1.52 -  Klass::cast(bottom_klass())->initialize(THREAD);  // dispatches to either InstanceKlass or TypeArrayKlass
    1.53 +  bottom_klass()->initialize(THREAD);  // dispatches to either InstanceKlass or TypeArrayKlass
    1.54  }
    1.55  
    1.56  #define ObjArrayKlass_SPECIALIZED_OOP_ITERATE(T, a, p, do_oop) \
    1.57 @@ -607,7 +607,7 @@
    1.58      return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
    1.59    }
    1.60    // Return the flags of the bottom element type.
    1.61 -  jint element_flags = Klass::cast(bottom_klass())->compute_modifier_flags(CHECK_0);
    1.62 +  jint element_flags = bottom_klass()->compute_modifier_flags(CHECK_0);
    1.63  
    1.64    return (element_flags & (JVM_ACC_PUBLIC | JVM_ACC_PRIVATE | JVM_ACC_PROTECTED))
    1.65                          | (JVM_ACC_ABSTRACT | JVM_ACC_FINAL);
    1.66 @@ -686,7 +686,7 @@
    1.67    guarantee(element_klass()->is_klass(), "should be klass");
    1.68    guarantee(bottom_klass()->is_metadata(), "should be in metaspace");
    1.69    guarantee(bottom_klass()->is_klass(), "should be klass");
    1.70 -  Klass* bk = Klass::cast(bottom_klass());
    1.71 +  Klass* bk = bottom_klass();
    1.72    guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(),  "invalid bottom klass");
    1.73  }
    1.74  

mercurial