+slotinfo_t* registry_safefind(const char*package, const char*name)
+{
+ slotinfo_t*c = registry_find(package, name);
+ if(!c) {
+ printf("%s.%s\n", package, name);
+ }
+ assert(c);
+ return c;
+}
+void registry_dump()
+{
+ int t;
+ for(t=0;t<registry_classes->hashsize;t++) {
+ dictentry_t*e = registry_classes->slots[t];
+ while(e) {
+ slotinfo_t*i = (slotinfo_t*)e->key;
+ printf("[%s] %s.%s\n", access2str(i->access), i->package, i->name);
+ e = e->next;
+ }
+ }
+}
+
+memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char recursive, char is_static)
+{
+ memberinfo_t tmp;
+ tmp.name = name;
+ tmp.package = ns?ns:"";
+
+ if(!recursive) {
+ if(!is_static)
+ return (memberinfo_t*)dict_lookup(&cls->members, &tmp);
+ else
+ return (memberinfo_t*)dict_lookup(&cls->static_members, &tmp);
+ }
+ /* look at classes directly extended by this class */
+ slotinfo_t*m = 0;
+ classinfo_t*s = cls;
+
+ if(recursive>1) // check *only* superclasses
+ s = s->superclass;
+
+ while(s) {
+ if(s->kind == INFOTYPE_UNRESOLVED)
+ break;
+
+ if(!is_static) {
+ m = (slotinfo_t*)dict_lookup(&s->members, &tmp);
+ if(m) return (memberinfo_t*)m;
+ }
+ m = (slotinfo_t*)dict_lookup(&s->static_members, &tmp);
+ if(m) return (memberinfo_t*)m;
+
+ s = s->superclass;
+ }
+ /* look at interfaces, and parent interfaces */
+ int t=0;
+ while(cls->interfaces[t]) {
+ classinfo_t*s = cls->interfaces[t];
+ if(s->kind != INFOTYPE_UNRESOLVED) {
+ while(s) {
+ if(!is_static) {
+ m = (slotinfo_t*)dict_lookup(&s->members, &tmp);
+ if(m) return (memberinfo_t*)m;
+ }
+ m = (slotinfo_t*)dict_lookup(&s->static_members, &tmp);
+ if(m) return (memberinfo_t*)m;
+
+ s = s->superclass;
+ }
+ }
+ t++;
+ }
+ return 0;
+}
+
+memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses, char is_static)