//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

package hlt.language.design.instructions;

/**
 * @version     Last modified on Wed Jun 20 14:29:51 2012 by hak
 * @author      <a href="mailto:hak@acm.org">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; <a href="http://www.hassan-ait-kaci.net/">by the author</a>
 */

/**
 * This is the class of instructions getting an object field value
 * from the object currently on the runtime's object stack.
 */

import hlt.language.design.types.DefinedEntry;
import hlt.language.design.backend.Runtime;
import hlt.language.design.backend.NullValueException;

public class GetObjectField extends FieldInstruction
{
  public GetObjectField (DefinedEntry codeEntry)
    {
      super(codeEntry);
      setName("GET_FIELD_O");
    }

  public void execute (Runtime r) throws NullValueException
    {
      r.pushObject(getObject(r,"access").getObjectField(offset()));
      r.incIP();
    }
}
