Commit Graph

10 Commits

Author SHA1 Message Date
David Anderson
04827466b0 Rewrite the .smx parser.
This removes one the last remnants of the SourceMod 1.0 VM implementation.

The new parser introduces a number of design changes in the VM. First, the VM now takes greater responsibility for validating and sanity checking the structure of the SMX container format. Previously, malformed SMX files could easily crash SourcePawn. The loader now rejects files that have out-of-bounds offsets or incomplete sections. Complex sections, like debug info or the code stream, are verified lazily.

Internally, the sp_plugin_t structure has been removed. It has been replaced by a new LegacyImage class, designed to be independent from the SPVM API. This potentially lets us load code streams from non-.smx containers. More importantly, it removes a lot of bookkeeping and pre-computed state from PluginRuntime. The LegacyImage class is now responsible for handling debug info as well.

PluginRuntime is now intended to hold only cached or immutable data, and PluginContext holds all VM state. As such PluginContext is now responsible for allocating a plugin's runtime memory, not PluginRuntime.

Finally, some aspects of the loading process have been cleaned up. The
decompression and image handoff logic should now be easier to
understand.
2015-02-25 22:28:10 -08:00
David Anderson
fcec0ee7c7 Use AutoPtr in more places in the JIT. 2015-02-24 23:50:42 -08:00
David Anderson
b9b0ec865c Simplify the JIT function cache. 2015-02-24 23:43:07 -08:00
David Anderson
fcaa5361c8 Don't expose mutable sp_native_t. 2015-02-24 23:10:18 -08:00
dvander@alliedmods.net
8eed58a467 Rename sp_vm_basecontext to plugin-context. 2015-02-24 12:55:00 -08:00
dvander@alliedmods.net
2e77155b4e Rename BaseContext to PluginContext. 2015-02-24 12:50:09 -08:00
David Anderson
21f5400d9c Remove ICompilationData. 2015-02-24 02:03:57 -08:00
David Anderson
8c95919b32 Move watchdog/runtime interaction into Environment. 2015-02-24 02:03:55 -08:00
David Anderson
3cf3f6c3f8 Merge sp_vm_engine and engine2. 2015-02-24 01:52:14 -08:00
dvander@alliedmods.net
1f9b898702 Rename BaseRuntime files to plugin-runtime. 2015-02-23 16:44:15 -08:00