bool jrst_find_method_all_class(char *methodName) { hash_data_t *data_list; list_t *allMethods; data_list = hash_locate(&h_options, (hash_key_t)"*"); if(data_list != NULL){ allMethods = *(list_t **)data_list; if(list_find(allMethods, (void *)methodName)){ return true; } } return false; }
bool jrst_find_method(jvmtiEnv *jvmtiLocate, jmethodID method, char *methodName) { jvmtiError error; jclass klass; char *className; char *classSignature; char *classGeneric; int size = 0; hash_data_t *data_list; list_t *methods; error = (*jvmtiLocate)->GetMethodDeclaringClass(jvmtiLocate, method, &klass); jrst_check_error(jvmtiLocate,error, "Cannot Get Method Declaring Class"); error = (*jvmtiLocate)->GetClassSignature(jvmtiLocate, klass, &classSignature, &classGeneric); jrst_check_error(jvmtiLocate,error, "Cannot Get Class Signature"); /*Tirar da signature o caracter 'L'*/ className = (char *)classSignature + 1; /* -1 Pois comeca em 0 o vetor*/ size = strlen(className) - 1; /*Tira da signature o caracter ';'*/ className[size] = '\0'; data_list = hash_locate(&h_options, (hash_key_t)className); if(data_list != NULL){ methods = *(list_t **)data_list; if(list_find(methods, (void *)"*") || list_find(methods, (void *)methodName)){ jrst_deallocate_class(jvmtiLocate, classSignature, classGeneric); return true; } } jrst_deallocate_class(jvmtiLocate, classSignature, classGeneric); return false; }
object *findlabel(char *s, char *limit) { object *result, *presult; int x; #ifdef STRUCTURE_DEPTH int y; #endif load_name(s, limit); if (label_highest_byte == 0) return NULL; #ifdef STRUCTURE_DEPTH if (active_x) { result = findchain_in_node(active_instance[active_x - 1]->l.down, name, limit); if (result) return result; } #endif presult = retrieve_dynamic_label(); if (presult) { #ifdef SYNONYMS if ((presult->l.valued == INTERNAL_FUNCTION) && (presult->l.value.b[RADIX/8-1] == SYNONYMS)) { } else #endif return presult; } #ifdef HASH /****************************************************** argument value 1 allows hash_locate(1) to return the functional value count_synonyms if subscripted synomyms are encountered ******************************************************/ result = hash_locate(1); if (result) { if (x = result->l.valued) { #ifdef STRUCTURE_DEPTH if ((*label_margin == sterm) && (x ^ FUNCTION) && (x ^ INTERNAL_FUNCTION) && (x ^ PROC) && (result->l.down)) { x = label_highest_byte; load_trailer(label_margin, limit); return findchain_in_node(result->l.down, name + x + 1, name + label_highest_byte); } #endif if ((result->l.valued == INTERNAL_FUNCTION) && (result->l.value.b[RADIX/8-1] == SYNONYMS)) { presult = result; result = NULL; } else return result; } } /***************************************************** presult is the count_synonyms function if the dynamic label stack contains some subscripted versions of THE(label) if this is so, THE(subscript) was already attached to the label in dynamic label stack search, and is now retained if it was not the dynamic label search which loaded the subscript, but the hash chain search, the subscript part is stripped before the search in the static label stack repeating load_name() strips the subscript the static label stack search attaches the subscript again if subscripted versions of THE(label) are found in practice SYNONYMS are always configured, except in the bcc DOS_LINKER version for 640K.DOS, where all possible features are stripped which linking does not use These 640K.DOS binaries separate the Linker from the Assembler because not all the features fit in one binary *****************************************************/ #ifdef STRUCTURE_DEPTH if (!result) { x = label_highest_byte; while (x--) { if (name[x] == sterm) { name[x] = 0; load_name(name, NULL); result = hash_locate(1); load_name(s, limit); if (result) { if ((result->l.down) && (y = result->l.valued) && (y ^ PROC) && (y ^ FUNCTION) && (y ^ INTERNAL_FUNCTION)) { return findchain_in_node(result->l.down, name + x + 1, name + label_highest_byte); break; } else result = NULL; } } } } #endif if (result) return result; return presult; #else /* HASH */ result = retrieve_label(limit); if (result) return result; return presult; #endif /* HASH */ }
static object *insert_ltable(char *column, char *limit, line_item *v, int type) { short global = masm_level; char *s; object *o = NULL; paragraph *p, *q; line_item vnew; value *vlbase; int x, size; int base_displacement = 0; #ifdef STRUCTURE_DEPTH object *adhesionp = (active_x) ? active_instance[active_x - 1] : NULL; int adhesion_level = -1; int b4 = type; #endif if (type == UNDEFINED) global = 0; else { load_name(column, limit); if (label_highest_byte == 0) return NULL; #ifdef SYNONYMS if (*label_margin == '(') load_qualifier(label_margin, limit); #endif s = label_margin; while (*s++ == '*') global--; } #ifdef STRUCTURE_DEPTH if ((adhesionp) && (global == adhesionp->l.passflag) && (type) && (type ^ SET) && (type ^ BLANK)) { o = findlabel_in_node(); adhesion_level = adhesionp->l.r.l.xref; if (adhesion_level < 0) adhesion_level = 0; global = adhesion_level; if (uselector['B'-'A']) printf("[L%x:A%x:G%x:V%x:P%X]%s:%s\n", masm_level, adhesion_level, global, type, adhesionp->l.passflag, adhesionp->l.name, name); } else { if (global > 0) { o = retrieve_dynamic_label(); if (o) { if (o->l.r.l.xref ^ global) o = NULL; } } else { #ifdef HASH o = hash_locate(0); #else o = retrieve_label(); #endif } } #else if (global > 0) { o = retrieve_dynamic_label(); if (o) { if (o->l.r.l.xref ^ global) o = NULL; } } else { #ifdef HASH o = hash_locate(0); #else o = retrieve_label(); #endif } #endif if ((type == LOCATION) || (type == BLANK)) { if (x = actual->flags & 129) { vnew = *v; v = &vnew; if (x & 128) { if (type == LOCATION) type = EQUF; v->b[RADIX/8-5] = actual->rbase; base_displacement = 1; } if (x == 1) { vlbase = (value *) actual->runbank; operand_add(v, &vlbase->value); } } } if (o) { if (type == BLANK) return o; x = o->l.valued; if (x == BLANK) { o->l.valued = type; o->l.value = *v; return o; } /************************************* $blank does not alter any label which already exists *************************************/ #ifdef RECORD if (type == RECORD) { if ((branch_record == 0) && (record_nest == 0)) base_displacement = 1; type = EQUF; if (actual->flags & 128) { vnew = *v; v = &vnew; v->b[RADIX/8-5] = actual->rbase; } } #endif if (x) { if (type ^ x) { if ((pass) && ((type == LOCATION) || (base_displacement))) { if ((x == EQU) || (x == SET) || (x == EQUF)) return o; } flagp(o->l.name, "may not be retyped"); return o; } } if (type == FORM) return o; if (type == SET) { } else { if (background_pass) { if (type == LOCATION) checkwave(v, o, actual->flags); else if (base_displacement) checkwaveb(v, o); } else { #ifdef BINARY if (o->l.valued == UNDEFINED) o->l.valued = type; else #endif { flagp1p(o->l.name, "may not be restated"); return o; } } } } else { #ifdef EQUAZE if ((type == EQU) || (type == SET)) type = BLANK; #endif size = sizeof(label) + label_length - PARAGRAPH; if (global > 0) { flotsam -= size; if (flotsam < 0) { flag_either_pass("too many dynamic labels", "abandon"); exit(0); } o = floatop; floatop = (object *) ((char *) floatop + size); o->l.along = NULL; floatop->i = 0; } else { o = lr; if (remainder < size) o = buy_ltable(); remainder -= size; lr = (object *) ((char *) lr + size); } lr->i = 0; p = (paragraph *) o->l.name; q = (paragraph *) name; x = label_length >> 2; while (x--) *p++ = *q++; o->l.r.i = 0; o->l.r.l.xref = global; #ifdef HASH o->l.hashlink = NULL; #endif #ifdef BINARY o->l.link = NULL; #endif o->l.down = NULL; o->l.along = NULL; o->h.type = LABEL; o->h.length = size; o->l.passflag = 0; o->l.valued = type; if (type == SET) o->l.value = zero_o; if (global > 0) { } else { #ifdef STRUCTURE_DEPTH if ((active_x) && (global == adhesion_level) && (b4) && (b4 ^ SET) && (b4 ^ BLANK)) inslabel(o); else #endif { #ifdef HASH hash_in(o); #endif if ((list) || (o->l.valued == UNDEFINED)) { insert_label(o); } } } } if (type == SET) { } else o->l.value = *v; o->l.passflag = masm_level; if ((uselector['L'-'A']) && (masm_level)) { printf("[%x<-%x:%x:%s:%d:%s]\n", masm_level, global, type, file_label[depth]->l.name, ll[depth], o->l.name); } if ((type == LOCATION) || (type == BLANK)) { o->l.r.l.rel = counter_of_reference | 128; if (actual->relocatable) o->l.r.l.y |= 1; else o->l.r.l.y &= 254; } if (base_displacement) o->l.r.l.rel = counter_of_reference | 128; return o; }