MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / reset

Method reset

chapter24/src/main/java/com/seaofnodes/simple/type/Type.java:232–253  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230
231 // Clear and re-insert the basic Type INTERN table
232 public static void reset() {
233 VISIT.clear();
234 FREES.clear();
235 if( INTERN0.isEmpty() ) {
236 // First time run all <clinit> and collect basic types
237 Type t = TypeRPC .BOT; // Force class load, intern
238 Type u = TypeTuple.BOT; // Force class load, intern
239 Type w = TypePtr .PTR; // Force class load, intern
240 INTERN0.putAll(INTERN);
241 } else {
242 // Later times, reset back to first time
243 VISIT.put(0,CONTROL); // Defeat assert
244 for( Iterator<Type> it = INTERN.keySet().iterator(); it.hasNext(); ) {
245 Type t = it.next();
246 if( !INTERN0.containsKey(t) )
247 { t._terned=false; t.free(t); }
248 it.remove();
249 }
250 VISIT.clear();
251 INTERN.putAll(INTERN0);
252 }
253 }
254
255 // ----------------------------------------------------------
256 public final Type meet(Type t) {

Callers 1

CodeGenMethod · 0.95

Calls 8

freeMethod · 0.95
clearMethod · 0.45
isEmptyMethod · 0.45
putMethod · 0.45
iteratorMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected