mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-08 20:14:00 -04:00
Merge pull request #1212 from mzgoddard/unwrapped
execute optimization by unwrapping recursion
This commit is contained in:
commit
4525139d59
5 changed files with 233 additions and 194 deletions
src/engine
|
@ -35,6 +35,7 @@ class Blocks {
|
|||
* @type {{inputs: {}, procedureParamNames: {}, procedureDefinitions: {}}}
|
||||
* @private
|
||||
*/
|
||||
Object.defineProperty(this, '_cache', {writable: true, enumerable: false});
|
||||
this._cache = {
|
||||
/**
|
||||
* Cache block inputs by block id
|
||||
|
@ -1032,6 +1033,7 @@ BlocksExecuteCache.getCached = function (blocks, blockId, CacheType) {
|
|||
|
||||
if (typeof CacheType === 'undefined') {
|
||||
cached = {
|
||||
id: blockId,
|
||||
opcode: blocks.getOpcode(block),
|
||||
fields: blocks.getFields(block),
|
||||
inputs: blocks.getInputs(block),
|
||||
|
@ -1039,6 +1041,7 @@ BlocksExecuteCache.getCached = function (blocks, blockId, CacheType) {
|
|||
};
|
||||
} else {
|
||||
cached = new CacheType(blocks, {
|
||||
id: blockId,
|
||||
opcode: blocks.getOpcode(block),
|
||||
fields: blocks.getFields(block),
|
||||
inputs: blocks.getInputs(block),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue