Uprage HPPC to 0.7.3

This commit is contained in:
Alexey Andreev 2018-03-20 19:10:36 +03:00
parent de88541b64
commit 540ad7f694
24 changed files with 112 additions and 107 deletions

View File

@ -56,7 +56,7 @@
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId>
<version>0.6.1</version>
<version>0.7.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>

View File

@ -15,8 +15,8 @@
*/
package org.teavm.backend.wasm.generate;
import com.carrotsearch.hppc.ObjectIntHashMap;
import com.carrotsearch.hppc.ObjectIntMap;
import com.carrotsearch.hppc.ObjectIntOpenHashMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -515,7 +515,7 @@ public class WasmClassGenerator {
int alignment;
int start;
boolean isInferface;
ObjectIntMap<String> fieldLayout = new ObjectIntOpenHashMap<>();
ObjectIntMap<String> fieldLayout = new ObjectIntHashMap<>();
DataValue data;
ClassReader cls;
boolean function;

View File

@ -15,8 +15,8 @@
*/
package org.teavm.callgraph;
import com.carrotsearch.hppc.ObjectIntHashMap;
import com.carrotsearch.hppc.ObjectIntMap;
import com.carrotsearch.hppc.ObjectIntOpenHashMap;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@ -65,12 +65,12 @@ public class DefaultCallGraph implements CallGraph, Serializable {
static class SerializableCallGraphBuilder {
List<SerializableCallGraph.Node> nodes = new ArrayList<>();
ObjectIntMap<DefaultCallGraphNode> nodeToIndex = new ObjectIntOpenHashMap<>();
ObjectIntMap<DefaultCallGraphNode> nodeToIndex = new ObjectIntHashMap<>();
List<SerializableCallGraph.CallSite> callSites = new ArrayList<>();
List<DefaultCallSite> originalCallSites = new ArrayList<>();
ObjectIntMap<DefaultCallSite> callSiteToIndex = new ObjectIntOpenHashMap<>();
ObjectIntMap<DefaultCallSite> callSiteToIndex = new ObjectIntHashMap<>();
List<SerializableCallGraph.FieldAccess> fieldAccessList = new ArrayList<>();
ObjectIntMap<DefaultFieldAccessSite> fieldAccessToIndex = new ObjectIntOpenHashMap<>();
ObjectIntMap<DefaultFieldAccessSite> fieldAccessToIndex = new ObjectIntHashMap<>();
List<DefaultCallGraphNode> nodesToProcess = new ArrayList<>();
List<DefaultCallSite> callSitesToProcess = new ArrayList<>();
List<DefaultFieldAccessSite> fieldAccessToProcess = new ArrayList<>();

View File

@ -15,7 +15,7 @@
*/
package org.teavm.common;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.ArrayList;
@ -199,7 +199,7 @@ public class DJGraph {
public int collapse(int[] nodes) {
// Replace nodes with their classes and find common dominator among them
IntSet set = new IntOpenHashSet();
IntSet set = new IntHashSet();
int top = nodes[0];
for (int node : nodes) {
node = mergeRoot[node];

View File

@ -15,8 +15,8 @@
*/
package org.teavm.common;
import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import com.carrotsearch.hppc.IntIntOpenHashMap;
public class DefaultGraphSplittingBackend implements GraphSplittingBackend {
private MutableDirectedGraph graph;
@ -48,7 +48,7 @@ public class DefaultGraphSplittingBackend implements GraphSplittingBackend {
@Override
public int[] split(int[] domain, int[] nodes) {
int[] copies = new int[nodes.length];
IntIntMap map = new IntIntOpenHashMap();
IntIntMap map = new IntIntHashMap();
for (int i = 0; i < nodes.length; ++i) {
copies[i] = index++;
map.put(nodes[i], copies[i] + 1);

View File

@ -15,7 +15,7 @@
*/
package org.teavm.common;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.ArrayList;
import java.util.Arrays;
@ -47,14 +47,14 @@ public class GraphBuilder {
sz = Math.max(sz, Math.max(from, to) + 1);
builtGraph = null;
if (addedEdges.size() == from) {
addedEdges.add(IntOpenHashSet.from(to));
addedEdges.add(IntHashSet.from(to));
} else if (addedEdges.size() <= from) {
addedEdges.addAll(Collections.nCopies(from - addedEdges.size(), null));
addedEdges.add(IntOpenHashSet.from(to));
addedEdges.add(IntHashSet.from(to));
} else {
IntSet set = addedEdges.get(from);
if (set == null) {
addedEdges.set(from, IntOpenHashSet.from(to));
addedEdges.set(from, IntHashSet.from(to));
} else {
set.add(to);
}
@ -68,14 +68,14 @@ public class GraphBuilder {
if (from >= addedEdges.size() || to >= addedEdges.size()) {
return;
}
addedEdges.get(from).removeAllOccurrences(to);
addedEdges.get(from).removeAll(to);
}
public Graph build() {
if (builtGraph == null) {
IntSet[] incomingEdges = new IntSet[sz];
for (int i = 0; i < sz; ++i) {
incomingEdges[i] = new IntOpenHashSet();
incomingEdges[i] = new IntHashSet();
}
int[][] outgoingEdgeList = new int[sz][];
for (int i = 0; i < addedEdges.size(); ++i) {

View File

@ -15,7 +15,7 @@
*/
package org.teavm.common;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.ArrayList;
@ -157,7 +157,7 @@ public class GraphIndexer {
List<WeightedNode> succList = new ArrayList<>(successors.length);
IntegerArray orderedSuccessors = new IntegerArray(successors.length);
if (terminalNodes.size() > 0) {
IntSet loopNodes = IntOpenHashSet.from(findNaturalLoop(node, terminalNodes.getAll()));
IntSet loopNodes = IntHashSet.from(findNaturalLoop(node, terminalNodes.getAll()));
for (int succ : successors) {
if (loopNodes.contains(succ)) {
succList.add(new WeightedNode(succ, priorities[succ], weights[succ]));
@ -168,7 +168,7 @@ public class GraphIndexer {
orderedSuccessors.add(wnode.index);
}
IntSet outerSuccessors = new IntOpenHashSet(successors.length);
IntSet outerSuccessors = new IntHashSet(successors.length);
succList.clear();
for (IntCursor loopNode : loopNodes) {
for (int succ : graph.outgoingEdges(loopNode.value)) {
@ -205,7 +205,7 @@ public class GraphIndexer {
}
private int[] findNaturalLoop(int head, int[] terminals) {
IntSet loop = new IntOpenHashSet();
IntSet loop = new IntHashSet();
loop.add(head);
IntegerStack stack = new IntegerStack(1);
for (int pred : terminals) {

View File

@ -15,7 +15,7 @@
*/
package org.teavm.common;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.Arrays;
@ -38,10 +38,10 @@ class IrreducibleGraphConverter {
void convertToReducible(Graph cfg, int[] weight, GraphSplittingBackend backend) {
this.backend = backend;
nodeCopies = new IntOpenHashSet[cfg.size()];
nodeCopies = new IntHashSet[cfg.size()];
nodeOriginals = new IntegerArray(cfg.size());
for (int i = 0; i < cfg.size(); ++i) {
nodeCopies[i] = new IntOpenHashSet();
nodeCopies[i] = new IntHashSet();
nodeOriginals.add(i);
}
@ -132,7 +132,7 @@ class IrreducibleGraphConverter {
}
// Find header of this domain
IntSet domainNodes = new IntOpenHashSet(scc.length);
IntSet domainNodes = new IntHashSet(scc.length);
for (int i = 0; i < scc.length; ++i) {
int node = scc[i];
if (domains[i] == domain) {
@ -258,7 +258,7 @@ class IrreducibleGraphConverter {
}
private int[] withoutCopies(int[] nodesWithCopies) {
IntSet visited = new IntOpenHashSet();
IntSet visited = new IntHashSet();
int[] nodes = new int[nodesWithCopies.length];
int sz = 0;
for (int node : nodesWithCopies) {
@ -276,7 +276,7 @@ class IrreducibleGraphConverter {
int copy = copies[i];
IntSet knownCopies = nodeCopies[original];
if (knownCopies == null) {
knownCopies = new IntOpenHashSet();
knownCopies = new IntHashSet();
nodeCopies[original] = knownCopies;
}

View File

@ -15,7 +15,7 @@
*/
package org.teavm.common;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.ArrayList;
@ -56,8 +56,8 @@ public class MutableDirectedGraph implements Graph {
public void addEdge(int from, int to) {
int max = Math.max(from, to);
while (max >= successors.size()) {
successors.add(new IntOpenHashSet(1));
predecessors.add(new IntOpenHashSet(1));
successors.add(new IntHashSet(1));
predecessors.add(new IntHashSet(1));
}
successors.get(from).add(to);
predecessors.get(to).add(from);
@ -67,16 +67,16 @@ public class MutableDirectedGraph implements Graph {
if (from >= successors.size() || to >= successors.size()) {
return;
}
successors.get(from).removeAllOccurrences(to);
predecessors.get(to).removeAllOccurrences(from);
successors.get(from).removeAll(to);
predecessors.get(to).removeAll(from);
}
public void detachNode(int node) {
for (IntCursor succ : successors.get(node)) {
predecessors.get(succ.value).removeAllOccurrences(node);
predecessors.get(succ.value).removeAll(node);
}
for (IntCursor pred : predecessors.get(node)) {
successors.get(pred.value).removeAllOccurrences(node);
successors.get(pred.value).removeAll(node);
}
predecessors.get(node).clear();
successors.get(node).clear();

View File

@ -15,26 +15,38 @@
*/
package org.teavm.dependency;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.ObjectIntHashMap;
import com.carrotsearch.hppc.ObjectIntMap;
import com.carrotsearch.hppc.ObjectIntOpenHashMap;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.Arrays;
import java.util.List;
import org.teavm.common.*;
import org.teavm.model.*;
import org.teavm.model.instructions.*;
import org.teavm.common.DisjointSet;
import org.teavm.common.Graph;
import org.teavm.common.GraphBuilder;
import org.teavm.common.IntegerStack;
import org.teavm.model.BasicBlockReader;
import org.teavm.model.FieldReference;
import org.teavm.model.IncomingReader;
import org.teavm.model.MethodReference;
import org.teavm.model.PhiReader;
import org.teavm.model.ProgramReader;
import org.teavm.model.ValueType;
import org.teavm.model.VariableReader;
import org.teavm.model.instructions.AbstractInstructionReader;
import org.teavm.model.instructions.ArrayElementType;
import org.teavm.model.instructions.InvocationType;
public class DataFlowGraphBuilder extends AbstractInstructionReader {
private int lastIndex;
private GraphBuilder builder = new GraphBuilder();
private ObjectIntMap<FieldReference> fieldNodes = new ObjectIntOpenHashMap<>();
private ObjectIntMap<FieldReference> fieldNodes = new ObjectIntHashMap<>();
private int returnIndex = -1;
private int exceptionIndex;
private DisjointSet classes = new DisjointSet();
private int paramCount;
private IntSet escaping = new IntOpenHashSet();
private IntSet escaping = new IntHashSet();
private void join(int a, int b) {
if (a < paramCount || b < paramCount) {

View File

@ -15,7 +15,7 @@
*/
package org.teavm.dependency;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.ArrayDeque;
@ -266,7 +266,7 @@ public class DependencyAnalyzer implements DependencyInfo {
} else {
if (consumer.pendingTypes == null) {
pendingTransitions.add(consumer);
consumer.pendingTypes = new IntOpenHashSet();
consumer.pendingTypes = new IntHashSet();
}
consumer.pendingTypes.add(type.index);
}
@ -288,7 +288,7 @@ public class DependencyAnalyzer implements DependencyInfo {
} else {
if (consumer.pendingTypes == null) {
pendingTransitions.add(consumer);
consumer.pendingTypes = new IntOpenHashSet();
consumer.pendingTypes = new IntHashSet();
}
for (DependencyType type : types) {
consumer.pendingTypes.add(type.index);

View File

@ -15,14 +15,14 @@
*/
package org.teavm.dependency;
import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import com.carrotsearch.hppc.IntIntOpenHashMap;
import org.teavm.model.ClassReaderSource;
class SuperClassFilter implements DependencyTypeFilter {
private ClassReaderSource classSource;
private String superType;
private IntIntMap cache = new IntIntOpenHashMap();
private IntIntMap cache = new IntIntHashMap();
SuperClassFilter(ClassReaderSource classSource, String superType) {
this.classSource = classSource;

View File

@ -15,11 +15,11 @@
*/
package org.teavm.model.analysis;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import com.carrotsearch.hppc.IntStack;
import com.carrotsearch.hppc.ObjectIntHashMap;
import com.carrotsearch.hppc.ObjectIntMap;
import com.carrotsearch.hppc.ObjectIntOpenHashMap;
import com.carrotsearch.hppc.cursors.IntCursor;
import java.util.ArrayList;
import java.util.Arrays;
@ -78,8 +78,8 @@ public class ClassInference {
private int[] propagationPath;
private int[] nodeMapping;
private IntOpenHashSet[] types;
private ObjectIntMap<String> typeMap = new ObjectIntOpenHashMap<>();
private IntHashSet[] types;
private ObjectIntMap<String> typeMap = new ObjectIntHashMap<>();
private List<String> typeList = new ArrayList<>();
private boolean changed = true;
@ -108,7 +108,7 @@ public class ClassInference {
8. Repeat 7 until it changes anything (i.e. calculate fixed point).
*/
types = new IntOpenHashSet[program.variableCount() << 3];
types = new IntHashSet[program.variableCount() << 3];
nodeChanged = new boolean[types.length];
formerNodeChanged = new boolean[nodeChanged.length];
nodeMapping = new int[types.length];
@ -164,7 +164,7 @@ public class ClassInference {
}
public String[] classesOf(int variableIndex) {
IntOpenHashSet typeSet = types[nodeMapping[packNodeAndDegree(variableIndex, 0)]];
IntHashSet typeSet = types[nodeMapping[packNodeAndDegree(variableIndex, 0)]];
if (typeSet == null) {
return new String[0];
}
@ -228,7 +228,7 @@ public class ClassInference {
int variable = extractNode(entry);
// Actually, successor nodes in resulting graph
IntSet nextEntries = new IntOpenHashSet();
IntSet nextEntries = new IntHashSet();
// Start: calculating successor nodes in resulting DAG along different paths
//
@ -282,7 +282,7 @@ public class ClassInference {
}
boolean[] nodeChangedBackup = nodeChanged.clone();
IntOpenHashSet[] typesBackup = types.clone();
IntHashSet[] typesBackup = types.clone();
Arrays.fill(nodeChanged, false);
Arrays.fill(types, null);
@ -389,7 +389,7 @@ public class ClassInference {
continue;
}
IntOpenHashSet nodeTypes = getNodeTypes(node);
IntHashSet nodeTypes = getNodeTypes(node);
for (int predecessor : graph.incomingEdges(node)) {
if (formerNodeChanged[predecessor] || nodeChanged[predecessor]) {
if (nodeTypes.addAll(types[predecessor]) > 0) {
@ -411,7 +411,7 @@ public class ClassInference {
}
int toNode = nodeMapping[packNodeAndDegree(cast.toVariable, 0)];
IntOpenHashSet targetTypes = getNodeTypes(toNode);
IntHashSet targetTypes = getNodeTypes(toNode);
for (IntCursor cursor : types[fromNode]) {
if (targetTypes.contains(cursor.value)) {
@ -520,10 +520,10 @@ public class ClassInference {
}
}
IntOpenHashSet getNodeTypes(int node) {
IntOpenHashSet result = types[node];
IntHashSet getNodeTypes(int node) {
IntHashSet result = types[node];
if (result == null) {
result = new IntOpenHashSet();
result = new IntHashSet();
types[node] = result;
}
return result;
@ -707,7 +707,7 @@ public class ClassInference {
static class VirtualCallSite {
int instance;
IntSet knownClasses = new IntOpenHashSet();
IntSet knownClasses = new IntHashSet();
Set<MethodReference> resolvedMethods = new HashSet<>();
MethodReference method;
int[] arguments;

View File

@ -17,7 +17,7 @@ package org.teavm.model.analysis;
import com.carrotsearch.hppc.IntArrayDeque;
import com.carrotsearch.hppc.IntDeque;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.ArrayDeque;
import java.util.ArrayList;
@ -147,7 +147,7 @@ public class EscapeAnalysis {
}
// If incoming variables of phi functions live after phi, mark them as escaping
IntSet sharedIncomingVars = new IntOpenHashSet();
IntSet sharedIncomingVars = new IntHashSet();
for (Phi phi : block.getPhis()) {
if (escapes(phi.getReceiver().getIndex())) {
queue.addLast(definitionClasses[phi.getReceiver().getIndex()]);
@ -163,7 +163,7 @@ public class EscapeAnalysis {
}
Graph graph = graphBuilder.build();
IntSet visited = new IntOpenHashSet();
IntSet visited = new IntHashSet();
while (!queue.isEmpty()) {
int var = queue.removeFirst();
if (visited.add(var)) {

View File

@ -17,14 +17,13 @@ package org.teavm.model.analysis;
import com.carrotsearch.hppc.IntArrayDeque;
import com.carrotsearch.hppc.IntDeque;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import com.carrotsearch.hppc.IntIntOpenHashMap;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import org.teavm.common.DominatorTree;
import org.teavm.common.Graph;
import org.teavm.common.GraphBuilder;
import org.teavm.common.GraphUtils;
@ -189,14 +188,8 @@ class NullnessInformationBuilder {
class NullExtensionVisitor extends AbstractInstructionVisitor implements DominatorWalkerCallback<State> {
State currentState;
BasicBlock currentBlock;
IntIntMap nullSuccessors = new IntIntOpenHashMap();
IntIntMap notNullSuccessors = new IntIntOpenHashMap();
private DominatorTree dom;
@Override
public void setDomTree(DominatorTree domTree) {
dom = domTree;
}
IntIntMap nullSuccessors = new IntIntHashMap();
IntIntMap notNullSuccessors = new IntIntHashMap();
@Override
public State visit(BasicBlock block) {
@ -426,7 +419,7 @@ class NullnessInformationBuilder {
}
static class State {
IntSet newlyNonNull = new IntOpenHashSet();
IntSet newlyNull = new IntOpenHashSet();
IntSet newlyNonNull = new IntHashSet();
IntSet newlyNull = new IntHashSet();
}
}

View File

@ -16,8 +16,8 @@
package org.teavm.model.lowlevel;
import com.carrotsearch.hppc.IntArrayList;
import com.carrotsearch.hppc.ObjectIntHashMap;
import com.carrotsearch.hppc.ObjectIntMap;
import com.carrotsearch.hppc.ObjectIntOpenHashMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
@ -305,7 +305,7 @@ public class GCShadowStackContributor {
}
private List<Instruction> sortInstructions(Collection<Instruction> instructions, BasicBlock block) {
ObjectIntMap<Instruction> indexes = new ObjectIntOpenHashMap<>();
ObjectIntMap<Instruction> indexes = new ObjectIntHashMap<>();
int index = 0;
for (Instruction instruction : block) {
indexes.put(instruction, index++);
@ -349,7 +349,7 @@ public class GCShadowStackContributor {
}
private ObjectIntMap<Instruction> getInstructionIndexes(BasicBlock block) {
ObjectIntMap<Instruction> indexes = new ObjectIntOpenHashMap<>();
ObjectIntMap<Instruction> indexes = new ObjectIntHashMap<>();
for (Instruction instruction : block) {
indexes.put(instruction, indexes.size());
}

View File

@ -15,9 +15,9 @@
*/
package org.teavm.model.optimization;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import com.carrotsearch.hppc.IntIntOpenHashMap;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.ArrayList;
import java.util.Arrays;
@ -170,12 +170,12 @@ class LoopInversionImpl {
private class LoopWithExits {
final int head;
final LoopWithExits parent;
final IntSet nodes = new IntOpenHashSet();
final IntSet nodesAndCopies = new IntOpenHashSet();
final IntSet exits = new IntOpenHashSet();
final IntSet nodes = new IntHashSet();
final IntSet nodesAndCopies = new IntHashSet();
final IntSet exits = new IntHashSet();
int bodyStart;
int headCopy;
final IntIntMap copiedNodes = new IntIntOpenHashMap();
final IntIntMap copiedNodes = new IntIntHashMap();
boolean shouldSkip;
LoopWithExits(int head, LoopWithExits parent) {
@ -260,7 +260,7 @@ class LoopInversionImpl {
}
private boolean findCondition() {
IntSet tailNodes = new IntOpenHashSet(program.basicBlockCount());
IntSet tailNodes = new IntHashSet(program.basicBlockCount());
for (int tailCandidate : cfg.incomingEdges(head)) {
if (nodes.contains(tailCandidate)) {
tailNodes.add(tailCandidate);
@ -298,7 +298,7 @@ class LoopInversionImpl {
}
private IntSet nodesToCopy() {
IntSet result = new IntOpenHashSet();
IntSet result = new IntHashSet();
for (int node : nodes.toArray()) {
if (node == head || (node != bodyStart && !dom.dominates(bodyStart, node))) {
result.add(node);

View File

@ -15,7 +15,7 @@
*/
package org.teavm.model.util;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.ArrayDeque;
import java.util.BitSet;
@ -59,7 +59,7 @@ public class LivenessAnalyzer {
for (Instruction insn : block) {
insn.acceptVisitor(usageExtractor);
IntSet usedVars = new IntOpenHashSet();
IntSet usedVars = new IntHashSet();
for (Variable var : usageExtractor.getUsedVariables()) {
Task task = new Task();
task.block = i;

View File

@ -17,9 +17,9 @@ package org.teavm.model.util;
import com.carrotsearch.hppc.IntArrayDeque;
import com.carrotsearch.hppc.IntDeque;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntObjectHashMap;
import com.carrotsearch.hppc.IntObjectMap;
import com.carrotsearch.hppc.IntObjectOpenHashMap;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.ArrayDeque;
import java.util.ArrayList;
@ -91,7 +91,7 @@ public class PhiUpdater {
private Phi[][] phiMap;
private int[][] phiIndexMap;
private List<List<Phi>> synthesizedPhisByBlock = new ArrayList<>();
private IntObjectMap<Phi> phisByReceiver = new IntObjectOpenHashMap<>();
private IntObjectMap<Phi> phisByReceiver = new IntObjectHashMap<>();
private BitSet usedPhis = new BitSet();
private Variable[] originalExceptionVariables;
private boolean[] usedDefinitions;
@ -248,7 +248,7 @@ public class PhiUpdater {
stack.push(next);
}
IntSet exceptionHandlingSuccessors = new IntOpenHashSet();
IntSet exceptionHandlingSuccessors = new IntHashSet();
for (TryCatchBlock tryCatch : currentBlock.getTryCatchBlocks()) {
exceptionHandlingSuccessors.add(tryCatch.getHandler().getIndex());
}
@ -281,7 +281,7 @@ public class PhiUpdater {
}
}
IntSet visited = new IntOpenHashSet();
IntSet visited = new IntHashSet();
while (!worklist.isEmpty()) {
int varIndex = worklist.removeFirst();
if (!visited.add(varIndex)) {

View File

@ -15,8 +15,8 @@
*/
package org.teavm.model.util;
import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import com.carrotsearch.hppc.IntIntOpenHashMap;
import org.teavm.common.GraphSplittingBackend;
import org.teavm.model.BasicBlock;
import org.teavm.model.Program;
@ -31,7 +31,7 @@ public class ProgramNodeSplittingBackend implements GraphSplittingBackend {
@Override
public int[] split(int[] domain, int[] nodes) {
int[] copies = new int[nodes.length];
IntIntMap map = new IntIntOpenHashMap();
IntIntMap map = new IntIntHashMap();
for (int i = 0; i < nodes.length; ++i) {
int node = nodes[i];
BasicBlock block = program.basicBlockAt(node);

View File

@ -15,8 +15,8 @@
*/
package org.teavm.parsing;
import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntIntMap;
import com.carrotsearch.hppc.IntIntOpenHashMap;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
@ -157,7 +157,7 @@ public class Parser {
Step[] stack = new Step[program.basicBlockCount()];
int top = 0;
IntIntOpenHashMap entryVarMap = new IntIntOpenHashMap();
IntIntHashMap entryVarMap = new IntIntHashMap();
for (int i = 0; i < argumentMapping.length; ++i) {
Variable arg = argumentMapping[i];
if (arg != null) {
@ -169,7 +169,7 @@ public class Parser {
while (top > 0) {
Step step = stack[--top];
int node = step.node;
IntIntMap varMap = new IntIntOpenHashMap(step.varMap);
IntIntMap varMap = new IntIntHashMap(step.varMap);
BasicBlock block = program.basicBlockAt(node);
for (Phi phi : block.getPhis()) {
@ -180,7 +180,7 @@ public class Parser {
}
}
result[node] = new IntIntOpenHashMap(varMap);
result[node] = new IntIntHashMap(varMap);
for (Instruction insn : block) {
insn.acceptVisitor(defExtractor);
@ -193,7 +193,7 @@ public class Parser {
}
for (int successor : dom.outgoingEdges(node)) {
stack[top++] = new Step(successor, new IntIntOpenHashMap(varMap));
stack[top++] = new Step(successor, new IntIntHashMap(varMap));
}
}

View File

@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import java.util.Arrays;
import java.util.Comparator;
@ -210,7 +210,7 @@ public class GraphTest {
Graph graph = backend.getGraph();
for (int node = 0; node < graph.size(); ++node) {
int nodeProto = backend.prototype(node);
IntSet succProto = new IntOpenHashSet();
IntSet succProto = new IntHashSet();
for (int succ : graph.outgoingEdges(node)) {
succProto.add(backend.prototype(succ));
}

View File

@ -17,8 +17,8 @@ package org.teavm.model.analysis.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import com.carrotsearch.hppc.ObjectByteHashMap;
import com.carrotsearch.hppc.ObjectByteMap;
import com.carrotsearch.hppc.ObjectByteOpenHashMap;
import com.carrotsearch.hppc.cursors.ObjectCursor;
import java.io.BufferedReader;
import java.io.IOException;
@ -123,7 +123,7 @@ public class NullnessAnalysisTest {
ClassLoader classLoader = NullnessAnalysisTest.class.getClassLoader();
try (InputStream input = classLoader.getResourceAsStream(name);
BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"))) {
ObjectByteMap<String> result = new ObjectByteOpenHashMap<>();
ObjectByteMap<String> result = new ObjectByteHashMap<>();
while (true) {
String line = reader.readLine();

View File

@ -15,7 +15,7 @@
*/
package org.teavm.dependency;
import com.carrotsearch.hppc.IntOpenHashSet;
import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
@ -275,7 +275,7 @@ public class DependencyTest {
int value = aliases[insn.getValue().getIndex()];
IntSet items = arrayContent[array];
if (items == null) {
items = new IntOpenHashSet();
items = new IntHashSet();
arrayContent[array] = items;
}
items.add(value);