mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
6b7582f1c7
- 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. |
||
---|---|---|
.. | ||
blocks_control.js | ||
blocks_event.js | ||
blocks_looks.js | ||
blocks_operators.js | ||
blocks_procedures.js | ||
blocks_sensing.js | ||
blocks_sounds.js | ||
dispatch.js | ||
engine_adapter.js | ||
engine_blocks.js | ||
engine_runtime.js | ||
engine_sequencer.js | ||
engine_target.js | ||
engine_thread.js | ||
extension_music.js | ||
io_clock.js | ||
io_deviceManager.js | ||
io_keyboard.js | ||
io_mouse.js | ||
serialization_sb2.js | ||
serialization_sb3.js | ||
spec.js | ||
sprites_rendered-target.js | ||
util_cast.js | ||
util_color.js | ||
util_math.js | ||
util_string.js | ||
util_timer.js | ||
util_xml.js | ||
virtual-machine.js |