kopia lustrzana https://github.com/backface/turtlestitch
added dev debugging hook for counting yields
rodzic
1f32ed178d
commit
07a1d2abf6
|
@ -7,6 +7,9 @@
|
|||
* **Notable Fixes:**
|
||||
* fixed keyboard formula entry for subtraction
|
||||
|
||||
### 2020-12-16
|
||||
* threads, objects: added dev debugging hook for counting yields
|
||||
|
||||
### 2020-12-14
|
||||
* new dev version
|
||||
* objects: fixed keyboard formula entry for subtraction
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
<script src="src/symbols.js?version=2020-10-07"></script>
|
||||
<script src="src/widgets.js?version=2020-10-06"></script>
|
||||
<script src="src/blocks.js?version=2020-12-15"></script>
|
||||
<script src="src/threads.js?version=2020-12-09"></script>
|
||||
<script src="src/objects.js?version=2020-12-15"></script>
|
||||
<script src="src/threads.js?version=2020-12-16"></script>
|
||||
<script src="src/objects.js?version=2020-12-16"></script>
|
||||
<script src="src/gui.js?version=2020-12-15"></script>
|
||||
<script src="src/paint.js?version=2020-05-17"></script>
|
||||
<script src="src/lists.js?version=2020-12-01"></script>
|
||||
|
|
|
@ -84,7 +84,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, BooleanSlotMorph,
|
|||
localize, TableMorph, TableFrameMorph, normalizeCanvas, VectorPaintEditorMorph,
|
||||
AlignmentMorph, Process, WorldMap, copyCanvas, useBlurredShadows*/
|
||||
|
||||
modules.objects = '2020-December-15';
|
||||
modules.objects = '2020-December-16';
|
||||
|
||||
var SpriteMorph;
|
||||
var StageMorph;
|
||||
|
@ -928,6 +928,12 @@ SpriteMorph.prototype.initBlocks = function () {
|
|||
category: 'sensing',
|
||||
spec: 'frames'
|
||||
},
|
||||
reportYieldCount: {
|
||||
dev: true,
|
||||
type: 'reporter',
|
||||
category: 'sensing',
|
||||
spec: 'yields'
|
||||
},
|
||||
reportThreadCount: {
|
||||
dev: true,
|
||||
type: 'reporter',
|
||||
|
@ -2552,6 +2558,7 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push(block('reportThreadCount'));
|
||||
blocks.push(block('reportStackSize'));
|
||||
blocks.push(block('reportFrameCount'));
|
||||
blocks.push(block('reportYieldCount'));
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
|
@ -8714,6 +8721,7 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push(block('reportThreadCount'));
|
||||
blocks.push(block('reportStackSize'));
|
||||
blocks.push(block('reportFrameCount'));
|
||||
blocks.push(block('reportYieldCount'));
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
|
|
|
@ -61,7 +61,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy, Map,
|
|||
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK,
|
||||
TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume*/
|
||||
|
||||
modules.threads = '2020-December-09';
|
||||
modules.threads = '2020-December-16';
|
||||
|
||||
var ThreadManager;
|
||||
var Process;
|
||||
|
@ -584,6 +584,7 @@ function Process(topBlock, receiver, onComplete, yieldFirst) {
|
|||
this.isPaused = false;
|
||||
this.pauseOffset = null;
|
||||
this.frameCount = 0;
|
||||
this.yieldCount = 0;
|
||||
this.exportResult = false;
|
||||
this.onComplete = onComplete || null;
|
||||
this.procedureCount = 0;
|
||||
|
@ -642,6 +643,7 @@ Process.prototype.runStep = function (deadline) {
|
|||
this.evaluateContext();
|
||||
}
|
||||
|
||||
this.yieldCount += 1;
|
||||
this.lastYield = Date.now();
|
||||
this.isFirstStep = false;
|
||||
|
||||
|
@ -5925,6 +5927,10 @@ Process.prototype.reportFrameCount = function () {
|
|||
return this.frameCount;
|
||||
};
|
||||
|
||||
Process.prototype.reportYieldCount = function () {
|
||||
return this.yieldCount;
|
||||
};
|
||||
|
||||
// Process single-stepping
|
||||
|
||||
Process.prototype.flashContext = function () {
|
||||
|
|
Ładowanie…
Reference in New Issue