x86jumptable.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 52 行

JAVA
52
字号
/*
 * $Id: X86JumpTable.java,v 1.4 2004/02/15 11:07:18 epr Exp $
 */
package org.jnode.vm.x86.compiler;

import org.jnode.vm.Address;
import org.jnode.vm.Unsafe;

/**
 * Jumptable constants for the X86 architecture.
 * 
 * The constants is this class must match the structure of the jumptable
 * in vm-jumptable.asm.
 * 
 * @author Ewout Prangsma (epr@users.sourceforge.net)
 */
public class X86JumpTable {

	/** Jumptable offset of vm_patch_MOV_EAX_IMM32 */
	public static final int VM_PATCH_MOV_EAX_IMM32_OFS = 0;
	/** Jumptable offset of vm_patch_NOP */
	public static final int VM_PATCH_NOP_OFS = 4;
	/** Jumptable offset of vm_athrow */
	public static final int VM_ATHROW_OFS = 8;
	/** Jumptable offset of vm_athrow_notrace */
	public static final int VM_ATHROW_NOTRACE_OFS = 12;
	/** Jumptable offset of vm_interpreter */
	public static final int VM_INTERPRETER_OFS = 16;
	/** Jumptable offset of vm_invoke_abstract */
	public static final int VM_INVOKE_ABSTRACT_OFS = 20;
	/** Jumptable offset of vm_invoke_method_after_recompile */
	public static final int VM_INVOKE_METHOD_AFTER_RECOMPILE_OFS = 24;
	
	/** Label name of the jumptable */
	public static final String JUMPTABLE_NAME = "vm_jumpTable";
	
	/**
	 * Gets a jumptable entry.
	 * This method can only be called at runtime.
	 * @param offset
	 * @return The jumptable entry.
	 * @see #VM_PATCH_MOV_EAX_IMM32_OFS
	 * @see #VM_PATCH_NOP_OFS
	 * @see #VM_ATHROW_OFS
	 * @see #VM_ATHROW_NOTRACE_OFS
	 * @see #VM_INTERPRETER_OFS
	 */
	public static Address getJumpTableEntry(int offset) {
		return Unsafe.getAddress(Unsafe.getJumpTable(), offset);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?