Thomas Weber
94f09e10b2
js+execute: Remove listGetFast
...
The ?? operator is used instead.
Older browsers now simply won't get this optimization.
2020-09-09 22:03:24 -05:00
Thomas Weber
f999252917
execute: Cleanup some code
2020-08-31 15:23:19 -05:00
Thomas Weber
c791dad0e7
ast+js: Compile sensing_dayssince2000
...
This block is commonly used to get exact timing in Scratch, so it is worthwhile to compile.
2020-08-29 01:29:07 -05:00
Thomas Weber
87258bf44d
Remove misleading comment
...
It was incorrect.
2020-08-29 00:54:38 -05:00
Thomas Weber
1e08b6a2a6
js: Optimize list.get for number indexes
2020-08-28 21:11:12 -05:00
Thomas Weber
e44c91b789
Remove toNumber() as it is only used in one spot
2020-08-28 16:10:31 -05:00
Thomas Weber
d9bb8250ac
execute: Only check for stuck every 10th call
...
This improves performance by not checking quite so often.
2020-08-13 00:21:10 -05:00
Thomas Weber
1170d4add6
execute: Address some compatibility layer todos
...
- handle warp mode
- handle promise return value after yield
2020-08-09 14:15:16 -05:00
Thomas Weber
05305af250
execute: timer should use runtime.currentMSecs
2020-08-09 14:14:27 -05:00
Thomas Weber
2fc50f3dbc
js/execute: Improve stuck detection
...
- move logic to execute
- only check for stuck if in warp
2020-08-09 14:12:55 -05:00
Thomas Weber
0447835bc7
execute: Fix some compatibility layer timing bugs ( #8 )
2020-08-08 22:43:27 -05:00
Thomas Weber
97f908c277
Merge branch 'ast' into develop
2020-08-03 23:51:05 -05:00
Thomas Weber
626513d345
ast/execute cleanup
2020-08-03 23:47:54 -05:00
Thomas Weber
32df47f2e2
Compiler cleanup
2020-08-03 22:53:36 -05:00
Thomas Weber
235e2a00cd
Fix some smaller bugs
2020-08-03 22:53:36 -05:00
Thomas Weber
d0278aa08e
ast: Support the remaining ast nodes in jsgen
2020-08-03 22:53:36 -05:00
Thomas Weber
20a60d8e1c
Fix listContents
...
for the forkphorus test suite
2020-08-03 01:37:14 -05:00
Thomas Weber
2d25c505f5
Only change warp status in warp procedures
...
Warp incrementing and decrementing is now only included for warp procedures.
Non-warp procedures do not touch the counter at all.
2020-07-17 22:05:32 -05:00
Thomas Weber
8b90a356eb
Fix list contains, list index of
2020-07-17 18:08:24 -05:00
Thomas Weber
b027b7d50c
Use specialized methods for comparisons
...
Remove the generalized `cast` in favor of 3 specialized ones.
This is a slight optimizations for comparisons.
2020-07-16 16:38:19 -05:00
Thomas Weber
4d5a7b70f3
Remove unused runtime method toString
2020-07-16 16:35:27 -05:00
Thomas Weber
5c032876b3
Optimize operator_random for the common case of constant bounds
2020-07-16 16:05:49 -05:00
Thomas Weber
0b4ce41f12
Cleanup
2020-07-16 13:50:55 -05:00
Thomas Weber
c141be971d
createScriptFactory -> scopedEval
2020-07-14 18:55:02 -05:00
Thomas Weber
1424678c6c
reset stack frames with the warp status
2020-07-14 15:50:33 -05:00
Thomas Weber
84e14d5261
Refactoring
2020-07-14 15:29:52 -05:00
Thomas Weber
818ce8e9b9
Move all the "touching color" blocks into the compiler
2020-07-14 14:43:48 -05:00
Thomas Weber
2a12e70dce
Fix some more compiler bugs
...
- add data_itemnumoflist
- fix compatibility layer operator precedence issues
- don't cache procedures until compilation completed
2020-07-14 12:45:38 -05:00
Thomas Weber
1c0b3c9088
Remove targetVariables, stageVariables aliases
...
Now redundant, only adds useless runtime data.
2020-07-14 00:22:26 -05:00
Thomas Weber
9dfbdba2d3
Factory variables
...
Variables that are evaluated once, at compile-time.
Makes every variable access even faster than before.
Implementation a bit dirty, will clean up later.
2020-07-13 23:52:18 -05:00
Thomas Weber
e1aef16944
Simplify type conversions
...
It turns out that calling a function to do this this every time is rather slow, so we manually inline number and string conversions.
Boolean conversions are complex enough that I don't think inlining it would be a very good idea.
2020-07-13 23:45:20 -05:00
Thomas Weber
d537a9b36b
Make the forkphorus test suite (mostly) pass
...
- support fields in compatibility layer
- fix "last" of list
- add compiled control_for_each
- add compiled operator_contains
- round sin/cos, implement tan
- do not compile edge activated hats
2020-07-13 19:39:44 -05:00
Thomas Weber
7e767ad6fd
Fix some more bugs
...
- update readme to be more up-to-date
- fix compatibility layer stack frame handling
- fix broadcasting non-strings
- compile some more blocks
- add some more blocks to the compatibility layer
2020-07-13 19:00:04 -05:00
Thomas Weber
e23f29c798
Improve the compiler compatibility layer
2020-07-13 18:04:38 -05:00
Thomas Weber
fd0795d285
WIP "compatibility layer" to use some blocks from scratch-vm in compiled scripts
2020-07-13 17:16:31 -05:00
Thomas Weber
6a1f565759
fix list delete
2020-07-09 13:27:16 -05:00
Thomas Weber
57d8f9019f
fix list insert
2020-07-09 13:16:40 -05:00
Thomas Weber
aed4aceaa9
Don't store generator result
2020-07-07 14:45:04 -05:00
Thomas Weber
fd03197786
fix list contains
2020-07-07 14:44:49 -05:00
Thomas Weber
fa34aa9f6a
Remove target global from executor
...
Just get it from thread
2020-07-07 13:45:47 -05:00
Thomas Weber
c6b9df757c
Script factories
2020-07-06 23:18:16 -05:00
Thomas Weber
d27cc02bae
optimizations, bug fixes
2020-07-06 22:13:48 -05:00
Thomas Weber
5c56ba025a
transition more things to yielding
2020-07-06 20:42:16 -05:00
Thomas Weber
bf32e2e468
Back to a yielding compiler
2020-07-06 19:34:38 -05:00
Thomas Weber
5bec779b4a
minor optimizations/fixes
2020-07-06 18:23:16 -05:00
Thomas Weber
3bfc252a0e
fix a couple small bugs
2020-06-26 14:44:19 -05:00
Thomas Weber
fdad50f397
Get some more things to work in the compiler
...
- add event_broadcastandwait
- add looks_switchbackdropto
- add looks_backdrops
2020-06-26 12:45:06 -05:00
Thomas Weber
930fe68112
More updates to the compiler
...
- remove unused local variable tracking and utilities
- add some jsdoc to the compiler executor
- improve variable reference finding
- add data_listcontainsitem
- add event_broadcast
- add event_broadcast_menu
2020-06-26 00:14:42 -05:00
Thomas Weber
3a8f0a11f5
Implement ScriptCache
2020-06-25 21:40:57 -05:00
Thomas Weber
ab9deb2d09
Smaller fixes/changes
...
- add looks_say
- add flags for CompiledInput
- add nullabe/NaNable
2020-06-24 12:47:34 -05:00