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 */
013package org.jikesrvm.ia32;
014
015import org.jikesrvm.compilers.common.assembler.ia32.Assembler;
016import org.jikesrvm.compilers.common.CodeArray;
017import org.jikesrvm.runtime.Entrypoints;
018
019/**
020 * Generate a "trampoline" that jumps to the shared lazy compilation stub.
021 * This is then copied into individual TIBs.
022 * <p>
023 * We do this to enable the optimizing compiler to use ptr equality of
024 * target instructions to imply logical (source) equality of target methods.
025 * This is used to perform guarded inlining using the "method test."
026 * Without per-class lazy compilation trampolines, ptr equality of target
027 * instructions does not imply source equality, since both targets may in fact
028 * be the globally shared lazy compilation stub.
029 */
030public abstract class LazyCompilationTrampoline {
031  public static final CodeArray instructions;
032
033  static {
034    Assembler asm = new Assembler(0);
035    asm.generateJTOCjmp(Entrypoints.lazyMethodInvokerMethod.getOffset());
036    instructions = asm.getMachineCodes();
037  }
038}