hotspot/src/share/vm/oops/instanceRefKlass.cpp
changeset 46968 9119841280f4
parent 37129 af29e306e50b
equal deleted inserted replaced
46953:39063b484ec2 46968:9119841280f4
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    70 void InstanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
    70 void InstanceRefKlass::oop_verify_on(oop obj, outputStream* st) {
    71   InstanceKlass::oop_verify_on(obj, st);
    71   InstanceKlass::oop_verify_on(obj, st);
    72   // Verify referent field
    72   // Verify referent field
    73   oop referent = java_lang_ref_Reference::referent(obj);
    73   oop referent = java_lang_ref_Reference::referent(obj);
    74   if (referent != NULL) {
    74   if (referent != NULL) {
    75     guarantee(referent->is_oop(), "referent field heap failed");
    75     guarantee(oopDesc::is_oop(referent), "referent field heap failed");
    76   }
    76   }
    77   // Verify next field
    77   // Verify next field
    78   oop next = java_lang_ref_Reference::next(obj);
    78   oop next = java_lang_ref_Reference::next(obj);
    79   if (next != NULL) {
    79   if (next != NULL) {
    80     guarantee(next->is_oop(), "next field should be an oop");
    80     guarantee(oopDesc::is_oop(next), "next field should be an oop");
    81     guarantee(next->is_instance(), "next field should be an instance");
    81     guarantee(next->is_instance(), "next field should be an instance");
    82     guarantee(InstanceKlass::cast(next->klass())->is_reference_instance_klass(), "next field verify failed");
    82     guarantee(InstanceKlass::cast(next->klass())->is_reference_instance_klass(), "next field verify failed");
    83   }
    83   }
    84 }
    84 }