001 /*
002 * This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 * This file is licensed to You under the Eclipse Public License (EPL);
005 * You may not use this file except in compliance with the License. You
006 * may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 * See the COPYRIGHT.txt file distributed with this work for information
011 * regarding copyright ownership.
012 */
013 package org.jikesrvm.ia32;
014
015 import org.jikesrvm.ArchitectureSpecific;
016
017 /**
018 * Representation of machine code instructions and a map from bytecode
019 * index to offset within code array
020 */
021 public abstract class MachineCode {
022 /** Executable instructions */
023 private final ArchitectureSpecific.CodeArray instructions;
024
025 /**
026 * Array indexed by bytecode index, value is offset into code array
027 * TODO: This should really be a final field, but is not due to the way
028 * OSR is currently implemented.
029 */
030 private int[] bytecodeMap;
031
032 public MachineCode(ArchitectureSpecific.CodeArray i, int[] bm) {
033 instructions = i;
034 bytecodeMap = bm;
035 }
036
037 public final ArchitectureSpecific.CodeArray getInstructions() {
038 return instructions;
039 }
040
041 public final int[] getBytecodeMap() {
042 return bytecodeMap;
043 }
044
045 public void setBytecodeMap(int[] b2m) {
046 bytecodeMap = b2m;
047 }
048 }