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;
014    
015    import org.jikesrvm.ArchitectureSpecific.Assembler;
016    import org.jikesrvm.ArchitectureSpecific.Registers;
017    import org.vmmagic.pragma.Uninterruptible;
018    import org.vmmagic.unboxed.Address;
019    import org.vmmagic.unboxed.Offset;
020    
021    /**
022     * Wrappers around machine specific code
023     */
024    public abstract class MachineSpecific {
025    
026      /* common to all ISAs */
027    
028      /**
029       * The following method will emit code that moves a reference to an
030       * object's TIB into a destination register.
031       *
032       * @param asm the assembler object to emit code with
033       * @param dest the number of the destination register
034       * @param object the number of the register holding the object reference
035       * @param tibOffset the offset of the TIB from the object header
036       */
037      public abstract void baselineEmitLoadTIB(Assembler asm, int dest, int object, Offset tibOffset);
038    
039      /**
040       * The following method initializes a thread stack as if
041       * "startoff" method had been called by an empty baseline-compiled
042       * "sentinel" frame with one local variable.
043       *
044       * @param contextRegisters The context registers for this thread
045       * @param ip The instruction pointer for the "startoff" method
046       * @param sp The base of the stack
047       */
048      public abstract void initializeStack(Registers contextRegisters, Address ip, Address sp);
049    
050      /* unique to IA */
051      /**
052       * A thread's stack has been moved or resized.
053       * Adjust the ESP register to reflect new position.
054       *
055       * @param registers The registers for this thread
056       * @param delta The displacement to be applied
057       * @param traceAdjustments Log all adjustments to stderr if true
058       */
059      @Uninterruptible
060      public void adjustESP(Registers registers, Offset delta, boolean traceAdjustments) {
061        if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED);
062      }
063    }