scratch-vm/test
Michael "Z" Goddard 6b7582f1c7
Report block result to stackFrame.justReported
- Add stackFrame.justReported

Report the block result to a known key `justReported` instead of a
dynamic key on `reported`. Assuming blocks with a promised value are
relatively infrequent the most common recursive input flow immediately
reads the value "just" reported. In the assumed uncommon case of a
promised thread status, empty the already argValues assigned values
onto the currentStackFrame's reported member. In the next execute call
on this stackFrame, values assigned to reported are read back off onto
argValues, and execute will returned to the assumed common case. This
is a safe assumption since a thread in the promise state will not exit
that state until the next frame when javascript has a chance to call
the resolve handle, setting the thread's state back to another
executable state.

Using direct assignment to `justReported` saves building an object
dynamically. Instead of always building `reported` and `argValues` only
`argValues` is built until a promised state is reached. This also gives
a known time when `reported` is used, allowing cleanup of a
stackFrame's reported to only happen when it was used to persist
already reported values.
2018-01-24 17:00:12 -05:00
..
fixtures Merge pull request #782 from kchadha/list-typed-variable 2017-11-15 12:48:56 -05:00
integration Accept both objects and strings for 'loadProject'. Resolves GH-733 2017-12-20 11:49:40 -05:00
unit Report block result to stackFrame.justReported 2018-01-24 17:00:12 -05:00
.eslintrc.js All linting other than console statements 2016-10-23 22:20:29 -04:00