sourcemod/sourcepawn/jit
David Anderson a1afa23bc4 Implement a new stack and error handling model for the SourcePawn VM.
This has three major changes to SourcePawn. First, the API now supports the concept of "exceptions". The exception state is a global property of an instance of the SourcePawn VM. Exceptions can be caught or suppressed. Many places in SourceMod have been updated to check exceptions instead of errors.

The new API obsoletes major parts of the embedder API - all but one method of invoking functions is obsoleted, and the debug interface has been scrapped. Extensions using the native API will not be affected, however, ThrowNativeError has been deprecated in favor of ReportError.

Second, the SourcePawn concept of a "stack" has been unified at the API level. A stack frame iterator now iterates over all SourcePawn invocations, rather than the topmost plugin. This makes error handling more consistent and removes another dependency on context-per-plugin.

Finally, the implementation of stack frames has been changed dramatically. Rather than maintain a complicated and expensive return pointer stack, we now rely on the implicit one provided by the CPU. The stack frame iterator now walks the JIT stack directly. This removes many unnecessary bookkeeping instructions from the generated code, in particular making the CALL instruction 40% faster.

These changes required some fair surgery to the JIT. Its error paths are now slightly more complicated, as they have to throw an exception rather than return an error code. In addition, any path that can throw an exception is now responsible for creating an "exit frame", which exists to tell the stack frame iterator about transitions from the JIT to the VM.
2015-03-04 23:45:30 -08:00
..
md5 Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
msvc8 Missed a reference to SOURCEMM16 in JIT project files (bug 3445). 2008-11-27 02:20:08 -06:00
msvc9 Missed a reference to SOURCEMM16 in JIT project files (bug 3445). 2008-11-27 02:20:08 -06:00
msvc10 Updated jit vcproj/makefile (NPOTB). 2012-08-15 15:10:55 -04:00
x86 Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
zlib Imported support for new build system. 2009-08-30 00:21:42 -07:00
AMBuilder Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
api.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
api.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
code-allocator.cpp Move the code cache into Environment, and out of knight/shared. 2015-02-24 01:57:50 -08:00
code-allocator.h Move the code cache into Environment, and out of knight/shared. 2015-02-24 01:57:50 -08:00
code-stubs.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
code-stubs.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
compiled-function.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
compiled-function.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
dll_exports.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
dll_exports.h landed massive refactoring of the JIT. contexts are actually contexts now, and a higher level structure wraps sp_plugin_t info. on that note, both sp_plugin_t and sp_context_t are entirely opaque, and not even core has access to them. amazingly, i managed to keep binary compatibility here although a large number of functions are deprecated (and core should eventually stop calling them). 2008-07-11 08:18:43 +00:00
environment.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
environment.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
file-utils.cpp Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
file-utils.h Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
legacy-image.h Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
Makefile Refactor the public API entrypoint for SourcePawn. 2015-02-24 01:52:13 -08:00
Makefile.shell Refactor the public API entrypoint for SourcePawn. 2015-02-24 01:52:13 -08:00
opcodes.cpp Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
opcodes.h Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
plugin-context.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
plugin-context.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
plugin-runtime.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
plugin-runtime.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
scripted-invoker.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
scripted-invoker.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smx-v1-image.cpp Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
smx-v1-image.h Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
stack-frames.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
stack-frames.h Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
version.rc Overhauled versioning information (bug 5453, r=dvander). 2012-08-26 01:33:54 +01:00
watchdog_timer.cpp Rewrite the .smx parser. 2015-02-25 22:28:10 -08:00
watchdog_timer.h Move watchdog/runtime interaction into Environment. 2015-02-24 02:03:55 -08:00