/*
* 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 "precompiled.hpp"
#include "ci/ciKlass.hpp"
#include "ci/ciSymbol.hpp"
#include "ci/ciUtilities.hpp"
#include "oops/oop.inline.hpp"
// ciKlass
//
// This class represents a klassOop in the HotSpot virtual
// machine.
// ------------------------------------------------------------------
// ciKlass::ciKlass
_layout_helper = k->layout_helper();
}
// ------------------------------------------------------------------
// ciKlass::ciKlass
//
// Nameless klass variant.
}
// ------------------------------------------------------------------
// ciKlass::ciKlass
//
// Unloaded klass variant.
}
// ------------------------------------------------------------------
// ciKlass::is_subtype_of
// Check to see if the klasses are identical.
if (this == that) {
return true;
}
return result;
}
// ------------------------------------------------------------------
// ciKlass::is_subclass_of
// Check to see if the klasses are identical.
return result;
}
// ------------------------------------------------------------------
// ciKlass::super_depth
return this_klass->super_depth();
}
// ------------------------------------------------------------------
// ciKlass::super_check_offset
return this_klass->super_check_offset();
}
// ------------------------------------------------------------------
// ciKlass::super_of_depth
}
// ------------------------------------------------------------------
// ciKlass::can_be_primary_super
return this_klass->can_be_primary_super();
}
// ------------------------------------------------------------------
// ciKlass::least_common_ancestor
//
// Get the shared parent of two klasses.
//
// Implementation note: this method currently goes "over the wall"
// and does all of the work on the VM side. It could be rewritten
// to use the super() method and do all of the work (aside from the
// lazy computation of super()) in native mode. This may be
// worthwhile if the compiler is repeatedly requesting the same lca
// computation or possibly if most of the superklasses have already
// been created as ciObjects anyway. Something to think about...
// Check to see if the klasses are identical.
if (this == that) {
return this;
}
// Many times the LCA will be either this_klass or that_klass.
// Treat these as special cases.
if (lca == that_klass) {
return that;
}
if (this_klass == lca) {
return this;
}
// Create the ciInstanceKlass for the lca.
return result;
}
// ------------------------------------------------------------------
// ciKlass::find_klass
//
// Find a klass using this klass's class loader.
return CURRENT_ENV->get_klass_by_name(this,
klass_name, false);
}
// ------------------------------------------------------------------
// ciKlass::java_mirror
//
// Get the instance of java.lang.Class corresponding to this klass.
// If it is an unloaded instance or array klass, return an unloaded
// mirror object of type Class.
if (!is_loaded())
)
}
// ------------------------------------------------------------------
// ciKlass::modifier_flags
return get_Klass()->modifier_flags();
)
}
// ------------------------------------------------------------------
// ciKlass::access_flags
)
}
// ------------------------------------------------------------------
// ciKlass::print_impl
//
// Implementation of the print method
}
// ------------------------------------------------------------------
// ciKlass::print_name
//
// Print the name of this klass
}