本文整理汇总了Java中com.sun.squawk.util.IntHashtable类的典型用法代码示例。如果您正苦于以下问题:Java IntHashtable类的具体用法?Java IntHashtable怎么用?Java IntHashtable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntHashtable类属于com.sun.squawk.util包,在下文中一共展示了IntHashtable类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyedGlobalsMutex
import com.sun.squawk.util.IntHashtable; //导入依赖的package包/类
public static Object getKeyedGlobalsMutex() {
if (keyedGlobalsMutex == null) {
keyedGlobalsMutex = new Object();
keyeGlobals = new IntHashtable();
}
return keyedGlobalsMutex;
}
示例2: testInstallSectors
import com.sun.squawk.util.IntHashtable; //导入依赖的package包/类
public void testInstallSectors() {
// Setup some sectors
final int numSectors = 10;
final int size = 65536;
SimulatedNorFlashSectorAllocator.getSingleton().setupSectors(numSectors, size, INorFlashSector.RMS_PURPOSED, true);
INorFlashSector[] sectors = SimulatedNorFlashSectorAllocator.getSingleton().getInitialSectors(INorFlashSector.RMS_PURPOSED);
assertEquals(numSectors, sectors.length);
// Now uninstall them and make sure they are gone
SimulatedNorFlashSectorAllocator.getSingleton().uninstallSectors();
sectors = SimulatedNorFlashSectorAllocator.getSingleton().getInitialSectors(INorFlashSector.RMS_PURPOSED);;
assertEquals(0, sectors.length);
// Now install them and make sure they are there
SimulatedNorFlashSectorAllocator.getSingleton().installSectors(0, 0, INorFlashSector.RMS_PURPOSED);
sectors = SimulatedNorFlashSectorAllocator.getSingleton().getInitialSectors(INorFlashSector.RMS_PURPOSED);;
assertEquals(numSectors, sectors.length);
IntHashtable addresses = new IntHashtable();
Object marker = new Object();
int address = 0;
for (int i=0; i < numSectors; i++) {
addresses.put(address, marker);
address += size;
}
for (int i=0; i < numSectors; i++) {
SimulatedNorFlashSector sector = (SimulatedNorFlashSector) sectors[i];
assertEquals(size, sector.getSize());
addresses.remove(sector.getStartAddress().toUWord().toInt());
}
assertEquals(0, addresses.size());
}
示例3: loadStackMap
import com.sun.squawk.util.IntHashtable; //导入依赖的package包/类
/**
* Loads a "StackMap" attribute and builds a table of <code>Target</code>
* instances representing the entries in the stack map.
*
* @param codeParser the "Code" attribute parser
* @param cfr the class file reader used to read the attribute
* @param constantPool the constant pool of the enclosing class
* @param codeLength the length of the bytecode array for the enclosing method
* @return a table of <code>Target</code> instances indexed by address
* representing the entries in the stack map
*/
public static IntHashtable loadStackMap(CodeParser codeParser, ClassFileReader cfr, ConstantPool constantPool, int codeLength) {
/*
* Read number_of_entries
*/
int nmaps = cfr.readUnsignedShort("map-nmaps");
if (nmaps == 0) {
return null;
} else {
IntHashtable table = new IntHashtable(nmaps + (nmaps/4) + 1);
int lastAddress = -1;
final boolean trace = Translator.TRACING_ENABLED && Tracer.isTracing("maps", codeParser.getMethod().toString());
for (int i = 0 ; i < nmaps ; i++) {
int address = cfr.readUnsignedShort("map-address");
if (address <= lastAddress) {
throw cfr.formatError("stack map ip addresses not in order");
}
lastAddress = address;
/*
* Load the list of types in the local variables array
*/
Klass[] locals = loadStackMapList(codeParser, cfr, constantPool, codeLength);
if (locals.length > codeParser.getMaxLocals()) {
throw cfr.formatError("stack map locals greater than max_locals");
}
/*
* Load the list of types on the operand stack
*/
Klass[] stack = loadStackMapList(codeParser, cfr, constantPool, codeLength);
if (stack.length > codeParser.getMaxStack()) {
throw cfr.formatError("stack map stack greater than max_stack");
}
Target target = new Target(address, stack, locals);
table.put(address, target);
/*
* Trace.
*/
if (trace) {
Tracer.traceln("Stackmap @"+ target);
}
}
return table;
}
}
示例4: Symbols
import com.sun.squawk.util.IntHashtable; //导入依赖的package包/类
/**
* Constructor.
*/
public Symbols() {
symbols = new LongHashtable();
nativeMethods = new IntHashtable();
}
示例5: Loader
import com.sun.squawk.util.IntHashtable; //导入依赖的package包/类
/**
* Creates a loader for parsing a file in the format expected by {@link Properties#load(InputStream)}
* and extracting any symbolic information for one or more methods.
*
* @param entries the table into which the extracted information should be added
*/
Loader(LongHashtable entries, IntHashtable nativeMethods) {
this.entries = entries;
this.nativeMethods = nativeMethods;
}