turn reporter tree into instruction sequence

Turn the reporter tree execute walks into a sequence of block
functions. After calling a block function store the reported value in
the arguments object its depending block will use.

- Set the reported value on the thread. There is only ever one "just"
  reported value, which is read and stored elsewhere after being
  reported.
This commit is contained in:
Michael "Z" Goddard 2018-06-05 23:20:42 -04:00
parent e0ec1ad08f
commit 05291aa254
No known key found for this signature in database
GPG key ID: 762CD40DD5349872
4 changed files with 230 additions and 194 deletions
src/engine

View file

@ -194,7 +194,7 @@ class Sequencer {
//
// this.runtime.profiler.start(executeProfilerId, null);
this.runtime.profiler.records.push(
this.runtime.profiler.START, executeProfilerId, null, performance.now());
this.runtime.profiler.START, executeProfilerId, null, 0);
}
if (thread.target === null) {
this.retireThread(thread);
@ -203,7 +203,7 @@ class Sequencer {
}
if (this.runtime.profiler !== null) {
// this.runtime.profiler.stop();
this.runtime.profiler.records.push(this.runtime.profiler.STOP, performance.now());
this.runtime.profiler.records.push(this.runtime.profiler.STOP, 0);
}
thread.blockGlowInFrame = currentBlockId;
// If the thread has yielded or is waiting, yield to other threads.