Erik Paulson wrote:

Some basic questions: is there a notion of "current time" in Parrot, like
a cycle counter or anything?

It would be rather easy to add a cycle counter. I was thinking of:

- new field interpreter->cycle_counter
- increment it on each opcode executed that involves PMC argument(s) [1]
- as core_ops_*.c is generated by deep magic aka perl scripts [2] it should be simple to create an opcode body like:

   ++interpreter->cycle_counter;
   {
           // opbody $source goes here
   }

-Erik

[1] only PMCs can be shared and I don't like slowdown of native integer or float code of course
[2] see build_tools/ops2.pl, lib/Parrot/Op.pm (maybe: lib/Parrot/OpTrans* )

leo

Reply via email to