mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
SleighLanguage: Use more performant ConcurrentHashMap
This commit is contained in:
parent
03cc1b8468
commit
789cbd9241
1 changed files with 11 additions and 12 deletions
|
@ -20,6 +20,7 @@ import static ghidra.pcode.utils.SlaFormat.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -88,7 +89,7 @@ public class SleighLanguage implements Language {
|
||||||
/**
|
/**
|
||||||
* Cached instruction prototypes
|
* Cached instruction prototypes
|
||||||
*/
|
*/
|
||||||
private LinkedHashMap<Integer, SleighInstructionPrototype> instructProtoMap;
|
private ConcurrentHashMap<Integer, SleighInstructionPrototype> instructProtoMap;
|
||||||
private DecisionNode root = null;
|
private DecisionNode root = null;
|
||||||
/**
|
/**
|
||||||
* table of AddressSpaces
|
* table of AddressSpaces
|
||||||
|
@ -148,7 +149,7 @@ public class SleighLanguage implements Language {
|
||||||
buildVolatileSymbolAddresses();
|
buildVolatileSymbolAddresses();
|
||||||
xrefRegisters();
|
xrefRegisters();
|
||||||
|
|
||||||
instructProtoMap = new LinkedHashMap<>();
|
instructProtoMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
initParallelHelper();
|
initParallelHelper();
|
||||||
}
|
}
|
||||||
|
@ -378,7 +379,6 @@ public class SleighLanguage implements Language {
|
||||||
newProto.cacheInfo(buf, context, true);
|
newProto.cacheInfo(buf, context, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (instructProtoMap) {
|
|
||||||
res = instructProtoMap.get(hashcode);
|
res = instructProtoMap.get(hashcode);
|
||||||
if (res == null) { // We have a prototype we have never seen
|
if (res == null) { // We have a prototype we have never seen
|
||||||
// before, build it fully
|
// before, build it fully
|
||||||
|
@ -389,7 +389,6 @@ public class SleighLanguage implements Language {
|
||||||
throw new NestedDelaySlotException();
|
throw new NestedDelaySlotException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
throw new InsufficientBytesException(e.getMessage());
|
throw new InsufficientBytesException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue