/** Copy the given entry and all entries shadowed by it to table */ private void copy(Entry e) { if (e.sym != null) { copy(e.shadowed); int hash = e.sym.name.index & hashMask; e.shadowed = table[hash]; table[hash] = e; } }
/** Double size of hash table. */ private void dble() { assert shared == 0; Entry[] oldtable = table; Entry[] newtable = new Entry[oldtable.length * 2]; for (Scope s = this; s != null; s = s.next) { if (s.table == oldtable) { assert s == this || s.shared != 0; s.table = newtable; s.hashMask = newtable.length - 1; } } for (int i = 0; i < newtable.length; i++) newtable[i] = sentinel; for (int i = 0; i < oldtable.length; i++) copy(oldtable[i]); }