Commit Graph

5 Commits

Author SHA1 Message Date
David Anderson
9ba1363d86 Remove Format/FormatArgs from the core/logic bridge. 2015-08-30 18:03:31 -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
Nicholas Hastings
e4645332aa Convert missed files in logic to use logger from logic. 2014-08-17 11:06:43 -04:00
David Anderson
f5e1ff3f1f Fix more build bustage. 2013-02-16 17:28:17 -08:00
David Anderson
1e8a6e878d Move DebugReporter from core to logic (bug 5607, r=psychonic).
--HG--
rename : core/DebugReporter.cpp => core/logic/DebugReporter.cpp
rename : core/DebugReporter.h => core/logic/DebugReporter.h
2013-02-16 15:57:00 -08:00