示例#1
0
// ------------------------------------------------------------------
// ciObject::klass
//
// Get the ciKlass of this ciObject.
ciKlass* ciObject::klass() {
    if (_klass == NULL) {
        if (_handle == NULL) {
            // When both _klass and _handle are NULL, we are dealing
            // with the distinguished instance of ciNullObject.
            // No one should ask it for its klass.
            assert(is_null_object(), "must be null object");
            ShouldNotReachHere();
            return NULL;
        }

        GUARDED_VM_ENTRY(
            oop o = get_oop();
            _klass = CURRENT_ENV->get_object(o->klass())->as_klass();
        );
    }
示例#2
0
 // Subclass casting with assertions.
 ciNullObject*            as_null_object() {
   assert(is_null_object(), "bad cast");
   return (ciNullObject*)this;
 }