elevate stack block id and frame info into thread

- Add pointer member to thread. This is the current executing block.
- Add stackFrame member to thread. This is the current frame
  information like procedure parameters.

This is a step potentially towards stack-less threads. With further
modifications we could have stack and stackFrames be null if a script
does not call a procedure.
This commit is contained in:
Michael "Z" Goddard 2019-04-25 10:40:08 -04:00
parent ffcd0e6518
commit e1254bd8c7
No known key found for this signature in database
GPG key ID: 762CD40DD5349872
8 changed files with 197 additions and 156 deletions

View file

@ -137,7 +137,7 @@ test('retireThread', t => {
const r = new Runtime();
const s = new Sequencer(r);
const th = generateThread(r);
t.strictEquals(th.stack.length, 12);
t.strictEquals(th.stack.length, 11);
s.retireThread(th);
t.strictEquals(th.stack.length, 0);
t.strictEquals(th.status, Thread.STATUS_DONE);