Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.gp.vm.base.VMFrame.java

Here you can find all the information about the file org.dgpf.gp.vm.base.VMFrame.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Thomas Weise
 * 
 * E-Mail           : tweise@gmx.de
 * Creation Date    : 2006-06-23 14:07:37
 * Original Filename: org.dgpf.gp.vm.base.VMFrame.java
 * Version          : 1.0.0
 * Last modification: 2006-06-23
 *                by: Thomas Weise
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */

 
package org.dgpf.gp.vm.base;

import org.dgpf.gp.Construct;


/**
 * A execution frame of the vm.
 *
 * @author Thomas Weise
 */

class VMFrame extends Construct
  {       
/**
 * The serial version uid.
 */

  private static final long serialVersionUID = 1;   
/**
 * The parameter memory.
 */

  VMMemory      m_parameters  ;
/**
 * The stack.
 */

  VMMemory      m_stack       ;
/**
 * The instruction pointer.
 */

  int           m_ip          ;
/**
 * The interrupt code.
 */

  Instruction[] m_code        ;
/**
 * The previous frame.
 */

  VMFrame       m_prev        ;
/**
 * <code>true</code> if the instruction was nonblocking.
 */

  boolean       m_non_blocked ;
/**
 * The code index.
 */

  int           m_ci          ;
/**
 * The current zero_flag register.
 */

  boolean       m_zero_flag ;
/**
 * <code>true</code> if and only if this frame is a hardware frame.
 */

  boolean       m_hw;
  
  
/**
 * Create a new vm frame.
 * @param p_context The owning context.
 */

  VMFrame(final VMContext p_context)
    {
    super();
    this.m_stack       = p_context.allocate_mem();
    this.m_non_blocked = true;
    }
  
/**
 * Clear this frame.
 */

  final void clear()
    {
    if(this.m_parameters != null) this.m_parameters.m_size = 0;
                                   //this.m_parameters.clear();
//    this.m_stack.clear();
    this.m_stack.m_size = 0;
    this.m_ip           = 0;
    this.m_prev         = null;
    this.m_non_blocked  = true;
    this.m_zero_flag    = false;
    }
  
/**
 * Store this objects content into a string builder.
 * @param p_sb  The string builder to store stuff into.
 */

  @Override
  public final void  to_string (final StringBuilder p_sb)
    {
    p_sb.append(Program.APPEND_CHRS, 0, 2);
    p_sb.append("interrupt : ");
    p_sb.append(this.m_ci);
    p_sb.append(Program.APPEND);
    p_sb.append("ip        : ");
    p_sb.append(this.m_ip);
    p_sb.append(Program.APPEND);
    p_sb.append("blocked   : ");
    p_sb.append(!(this.m_non_blocked));
    p_sb.append(Program.APPEND);
    p_sb.append("zero-flag : ");
    p_sb.append(this.m_zero_flag);
    p_sb.append(Program.APPEND);
    p_sb.append("hardware  : ");
    p_sb.append(this.m_hw);
    p_sb.append(Program.APPEND);
    p_sb.append("parameters: ");
    this.m_parameters.to_string(p_sb);
    p_sb.append(Program.APPEND);
    p_sb.append("stack     : ");
    this.m_stack.to_string(p_sb);
    }
  

/**
 * Get a string that can be copy-pasted into a java file an that creates
 * this construct.
 * @param p_b The string builder to add with. 
 */

  @Override
  public final  void    to_creation_string (final StringBuilder p_b)
    {
    //
    }
  }

File Information:

file name:VMFrame.java
package:org.dgpf.gp.vm.base
qualified name:org.dgpf.gp.vm.base.VMFrame.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/gp/vm/base/VMFrame.java
size:3.804 KB (3896 B)
uploaded: 2015-07-22 04:10:56 GMT+0000
last update: 2006-08-01 05:36:30 GMT+0000
last access: 2017-11-18 23:12:46 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2017-11-18 23:12:46 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo