本文整理汇总了Java中com.sun.max.unsafe.Address类的典型用法代码示例。如果您正苦于以下问题:Java Address类的具体用法?Java Address怎么用?Java Address使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Address类属于com.sun.max.unsafe包,在下文中一共展示了Address类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCodeFocus
import com.sun.max.unsafe.Address; //导入依赖的package包/类
/**
* Global code selection has been set; return true iff the view contains selection.
* Update even when the selection is set to the same value, because we want
* that to force a scroll to make the selection visible.
*/
public boolean updateCodeFocus(MaxCodeLocation codeLocation) {
final int oldSelectedRow = getSelectedRow();
if (codeLocation != null && codeLocation.hasAddress()) {
final Address machineCodeInstructionAddress = focus().codeLocation().address();
if (machineCode().contains(machineCodeInstructionAddress)) {
final MachineCodeTableModel model = (MachineCodeTableModel) getModel();
final int row = model.findRow(machineCodeInstructionAddress);
if (row >= 0) {
if (row != oldSelectedRow) {
updateSelection(row);
Trace.line(TRACE_VALUE, tracePrefix() + "changeSelection " + row);
}
scrollToRows(row, row);
Trace.line(TRACE_VALUE, tracePrefix() + " scroll to row " + row);
return true;
}
}
}
// View doesn't contain the focus; clear any old selection
if (oldSelectedRow >= 0) {
clearSelection();
}
return false;
}
示例2: getColumnClass
import com.sun.max.unsafe.Address; //导入依赖的package包/类
@Override
public Class< ? > getColumnClass(int col) {
switch (MachineCodeColumnKind.values()[col]) {
case TAG:
return Object.class;
case NUMBER:
return Integer.class;
case ADDRESS:
return Address.class;
case POSITION:
return Integer.class;
case LABEL:
case INSTRUCTION:
case OPERANDS:
case SOURCE_LINE:
return String.class;
case BYTES:
return byte[].class;
default:
throw new RuntimeException("Column out of range: " + col);
}
}
示例3: readBytes
import com.sun.max.unsafe.Address; //导入依赖的package包/类
public static synchronized int readBytes(Address src, ByteBuffer dst, int dstOffset, int length) {
int lengthLeft = length;
int localOffset = dstOffset;
long localAddress = src.toLong();
while (lengthLeft > 0) {
final int toDo = lengthLeft > maxByteBufferSize ? maxByteBufferSize : lengthLeft;
final int r = readBytes0(localAddress, dst, localOffset, toDo);
if (r != toDo) {
return -1;
}
lengthLeft -= toDo;
localOffset += toDo;
localAddress += toDo;
}
return length;
}
示例4: writeBytes
import com.sun.max.unsafe.Address; //导入依赖的package包/类
public static synchronized int writeBytes(ByteBuffer buffer, int offset, int length, Address address) {
int lengthLeft = length;
int localOffset = offset;
long localAddress = address.toLong();
while (lengthLeft > 0) {
final int toDo = lengthLeft > maxByteBufferSize ? maxByteBufferSize : lengthLeft;
final int r = writeBytes0(localAddress, buffer, localOffset, toDo);
if (r != toDo) {
return -1;
}
lengthLeft -= toDo;
localOffset += toDo;
localAddress += toDo;
}
return length;
}
示例5: unlockedFromHashcode
import com.sun.max.unsafe.Address; //导入依赖的package包/类
/**
* (Image build support) Returns a new, unlocked {@code ThinLockword64} with the given
* hashcode installed into the hashcode field.
*
* @param hashcode the hashcode to install
* @return the lock word
*/
@INLINE
public static final ThinLockword64 unlockedFromHashcode(int hashcode) {
if (Platform.target().arch.is64bit()) {
return ThinLockword64.from(HashableLockword64.from(Address.zero()).setHashcode(hashcode));
} else {
return ThinLockword64.from(HashableLockword64.from(Address.zero()));
}
}
示例6: MachineCodeTableColumnModel
import com.sun.max.unsafe.Address; //导入依赖的package包/类
private MachineCodeTableColumnModel(MachineCodeViewPreferences viewPreferences) {
super(inspection(), MachineCodeColumnKind.values().length, viewPreferences);
final Address startAddress = tableModel.machineCode.getMachineCodeInfo().length() == 0 ? Address.zero() : tableModel.rowToInstruction(0).address;
addColumnIfSupported(MachineCodeColumnKind.TAG, new TagRenderer(inspection), null);
addColumnIfSupported(MachineCodeColumnKind.NUMBER, new NumberRenderer(), null);
addColumnIfSupported(MachineCodeColumnKind.ADDRESS, new AddressRenderer(startAddress), null);
addColumnIfSupported(MachineCodeColumnKind.POSITION, new PositionRenderer(startAddress), null);
addColumnIfSupported(MachineCodeColumnKind.LABEL, new LabelRenderer(startAddress), null);
addColumnIfSupported(MachineCodeColumnKind.INSTRUCTION, new InstructionRenderer(inspection), null);
addColumnIfSupported(MachineCodeColumnKind.OPERANDS, operandsRenderer, null);
addColumnIfSupported(MachineCodeColumnKind.SOURCE_LINE, sourceLineRenderer, null);
addColumnIfSupported(MachineCodeColumnKind.BYTES, new BytesRenderer(inspection), null);
}
示例7: findRow
import com.sun.max.unsafe.Address; //导入依赖的package包/类
/**
* @param address a code address in the VM.
* @return the row in this block of code containing an instruction starting at the address, -1 if none.
*/
public int findRow(Address address) {
final MaxMachineCodeInfo machineCodeInfo = machineCode.getMachineCodeInfo();
for (int row = 0; row < machineCodeInfo.length(); row++) {
final TargetCodeInstruction machineCodeInstruction = machineCodeInfo.instruction(row);
if (machineCodeInstruction.address.equals(address)) {
return row;
}
}
return -1;
}
示例8: getTableCellRendererComponent
import com.sun.max.unsafe.Address; //导入依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value == null) {
return gui().getUnavailableDataTableCellRenderer();
}
final Address address = (Address) value;
setToolTipPrefix(tableModel.getRowDescription(row) + " location<br>address= ");
setValue(address.minus(entryAddress).asSize().toInt());
setBackgroundForRow(this, row);
setForeground(cellForegroundColor(row, column));
setBorderForRow(this, row);
return this;
}
示例9: render
import com.sun.max.unsafe.Address; //导入依赖的package包/类
public WordValueLabel render(Inspection inspection, String literalLoadText, final Address literalAddress) {
final WordValueLabel wordValueLabel = new WordValueLabel(inspection, WordValueLabel.ValueMode.LITERAL_REFERENCE, null, true) {
@Override
public Value fetchValue() {
return vm().memoryIO().readWordValue(literalAddress);
}
};
wordValueLabel.setTextPrefix(literalLoadText.substring(0, literalLoadText.indexOf("[")).trim());
wordValueLabel.setToolTipSuffix(" from RIP " + literalLoadText.substring(literalLoadText.indexOf("["), literalLoadText.length()));
wordValueLabel.setWordDataFont(inspection.preference().style().defaultBoldFont());
wordValueLabel.updateText();
return wordValueLabel;
}
示例10: checkConfiguration
import com.sun.max.unsafe.Address; //导入依赖的package包/类
/**
* Checks the validity of MaxSim configuration.
*/
public static void checkConfiguration() {
if (!MaxSimInterfaceHelpers.isMaxSimEnabled()) {
return;
}
FatalError.check(Address.POINTER_TAG_MASK_SIZE <= Address.POINTER_TAG_MASK_MAX,
"POINTER_TAG_MASK_SIZE is greater POINTER_TAG_MASK_MAX.");
}
示例11: readBytes
import com.sun.max.unsafe.Address; //导入依赖的package包/类
@Override
public int readBytes(long src, byte[] dst, int dstOffset, int length) {
//Resolve the address
try {
Address l1pte = pageTableAccess.getAddressForPte(pageTableAccess.getPteForAddress(Address.fromLong(src)));
long physicalAddr = l1pte.toLong() + (src & (X64VM.L0_ENTRIES-1));
return xenReader.getPagesSection().readBytes(physicalAddr, dst, dstOffset, length);
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
示例12: setTrapNumber
import com.sun.max.unsafe.Address; //导入依赖的package包/类
@Override
public void setTrapNumber(Pointer trapFrame, int trapNumber) {
trapFrame.writeWord(TRAP_NUMBER_OFFSET, Address.fromInt(trapNumber));
}
示例13: AddressRenderer
import com.sun.max.unsafe.Address; //导入依赖的package包/类
AddressRenderer(Address entryAddress) {
super(inspection, 0, entryAddress);
this.entryAddress = entryAddress;
}
示例14: PositionRenderer
import com.sun.max.unsafe.Address; //导入依赖的package包/类
PositionRenderer(Address entryAddress) {
super(inspection, 0, entryAddress);
this.position = 0;
}
示例15: LabelRenderer
import com.sun.max.unsafe.Address; //导入依赖的package包/类
LabelRenderer(Address entryAddress) {
super(inspection, entryAddress);
setOpaque(true);
}