提交 b490f5fe 编写于 作者: S stefank

8035746: Add missing Klass::oop_is_instanceClassLoader() function

Reviewed-by: mgerdin, coleenp
上级 9fb9e887
......@@ -699,3 +699,21 @@ bool Klass::verify_itable_index(int i) {
}
#endif
/////////////// Unit tests ///////////////
#ifndef PRODUCT
class TestKlass {
public:
static void test_oop_is_instanceClassLoader() {
assert(SystemDictionary::ClassLoader_klass()->oop_is_instanceClassLoader(), "assert");
assert(!SystemDictionary::String_klass()->oop_is_instanceClassLoader(), "assert");
}
};
void TestKlass_test() {
TestKlass::test_oop_is_instanceClassLoader();
}
#endif
......@@ -499,6 +499,7 @@ class Klass : public Metadata {
virtual bool oop_is_objArray_slow() const { return false; }
virtual bool oop_is_typeArray_slow() const { return false; }
public:
virtual bool oop_is_instanceClassLoader() const { return false; }
virtual bool oop_is_instanceMirror() const { return false; }
virtual bool oop_is_instanceRef() const { return false; }
......
......@@ -109,12 +109,13 @@ class oopDesc {
int size_given_klass(Klass* klass);
// type test operations (inlined in oop.inline.h)
bool is_instance() const;
bool is_instanceMirror() const;
bool is_instanceRef() const;
bool is_array() const;
bool is_objArray() const;
bool is_typeArray() const;
bool is_instance() const;
bool is_instanceMirror() const;
bool is_instanceClassLoader() const;
bool is_instanceRef() const;
bool is_array() const;
bool is_objArray() const;
bool is_typeArray() const;
private:
// field addresses in oop
......
......@@ -148,12 +148,13 @@ inline void oopDesc::init_mark() { set_mark(markOopDesc::proto
inline bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); }
inline bool oopDesc::is_instance() const { return klass()->oop_is_instance(); }
inline bool oopDesc::is_instanceMirror() const { return klass()->oop_is_instanceMirror(); }
inline bool oopDesc::is_instanceRef() const { return klass()->oop_is_instanceRef(); }
inline bool oopDesc::is_array() const { return klass()->oop_is_array(); }
inline bool oopDesc::is_objArray() const { return klass()->oop_is_objArray(); }
inline bool oopDesc::is_typeArray() const { return klass()->oop_is_typeArray(); }
inline bool oopDesc::is_instance() const { return klass()->oop_is_instance(); }
inline bool oopDesc::is_instanceClassLoader() const { return klass()->oop_is_instanceClassLoader(); }
inline bool oopDesc::is_instanceMirror() const { return klass()->oop_is_instanceMirror(); }
inline bool oopDesc::is_instanceRef() const { return klass()->oop_is_instanceRef(); }
inline bool oopDesc::is_array() const { return klass()->oop_is_array(); }
inline bool oopDesc::is_objArray() const { return klass()->oop_is_objArray(); }
inline bool oopDesc::is_typeArray() const { return klass()->oop_is_typeArray(); }
inline void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; }
......
......@@ -5082,6 +5082,7 @@ void TestMetaspaceAux_test();
void TestMetachunk_test();
void TestVirtualSpaceNode_test();
void TestNewSize_test();
void TestKlass_test();
#if INCLUDE_ALL_GCS
void TestOldFreeSpaceCalculation_test();
void TestG1BiasedArray_test();
......@@ -5106,6 +5107,7 @@ void execute_internal_vm_tests() {
run_unit_test(AltHashing::test_alt_hash());
run_unit_test(test_loggc_filename());
run_unit_test(TestNewSize_test());
run_unit_test(TestKlass_test());
#if INCLUDE_VM_STRUCTS
run_unit_test(VMStructs::test());
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册