// ----------------------------------------------------------------------------
void LocalEvaluator::setWorkingDir(const QString& working_directory)
{
  if ( !working_directory.size() )  // on reset
  {
      curr_working_dir = working_directory;
      return;
  }

  if ( working_directory == curr_working_dir ||
       process->state() != QProcess::Running )
  {
    return;
  }

  QString command;

#if defined(Q_OS_WIN)
  command = QString("cd(\"" + working_directory + "\")\r\n");
  output("\n");
  executing( command + "\n" );  // windows hack!
#else
  command = QString( "cd(\"" + working_directory + "\")\n" );
  output( "working dir: " + working_directory + "\n" );
#endif

  qDebug() << command;

  process->write( command.toAscii() );
  curr_working_dir = working_directory;
}
cell code_block::owner_quot() const
{
	tagged<object> executing(owner);
	if (!optimized_p() && executing->type() == WORD_TYPE)
		executing = executing.as<word>()->def;
	return executing.value();
}
Exemple #3
0
cell factor_vm::frame_executing_quot(stack_frame *frame)
{
	tagged<object> executing(frame_executing(frame));
	code_block *compiled = frame_code(frame);
	if(!compiled->optimized_p() && executing->type() == WORD_TYPE)
		executing = executing.as<word>()->def;
	return executing.value();
}
Exemple #4
0
void Command::execute() {
    assert(!executing());

    cancellationToken_ = CancellationToken();

    ++activityCount_;
    work();
    activityFinished();
}
Exemple #5
0
void device_execute_interface::adjust_icount(int delta)
{
	// ignore if not the executing device
	if (!executing())
		return;

	// apply the delta directly
	*m_icountptr += delta;
}
Exemple #6
0
UINT64 device_execute_interface::total_cycles() const
{
	if (executing())
	{
		assert(m_cycles_running >= *m_icountptr);
		return m_totalcycles + m_cycles_running - *m_icountptr;
	}
	else
		return m_totalcycles;
}
	void operator()(void *frame_top, cell frame_size, code_block *owner, void *addr)
	{
		data_root<object> executing_quot(owner->owner_quot(),parent);
		data_root<object> executing(owner->owner,parent);
		data_root<object> scan(owner->scan(parent, addr),parent);

		frames.add(executing.value());
		frames.add(executing_quot.value());
		frames.add(scan.value());
	}
Exemple #8
0
attotime device_execute_interface::local_time() const
{
	// if we're active, add in the time from the current slice
	if (executing())
	{
		assert(m_cycles_running >= *m_icountptr);
		int cycles = m_cycles_running - *m_icountptr;
		return m_localtime + cycles_to_attotime(cycles);
	}
	return m_localtime;
}
Exemple #9
0
void device_execute_interface::eat_cycles(int cycles)
{
	// ignore if not the executing device
	if (!executing())
		return;

	// clamp cycles to the icount and update
	if (cycles > *m_icountptr)
		cycles = *m_icountptr;
	*m_icountptr -= cycles;
}
Exemple #10
0
void device_execute_interface::abort_timeslice()
{
	// ignore if not the executing device
	if (!executing())
		return;

	// swallow the remaining cycles
	if (m_icountptr != NULL)
	{
		int delta = *m_icountptr;
		m_cycles_stolen += delta;
		m_cycles_running -= delta;
		*m_icountptr -= delta;
	}
}
// ----------------------------------------------------------------------------
void LocalEvaluator::eval( const QFileInfo *file_info )
{
  if ( process->state() != QProcess::Running )
    return;

  QString command;
#if defined(Q_OS_WIN)
  command = QString("include(\"" + file_info->absoluteFilePath() + "\")\r\n");
  output("\n");
  executing( command );  // windows hack!
#else
  command = QString("push!(LOAD_PATH, \"" + file_info->absolutePath() + "\");include(\"" + file_info->absoluteFilePath() + "\")\n").toAscii();
  output(file_info->baseName() + "\n");
#endif

  process->write( command.toAscii() );}
Exemple #12
0
INT32 device_execute_interface::cycles_remaining() const
{
	return executing() ? *m_icountptr : 0;
}