Commit Graph

20 Commits

Author SHA1 Message Date
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
David Anderson
a00adaf9fb Sync with AMTL one last time. 2014-09-03 22:05:10 -07:00
David Anderson
c64edf31fc Fix Windows build, again. 2014-04-22 20:04:12 -07:00
David Anderson
cb32e3d8f9 Fix Windows build. 2014-04-22 19:46:55 -07:00
David Anderson
e69e9eddc7 Change float comparison operators to return false for NaN (bug 6107, r=ds).
--HG--
extra : rebase_source : a11c56fb23d6617545def3591ec6100dd143eb3e
2014-04-22 19:40:45 -07:00
Nicholas Hastings
614967ccc1 Updated for latest hl2sdk-dota changes. 2013-05-13 15:18:12 -04:00
David Anderson
045ee262a8 Move scared guts of core into logic (bug 5680, r=fyren).
--HG--
rename : core/ExtensionSys.cpp => core/logic/ExtensionSys.cpp
rename : core/ExtensionSys.h => core/logic/ExtensionSys.h
rename : core/HandleSys.cpp => core/logic/HandleSys.cpp
rename : core/HandleSys.h => core/logic/HandleSys.h
rename : core/NativeInvoker.cpp => core/logic/NativeInvoker.cpp
rename : core/NativeInvoker.h => core/logic/NativeInvoker.h
rename : core/NativeOwner.cpp => core/logic/NativeOwner.cpp
rename : core/NativeOwner.h => core/logic/NativeOwner.h
rename : core/PluginSys.cpp => core/logic/PluginSys.cpp
rename : core/PluginSys.h => core/logic/PluginSys.h
rename : core/ShareSys.cpp => core/logic/ShareSys.cpp
rename : core/ShareSys.h => core/logic/ShareSys.h
rename : core/smn_fakenatives.cpp => core/logic/smn_fakenatives.cpp
rename : core/logic/AutoHandleRooter.h => public/AutoHandleRooter.h
2013-03-29 11:37:29 -07:00
David Anderson
64455b9852 Moved gameconf code from core to logic (bug 4406 part 11, r=ds).
--HG--
rename : core/GameConfigs.cpp => core/logic/GameConfigs.cpp
rename : core/GameConfigs.h => core/logic/GameConfigs.h
rename : core/smn_gameconfigs.cpp => core/logic/smn_gameconfigs.cpp
2010-05-14 23:35:42 -07:00
David Anderson
d80191df3d Move replace functions from logic to core (bug 4406 part 7, r=fyren). 2010-05-14 20:04:30 -07:00
David Anderson
9137e92c09 Move translator from logic to core (bug 4406 part 6, r=ds).
--HG--
rename : core/PhraseCollection.cpp => core/logic/PhraseCollection.cpp
rename : core/PhraseCollection.h => core/logic/PhraseCollection.h
rename : core/Translator.cpp => core/logic/Translator.cpp
rename : core/Translator.h => core/logic/Translator.h
rename : core/sm_memtable.h => core/logic/sm_memtable.h
rename : core/smn_lang.cpp => core/logic/smn_lang.cpp
2010-05-14 19:43:53 -07:00
David Anderson
1cdacf69be Move some string functions from core to logic (bug 4406 part 4, r=fyren). 2010-05-14 19:28:10 -07:00
David Anderson
d8474cfafa Added generic command hooking mechanism, to replace Reg*Cmd which is intended for command creation (bug 4015, r=pred). 2009-09-26 17:12:23 -04:00
Matt Woodrow
77de71d79d Fixed gnprintf's translation parameter reordering (bug 4010, r=dvander) 2009-09-16 13:38:04 +12:00
Fyren
e04d2a4a10 Added case insensitivity search to ReplaceString (bug 3639, r=dvander). 2009-03-01 16:41:44 -05:00
David Anderson
c676ecc026 Fixed regression in printing floats with no precision (bug 3447, r=ds). 2009-01-07 19:23:24 -05:00
David Anderson
99e304d6b5 Fixed a bug where SourceMod failed trying to default back to English when missing translations. 2008-10-05 04:06:18 -07:00
Scott Ehlert
ac68a441ee All natives that use a recipient filter now actually validate the clients passed to them.
This includes StartMessage(), StartMessageEx() from Core as well as EmitSound(), EmitSentence(), and TE_Send() from SDKTools

(Warning: This may potentially cause a minor compatibility problem with plugins that don't check client validity before passing to these natives)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402252
2008-06-11 08:07:17 +00:00
David Anderson
c7418e70ba added amb1666 - rehaul over the ml api so extensions can easily use translations
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402132
2008-05-10 09:23:55 +00:00
David Anderson
b455ac4f4e merged changes back from 1.0.1
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401992
2008-04-06 06:56:45 +00:00
Scott Ehlert
251cced1f8 Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401971
2008-03-30 07:00:22 +00:00