Branch: Tag:

2018-12-17

2018-12-17 13:41:32 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Use multisets for annotations on identifiers.

3554:       if (p->annotations) {    for (e = 0; e < p->num_annotations; e++) { -  do_free_array(p->annotations[e]); +  do_free_multiset(p->annotations[e]);    }    }   
4314:       if (val) {    if (Pike_compiler->new_program->annotations[id]) { -  Pike_compiler->new_program->annotations[id] = -  append_array(Pike_compiler->new_program->annotations[id], val); +  multiset_add(Pike_compiler->new_program->annotations[id], val);    } else {    push_svalue(val); -  Pike_compiler->new_program->annotations[id] = aggregate_array(1); +  f_aggregate_multiset(1); +  Pike_compiler->new_program->annotations[id] = Pike_sp[-1].u.multiset; +  Pike_sp--;    }    }   }
7991:    }    if ((p2->num_annotations > ref->identifier_offset) &&    p2->annotations[ref->identifier_offset]) { -  ref_push_array(p2->annotations[ref->identifier_offset]); -  f_mkmultiset(1); +  ref_push_multiset(p2->annotations[ref->identifier_offset]);    if (inh_ann) {    f_add(2);    }
9036:       for (e = p->num_annotations-1; e >= 0; e--) {    if (p->annotations[e]) -  gc_mark_array_as_referenced(p->annotations[e]); +  gc_mark_multiset_as_referenced(p->annotations[e]);    }    } GC_LEAVE;   }
9065:       for (e = p->num_annotations - 1; e >= 0; e--) {    if (p->annotations[e]) -  gc_cycle_check_array(p->annotations[e], 0); +  gc_cycle_check_multiset(p->annotations[e], 0);    }       /* Strong ref follows. It must be last. */
9240:    }       for (e = 0; e < p->num_annotations; e++) { -  do_free_array(p->annotations[e]); +  do_free_multiset(p->annotations[e]);    p->annotations[e] = NULL;    }