Repository navigation
Bundle the engine without the Lua parser - #236
Merged
Merged
Conversation
SplashEdit always hands the engine compiled Lua (Play, disc), so the parser only cost RAM: NOPARSER=1 frees 28,672 B of static image. CI now builds all ten engines with it, rebuilding psxlua's liblua-noparser.a after each make clean, and fails a variant that lacks the parser stub. splashpack-cli build always stores bytecode, as Play does; --lua-bytecode is still accepted. kEngineHeapBytes is now the NOPARSER disc engine's heap (__stack_start - __heap_start, psxsplash d2c232c).
The bundled engines have no parser: load/loadstring of Lua text return "parser not loaded", string.dump fails with "dumper not loaded", and psxlua has no dofile or loadfile. Export now scans every script (and block script's Lua) for those globals, skipping strings, comments, fields, table keys and names the script defines itself, and adds one warning per script naming each function's first line and the fix. It lands in Problems through the live export and on the CLI's stderr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The editor already exports scripts as bytecode, so the bundled engines are now built without the Lua parser: all 10 variants build with
NOPARSER=1, which gives 28,672 B of RAM back to each game.splashpack-cli buildnow writes bytecode too, and the RAM budget's heap figure comes from the parser-free CD engine (0x80200000 - 0x8009ec70).A script that calls
load,loadstring,dofile,loadfileorstring.dumpgets a warning in Problems and on the CLI (core/luascan): without the parser,loadstringof Lua text returnsnil, "parser not loaded"andstring.dumpfails. None of the bundled projects calls them.Checked in Redux: lamplighter and courtyard, pcdrv and disc, next to the engine with the parser: the same title menu, Cross into the valley and intro text; frames match except a frame of timing during camera moves.
Part of #211.