package org.jruby.ir.targets;
import org.jruby.util.collections.IntHashMap;
public class SiteTracker {
private final IntHashMap<?> seenTypes = new IntHashMap<>(4);
private volatile int clearCount = 0;
public synchronized boolean hasSeenType(int typeCode) {
return seenTypes.containsKey(typeCode);
}
public synchronized void addType(int typeCode) {
seenTypes.put(typeCode, null);
}
public synchronized int seenTypesCount() {
return seenTypes.size();
}
public synchronized void clearTypes() {
seenTypes.clear();
clearCount++;
}
public int clearCount() {
return clearCount;
}
}