604 assert(klass != NULL, "klass must not be NULL");
605
606 int len = (int) strlen(ty_sign);
607 if (ty_sign[0] == 'L' && ty_sign[len-1] == ';') { // Need pure class/interface name
608 ty_sign++;
609 len -= 2;
610 }
611 TempNewSymbol ty_sym = SymbolTable::new_symbol(ty_sign, len, thread);
612 if (klass->name() == ty_sym) {
613 return true;
614 }
615 // Compare primary supers
616 int super_depth = klass->super_depth();
617 int idx;
618 for (idx = 0; idx < super_depth; idx++) {
619 if (klass->primary_super_of_depth(idx)->name() == ty_sym) {
620 return true;
621 }
622 }
623 // Compare secondary supers
624 Array<Klass*>* sec_supers = klass->secondary_supers();
625 for (idx = 0; idx < sec_supers->length(); idx++) {
626 if (((Klass*) sec_supers->at(idx))->name() == ty_sym) {
627 return true;
628 }
629 }
630 return false;
631 }
632
633 // Checks error conditions:
634 // JVMTI_ERROR_INVALID_SLOT
635 // JVMTI_ERROR_TYPE_MISMATCH
636 // Returns: 'true' - everything is Ok, 'false' - error code
637
638 bool VM_GetOrSetLocal::check_slot_type(javaVFrame* jvf) {
639 Method* method_oop = jvf->method();
640 if (!method_oop->has_localvariable_table()) {
641 // Just to check index boundaries
642 jint extra_slot = (_type == T_LONG || _type == T_DOUBLE) ? 1 : 0;
643 if (_index < 0 || _index + extra_slot >= method_oop->max_locals()) {
644 _result = JVMTI_ERROR_INVALID_SLOT;
|
604 assert(klass != NULL, "klass must not be NULL");
605
606 int len = (int) strlen(ty_sign);
607 if (ty_sign[0] == 'L' && ty_sign[len-1] == ';') { // Need pure class/interface name
608 ty_sign++;
609 len -= 2;
610 }
611 TempNewSymbol ty_sym = SymbolTable::new_symbol(ty_sign, len, thread);
612 if (klass->name() == ty_sym) {
613 return true;
614 }
615 // Compare primary supers
616 int super_depth = klass->super_depth();
617 int idx;
618 for (idx = 0; idx < super_depth; idx++) {
619 if (klass->primary_super_of_depth(idx)->name() == ty_sym) {
620 return true;
621 }
622 }
623 // Compare secondary supers
624 const Array<Klass*>* sec_supers = klass->secondary_supers();
625 for (idx = 0; idx < sec_supers->length(); idx++) {
626 if (((Klass*) sec_supers->at(idx))->name() == ty_sym) {
627 return true;
628 }
629 }
630 return false;
631 }
632
633 // Checks error conditions:
634 // JVMTI_ERROR_INVALID_SLOT
635 // JVMTI_ERROR_TYPE_MISMATCH
636 // Returns: 'true' - everything is Ok, 'false' - error code
637
638 bool VM_GetOrSetLocal::check_slot_type(javaVFrame* jvf) {
639 Method* method_oop = jvf->method();
640 if (!method_oop->has_localvariable_table()) {
641 // Just to check index boundaries
642 jint extra_slot = (_type == T_LONG || _type == T_DOUBLE) ? 1 : 0;
643 if (_index < 0 || _index + extra_slot >= method_oop->max_locals()) {
644 _result = JVMTI_ERROR_INVALID_SLOT;
|