public void addNativeSignature(int arity, MethodType signature) { if ( arity == -1 ) varSignature = signature; else { if ( signatures == null ) signatures = new IntHashMap<>(2); signatures.put(arity, signature); } }
public synchronized void clearTypes() { seenTypes.clear(); clearCount++; }
public boolean containsValue(Object value) { return contains(value); }
private static void methodData1(final IntHashMap<MethodData> methods, Invocation inv) { for (Entry<Invocation> entry : inv.getChildren().entrySet()) { Invocation child = entry.getValue(); int serial = child.getMethodSerialNumber(); MethodData data = methods.get(serial); if (data == null) { data = new MethodData(serial); methods.put(serial, data); } data.invocations.add(child); methodData1(methods, child); } }
callable = null; maxArity = -1; minArity = Integer.MAX_VALUE; IntHashMap<ArrayList<T>> arityMap = new IntHashMap<ArrayList<T>>(length, 1); ArrayList<T> methodsForArity = arityMap.get(currentArity); if (methodsForArity == null) { arityMap.put(currentArity, methodsForArity); final int usableArity = currentArity - 1; if ((methodsForArity = arityMap.get(usableArity)) == null) { methodsForArity = new ArrayList<T>(length); arityMap.put(usableArity, methodsForArity); for (IntHashMap.Entry<ArrayList<T>> entry : arityMap.entrySet()) { ArrayList<T> methodsForArity = entry.getValue();
/** * Compute the profiling results from gathered data. * @return the top invocation */ public Invocation computeResults() { setRecursiveDepths(); if (topInvocation.getChildren().size() != 1) { return setDuration(topInvocation); } if (topInvocation.getChildren().size() == 1) { Invocation singleTopChild = topInvocation.getChildren().values().iterator().next(); int serial = singleTopChild.getMethodSerialNumber(); if ( ProfilePrinter.PROFILER_PROFILE_METHOD.equals( methodName(serial) ) ) { for ( Invocation inv : singleTopChild.getChildren().values() ) { serial = inv.getMethodSerialNumber(); if ( ProfilePrinter.PROFILER_PROFILED_CODE_METHOD.equals( methodName(serial) ) ) { return setDuration(inv.copyWithNewSerialAndParent(0, null)); } } } } return setDuration(topInvocation); }
if ( cflag ) { ptable = tables.noDel; table = ptable != null ? ptable : new IntHashMap<>(8); tables.noDel = table; table = new IntHashMap<>(8); ptable = tables.del; tables.del = table; if ( ptable == null ) table.put(key, DUMMY_VALUE); else { if ( cflag ) table.put(key, DUMMY_VALUE); else { final boolean val = ptable.get(key) != null; table.put(key, val ? DUMMY_VALUE : null);
public long childTime() { long t = 0; for (Invocation inv : children.values()) { t += inv.getDuration(); } return t; }
public InvocationSet invocationsOfChild(int childSerial) { ArrayList<Invocation> p = new ArrayList<Invocation>(); for (Invocation inv : invocations) { Invocation childInv = inv.getChildren().get(childSerial); if (childInv != null) { p.add(childInv); } } return new InvocationSet(p); }
public int getNativeSignaturesCount() { int count = varSignature == null ? 0 : 1; if ( signatures != null ) count += signatures.size(); return count; }
public Invocation(Invocation parent, int serial) { this.parent = parent; this.methodSerialNumber = serial; this.children = new IntHashMap<Invocation>(); }
public int[] children() { IntList p = new IntList(); for (Invocation inv : invocations) { for (Integer childSerial : inv.getChildren().keySet()) { if (!p.contains(childSerial)) { p.add(childSerial); } } } return p.toIntArray(); }
@Override public String toString() { Iterator<Entry<V>> i = entrySet().iterator(); if (! i.hasNext()) return "{}"; StringBuilder sb = new StringBuilder(); sb.append('{'); for (;;) { Entry<V> e = i.next(); V value = e.getValue(); sb.append(e.getKey()); sb.append('='); sb.append(value == this ? "(this IntHashMap)" : value); if (! i.hasNext()) return sb.append('}').toString(); sb.append(", "); } }
public V put(int key, V value) { // Makes sure the key is not already in the hashtable. Entry<V>[] tab = table; int hash = key; int index = (hash & 0x7FFFFFFF) % tab.length; for (Entry<V> e = tab[index]; e != null; e = e.next) { if (e.hash == hash) { V old = e.value; e.value = value; return old; } } if (count >= threshold) { // Rehash the table if the threshold is exceeded rehash(); tab = table; index = (hash & 0x7FFFFFFF) % tab.length; } // Creates the new entry. Entry<V> e = new Entry<V>(hash, key, value, tab[index]); tab[index] = e; count++; return null; }
public synchronized void addType(int typeCode) { seenTypes.put(typeCode, null); }
private static void methodData1(final IntHashMap<MethodData> methods, Invocation inv) { for (Entry<Invocation> entry : inv.getChildren().entrySet()) { Invocation child = entry.getValue(); int serial = child.getMethodSerialNumber(); MethodData data = methods.get(serial); if (data == null) { data = new MethodData(serial); methods.put(serial, data); } data.invocations.add(child); methodData1(methods, child); } }
callable = null; maxArity = -1; minArity = Integer.MAX_VALUE; IntHashMap<ArrayList<T>> arityMap = new IntHashMap<ArrayList<T>>(length, 1); ArrayList<T> methodsForArity = arityMap.get(currentArity); if (methodsForArity == null) { arityMap.put(currentArity, methodsForArity); final int usableArity = currentArity - 1; if ((methodsForArity = arityMap.get(usableArity)) == null) { methodsForArity = new ArrayList<T>(length); arityMap.put(usableArity, methodsForArity); for (IntHashMap.Entry<ArrayList<T>> entry : arityMap.entrySet()) { ArrayList<T> methodsForArity = entry.getValue();