547 bool ciInstanceKlass::is_leaf_type() {
548 assert(is_loaded(), "must be loaded");
549 if (is_shared()) {
550 return is_final(); // approximately correct
551 } else {
552 return !_has_subklass && (_nof_implementors == 0);
553 }
554 }
555
556 // ------------------------------------------------------------------
557 // ciInstanceKlass::implementor
558 //
559 // Report an implementor of this interface.
560 // Returns NULL if exact information is not available.
561 // Note that there are various races here, since my copy
562 // of _nof_implementors might be out of date with respect
563 // to results returned by instanceKlass::implementor.
564 // This is OK, since any dependencies we decide to assert
565 // will be checked later under the Compile_lock.
566 ciInstanceKlass* ciInstanceKlass::implementor(int n) {
567 if (n > implementors_limit) {
568 return NULL;
569 }
570 ciInstanceKlass* impl = _implementors[n];
571 if (impl == NULL) {
572 if (_nof_implementors > implementors_limit) {
573 return NULL;
574 }
575 // Go into the VM to fetch the implementor.
576 {
577 VM_ENTRY_MARK;
578 klassOop k = get_instanceKlass()->implementor(n);
579 if (k != NULL) {
580 impl = CURRENT_THREAD_ENV->get_object(k)->as_instance_klass();
581 }
582 }
583 // Memoize this result.
584 if (!is_shared()) {
585 _implementors[n] = (impl == NULL)? this: impl;
586 }
587 } else if (impl == this) {
|
547 bool ciInstanceKlass::is_leaf_type() {
548 assert(is_loaded(), "must be loaded");
549 if (is_shared()) {
550 return is_final(); // approximately correct
551 } else {
552 return !_has_subklass && (_nof_implementors == 0);
553 }
554 }
555
556 // ------------------------------------------------------------------
557 // ciInstanceKlass::implementor
558 //
559 // Report an implementor of this interface.
560 // Returns NULL if exact information is not available.
561 // Note that there are various races here, since my copy
562 // of _nof_implementors might be out of date with respect
563 // to results returned by instanceKlass::implementor.
564 // This is OK, since any dependencies we decide to assert
565 // will be checked later under the Compile_lock.
566 ciInstanceKlass* ciInstanceKlass::implementor(int n) {
567 if (n >= implementors_limit) {
568 return NULL;
569 }
570 ciInstanceKlass* impl = _implementors[n];
571 if (impl == NULL) {
572 if (_nof_implementors > implementors_limit) {
573 return NULL;
574 }
575 // Go into the VM to fetch the implementor.
576 {
577 VM_ENTRY_MARK;
578 klassOop k = get_instanceKlass()->implementor(n);
579 if (k != NULL) {
580 impl = CURRENT_THREAD_ENV->get_object(k)->as_instance_klass();
581 }
582 }
583 // Memoize this result.
584 if (!is_shared()) {
585 _implementors[n] = (impl == NULL)? this: impl;
586 }
587 } else if (impl == this) {
|