/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "memory/allocation.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/reflection.hpp"
#include "utilities/accessFlags.hpp"
#include "utilities/globalDefinitions.hpp"
// A KlassStream is an abstract stream for streaming over self, superclasses
// and (super)interfaces. Streaming is done in reverse order (subclasses first,
// interfaces last).
//
// for (KlassStream st(k, false, false); !st.eos(); st.next()) {
// klassOop k = st.klass();
// ...
// }
protected:
int _index;
virtual int length() const = 0;
public:
// constructor
// testing
bool eos();
// iterating
virtual void next() = 0;
// accessors
};
// A MethodStream streams over all methods in a class, superclasses and (super)interfaces.
// Streaming is done in reverse order (subclasses first, methods in reverse order)
// Usage:
//
// for (MethodStream st(k, false, false); !st.eos(); st.next()) {
// methodOop m = st.method();
// ...
// }
private:
public:
next();
}
};
// A FieldStream streams over all fields in a class, superclasses and (super)interfaces.
// Streaming is done in reverse order (subclasses first, fields in reverse order)
// Usage:
//
// for (FieldStream st(k, false, false); !st.eos(); st.next()) {
// Symbol* field_name = st.name();
// ...
// }
private:
public:
next();
}
// Accessors for current field
return flags;
}
}
}
// missing: initval()
int offset() const {
}
};
class FilteredField {
private:
int _field_offset;
public:
}
};
private:
public:
static void initialize();
for (int i=0; i < _filtered_fields->length(); i++) {
return true;
}
}
return false;
}
int nflds = 0;
for (int i=0; i < _filtered_fields->length(); i++) {
nflds++;
nflds++;
}
}
return nflds;
}
// GC support.
for (int i = 0; i < _filtered_fields->length(); i++) {
}
}
};
// A FilteredFieldStream streams over all fields in a class, superclasses and
// (super)interfaces. Streaming is done in reverse order (subclasses first,
// fields in reverse order)
//
// Usage:
//
// for (FilteredFieldStream st(k, false, false); !st.eos(); st.next()) {
// Symbol* field_name = st.name();
// ...
// }
private:
public:
}
int field_count();
void next() {
_index -= 1;
if (has_filtered_field()) {
_index -= 1;
}
}
}
};
#endif // SHARE_VM_RUNTIME_REFLECTIONUTILS_HPP