Commit Graph

6 Commits

Author SHA1 Message Date
David Anderson
3cccfc15da Update to SourcePawn 1.9 and the latest AMTL. 2016-07-26 01:36:35 -07:00
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
Kyle Sanderson
36cc7610a1 Fix bad handle Forward handling in RequstFrame (irc, r=psychonic). 2014-02-08 15:10:35 -07:00
Kyle Sanderson
e01fc5e697 Add RequestFrame native for one-off frame actions (bug 5965, r=dvander). 2013-10-29 22:10:40 -04:00
Kyle Sanderson
b3c0b964b5 Added many missing handle security checks (bug 5595, r=psychonic).
--HG--
extra : rebase_source : cc5bf3057bbce89fc14bff9c673821c3146c588b
2013-07-18 20:34:43 -04:00
"David Anderson
cec339552e Moved smn_functions to logic binary.
--HG--
rename : core/smn_functions.cpp => core/logic/smn_functions.cpp
2009-05-14 11:38:50 -04:00