Ejemplo n.º 1
0
	void iterate_active_callstacks(Iterator &iter, Fixup &fixup)
	{
		std::set<context *>::const_iterator begin = active_contexts.begin();
		std::set<context *>::const_iterator end = active_contexts.end();
		while(begin != end)
		{
			iterate_callstack(*begin++,iter,fixup);
		}
	}
Ejemplo n.º 2
0
	template<typename Iterator> void iterate_active_frames(Iterator &iter)
	{
		context *ctx = this->ctx;

		while(ctx)
		{
			iterate_callstack(ctx,iter);
			if(ctx->magic_frame) iter(ctx->magic_frame);
			ctx = ctx->next;
		}
	}
Ejemplo n.º 3
0
void factor_vm::record_sample(bool prolog_p) {
  profiling_sample_count counts = sample_counts.record_counts();
  if (counts.empty()) {
    return;
  }
  // Appends the callstack, which is just a sequence of quotation or
  // word references, to sample_callstacks.
  cell begin = sample_callstacks.size();

  bool skip_p = prolog_p;
  auto recorder = [&](cell frame_top, cell size, code_block* owner, cell addr) {
    if (skip_p)
      skip_p = false;
    else
      sample_callstacks.push_back(owner->owner);
  };
  iterate_callstack(ctx, recorder);
  cell end = sample_callstacks.size();

  // Add the sample.
  cell thread = special_objects[OBJ_CURRENT_THREAD];
  samples.push_back(profiling_sample(counts, thread, begin, end));
}
Ejemplo n.º 4
0
Archivo: vm.hpp Proyecto: dmsh/factor
	template<typename Iterator> void iterate_active_callstacks(Iterator &iter)
	{
		std::set<context *>::const_iterator begin = active_contexts.begin();
		std::set<context *>::const_iterator end = active_contexts.end();
		while(begin != end) iterate_callstack(*begin++,iter);
	}
Ejemplo n.º 5
0
inline void factor_vm::iterate_callstack(context* ctx, Iterator& iterator) {
  no_fixup none;
  iterate_callstack(ctx, iterator, none);
}
Ejemplo n.º 6
0
template<typename T> void iterate_callstack_object(callstack *stack, T &iterator)
{
	iterate_callstack((cell)stack->top(),(cell)stack->bottom(),iterator);
}
Ejemplo n.º 7
0
Archivo: gc.cpp Proyecto: Renha/factor
void factor_vm::scrub_context(context *ctx)
{
    call_frame_scrubber scrubber(this,ctx);
    iterate_callstack(ctx,scrubber);
}