Commit Graph

29 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
acf6dcac86 Remove the interpreter. 2015-02-24 23:57:08 -08:00
dvander@alliedmods.net
37af05c456 Move the debug return stack into PluginContext. 2015-02-24 15:20:00 -08:00
dvander@alliedmods.net
8eed58a467 Rename sp_vm_basecontext to plugin-context. 2015-02-24 12:55:00 -08:00
David Anderson
111dd7eb68 Factor code stubs out of JITX86. 2015-02-24 02:03:58 -08:00
David Anderson
c70e87d582 Move the code cache into Environment, and out of knight/shared. 2015-02-24 01:57:50 -08:00
David Anderson
3cf3f6c3f8 Merge sp_vm_engine and engine2. 2015-02-24 01:52:14 -08:00
David Anderson
499f7b3929 Refactor the public API entrypoint for SourcePawn. 2015-02-24 01:52:13 -08:00
David Anderson
e58415f94a Fix shell build on Windows. 2015-02-24 01:49:03 -08:00
David Anderson
4212fb88c8 Build the debug spshell as part of AMBuild. 2015-02-23 20:21:17 -08:00
dvander@alliedmods.net
1f9b898702 Rename BaseRuntime files to plugin-runtime. 2015-02-23 16:44:15 -08:00
dvander@alliedmods.net
0ee4885056 Rename sp_vm_function to scripted-invoker. 2015-02-23 16:14:59 -08:00
dvander@alliedmods.net
45bac7feb0 Rename jit_function to compiled-function. 2015-02-23 16:04:57 -08:00
Nicholas Hastings
c62e7458f9 Disable RTTI for Loader, Logic, and JIT bins 2014-09-11 17:15:59 -07:00
David Anderson
225954a27c Modernize the smx headers. 2014-08-21 22:16:07 -07:00
Ryan Stecker
db98c98a1a Remove the /TP (compile as C++) msvc flag from projects that should be compiling as C. 2014-07-02 13:46:39 -05:00
Scott Ehlert
e00e879af5 Use == instead of is operator for checking string equality in AMBuild scripts (bug 6043, r=dvander). 2014-02-09 22:50:20 -06:00
David Anderson
e1a820dcf9 Port simple C++ build scripts to AMBuild 2 (bug 5997 part 1, r=ds). 2013-12-30 17:50:56 -05:00
David Anderson
f9f4c7dcd6 Add an interpreter because. (bug 5902, r=ds). 2013-09-01 00:23:44 -07:00
David Anderson
de8726ab73 Move ke_ headers to new public/amtl folder.
--HG--
rename : public/sourcepawn/ke_allocator_policies.h => public/amtl/ke_allocator_policies.h
rename : public/sourcepawn/ke_inline_list.h => public/amtl/ke_inline_list.h
rename : public/sourcepawn/ke_thread_posix.h => public/amtl/ke_thread_posix.h
rename : public/sourcepawn/ke_thread_utils.h => public/amtl/ke_thread_utils.h
rename : public/sourcepawn/ke_thread_windows.h => public/amtl/ke_thread_windows.h
rename : public/sourcepawn/ke_utility.h => public/amtl/ke_utility.h
rename : public/sourcepawn/ke_vector.h => public/amtl/ke_vector.h
2013-08-22 16:30:44 -07:00
David Anderson
c48cc0afdc Fix OS X build. 2013-08-15 16:26:16 -07:00
David Anderson
3ac43497b9 Implement a watchdog timer for scripts that take too long to execute (bug 5837, r=fyren).
--HG--
extra : rebase_source : ffacb38457eca581660ce8f15c444ad828b7fedd
2013-08-14 23:54:25 -07:00
David Anderson
bf325b72f1 Use SSE when available for floating-point operations (bug 5841, r=her). 2013-08-08 20:26:36 -07:00
David Anderson
9e56725406 Refactor the JIT to use a newer, simpler macro assembler. (bug 5827, r=ann) 2013-08-08 09:41:24 -07:00
Asher Baker
0f62a8ec2f Generate debugging information during compilation (bug 5227, r=ds). 2013-03-17 21:00:28 +00:00
Asher Baker
de27cb8a2f Added system to block malware or illegal plugins (bug 5289, r=dvander). 2012-08-09 01:54:43 +01:00
Asher Baker
5f551fa67a Backed out changeset: 387b27fb575b (bug 5227) 2012-04-14 01:12:24 +01:00
Asher Baker
393c54fdc2 Generate debugging information during compilation. (bug 5227, r=ds) 2012-02-16 19:26:49 +00:00
David Anderson
d682361cfc More changes for new build system. 2009-08-30 00:46:56 -07:00