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

package ilog.language.design.base;

/**
 * @version     Last modified on Wed Apr 10 20:52:16 2002 by hak
 * @author      <a href="mailto:hak@ilog.fr">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; 2000-2002 <a href="http://www.ilog.fr/">ILOG, S.A.</a>
 */

import ilog.language.design.backend.Runtime;
import ilog.language.design.backend.ObjectMap;
import ilog.language.design.backend.Indexable;
import ilog.language.design.backend.NullValueException;

public class PushObjectMap extends Instruction implements PushValue, PushObject
{
  public PushObjectMap ()
    {
      setName("PUSH_MAP_O");
    }

  public final void execute (Runtime r) throws NullValueException
    {
      Indexable indexable = (Indexable)r.popObject("can't allocate a map with a null indexable");
      r.pushObject(new ObjectMap(new Object[indexable.size()],indexable));
      r.incIP();
    }
}
