src/share/vm/runtime/reflectionUtils.hpp

changeset 4037
da91efe96a93
parent 3137
e6b1331a51d2
child 4962
6f817ce50129
     1.1 --- a/src/share/vm/runtime/reflectionUtils.hpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/runtime/reflectionUtils.hpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -39,14 +39,14 @@
    1.11  // interfaces last).
    1.12  //
    1.13  //    for (KlassStream st(k, false, false); !st.eos(); st.next()) {
    1.14 -//      klassOop k = st.klass();
    1.15 +//      Klass* k = st.klass();
    1.16  //      ...
    1.17  //    }
    1.18  
    1.19  class KlassStream VALUE_OBJ_CLASS_SPEC {
    1.20   protected:
    1.21    instanceKlassHandle _klass;           // current klass/interface iterated over
    1.22 -  objArrayHandle      _interfaces;      // transitive interfaces for initial class
    1.23 +  Array<Klass*>*    _interfaces;      // transitive interfaces for initial class
    1.24    int                 _interface_index; // current interface being processed
    1.25    bool                _local_only;      // process initial class/interface only
    1.26    bool                _classes_only;    // process classes only (no interfaces)
    1.27 @@ -75,14 +75,14 @@
    1.28  // Usage:
    1.29  //
    1.30  //    for (MethodStream st(k, false, false); !st.eos(); st.next()) {
    1.31 -//      methodOop m = st.method();
    1.32 +//      Method* m = st.method();
    1.33  //      ...
    1.34  //    }
    1.35  
    1.36  class MethodStream : public KlassStream {
    1.37   private:
    1.38    int length() const          { return methods()->length(); }
    1.39 -  objArrayOop methods() const { return _klass->methods(); }
    1.40 +  Array<Method*>* methods() const { return _klass->methods(); }
    1.41   public:
    1.42    MethodStream(instanceKlassHandle klass, bool local_only, bool classes_only)
    1.43      : KlassStream(klass, local_only, classes_only) {
    1.44 @@ -91,7 +91,7 @@
    1.45    }
    1.46  
    1.47    void next() { _index--; }
    1.48 -  methodOop method() const { return methodOop(methods()->obj_at(index())); }
    1.49 +  Method* method() const { return methods()->at(index()); }
    1.50  };
    1.51  
    1.52  
    1.53 @@ -138,16 +138,15 @@
    1.54  
    1.55  class FilteredField {
    1.56   private:
    1.57 -  klassOop _klass;
    1.58 +  Klass* _klass;
    1.59    int      _field_offset;
    1.60  
    1.61   public:
    1.62 -  FilteredField(klassOop klass, int field_offset) {
    1.63 +  FilteredField(Klass* klass, int field_offset) {
    1.64      _klass = klass;
    1.65      _field_offset = field_offset;
    1.66    }
    1.67 -  klassOop klass() { return _klass; }
    1.68 -  oop* klass_addr() { return (oop*) &_klass; }
    1.69 +  Klass* klass() { return _klass; }
    1.70    int  field_offset() { return _field_offset; }
    1.71  };
    1.72  
    1.73 @@ -156,7 +155,7 @@
    1.74    static GrowableArray<FilteredField *> *_filtered_fields;
    1.75   public:
    1.76    static void initialize();
    1.77 -  static bool is_filtered_field(klassOop klass, int field_offset) {
    1.78 +  static bool is_filtered_field(Klass* klass, int field_offset) {
    1.79      for (int i=0; i < _filtered_fields->length(); i++) {
    1.80        if (klass == _filtered_fields->at(i)->klass() &&
    1.81          field_offset == _filtered_fields->at(i)->field_offset()) {
    1.82 @@ -165,21 +164,21 @@
    1.83      }
    1.84      return false;
    1.85    }
    1.86 -  static int  filtered_fields_count(klassOop klass, bool local_only) {
    1.87 +  static int  filtered_fields_count(Klass* klass, bool local_only) {
    1.88      int nflds = 0;
    1.89      for (int i=0; i < _filtered_fields->length(); i++) {
    1.90        if (local_only && klass == _filtered_fields->at(i)->klass()) {
    1.91          nflds++;
    1.92 -      } else if (klass->klass_part()->is_subtype_of(_filtered_fields->at(i)->klass())) {
    1.93 +      } else if (klass->is_subtype_of(_filtered_fields->at(i)->klass())) {
    1.94          nflds++;
    1.95        }
    1.96      }
    1.97      return nflds;
    1.98    }
    1.99 -  // GC support.
   1.100 -  static void klasses_oops_do(OopClosure* f) {
   1.101 +  // Enhance Class Redefinition Support
   1.102 +  static void classes_do(KlassClosure* f) {
   1.103      for (int i = 0; i < _filtered_fields->length(); i++) {
   1.104 -      f->do_oop((oop*)_filtered_fields->at(i)->klass_addr());
   1.105 +      f->do_klass(_filtered_fields->at(i)->klass());
   1.106      }
   1.107    }
   1.108  };
   1.109 @@ -204,13 +203,13 @@
   1.110   public:
   1.111    FilteredFieldStream(instanceKlassHandle klass, bool local_only, bool classes_only)
   1.112      : FieldStream(klass, local_only, classes_only) {
   1.113 -    _filtered_fields_count = FilteredFieldsMap::filtered_fields_count((klassOop)klass(), local_only);
   1.114 +    _filtered_fields_count = FilteredFieldsMap::filtered_fields_count((Klass*)klass(), local_only);
   1.115    }
   1.116    int field_count();
   1.117    void next() {
   1.118      _index -= 1;
   1.119      if (has_filtered_field()) {
   1.120 -      while (_index >=0 && FilteredFieldsMap::is_filtered_field((klassOop)_klass(), offset())) {
   1.121 +      while (_index >=0 && FilteredFieldsMap::is_filtered_field((Klass*)_klass(), offset())) {
   1.122          _index -= 1;
   1.123        }
   1.124      }

mercurial