sourcemod/core
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
..
logic Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
msvc8 Now compiles against Metamod:Source 1.7 (bug 3445). 2008-11-27 01:13:51 -06:00
msvc9 Updated core msvc9 proj file (engine defs, -smn_profiler, mms17 -> mms18) (NPOTB). 2011-05-24 18:34:45 -04:00
msvc10 Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
msvc11 Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
AMBuilder Remove conditionals in ambuild scripts for using msvc <2013 (not supported). 2015-01-21 11:04:52 -05:00
CDataPack.cpp Add WritePackFunction and ReadPackFunction natives 2014-08-04 02:05:25 +02:00
CDataPack.h Add WritePackFunction and ReadPackFunction natives 2014-08-04 02:05:25 +02:00
CellRecipientFilter.h Fixed regression in CellFilter GetRecipientIndex reading oob (bug 5826, r=psychonic). 2013-08-03 19:20:03 -04:00
ChatTriggers.cpp Fix regressions in b2f7d97b1ea7 and update plugins for OnClientSayCommand changes (bug 5986, r=psychonic). 2014-02-28 10:38:36 -05:00
ChatTriggers.h Strip quotes from chat forwards (bug 5986, r=psychonic). 2014-02-27 23:06:02 -05:00
concmd_cleaner.cpp Replace usages of deprecated Sourcehook Add/Remove macros (bug 5631, r=dvander). 2013-03-16 22:15:25 -04:00
concmd_cleaner.h 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
ConCmdManager.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
ConCmdManager.h Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
ConCommandBaseIterator.h Added support for Alien Swarm (bug 4530, r=dvander). 2010-07-27 17:32:32 -05:00
ConsoleDetours.cpp Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
ConsoleDetours.h Move ForwardSys from core to logic (bug 5953, r=fyren). 2013-10-09 08:43:08 -04:00
convar_sm_dota.h Updated for latest hl2sdk-dota changes. 2013-07-12 02:31:41 -04:00
convar_sm_l4d.h Split TF2, DoD:S, HL2:DM, and ND to separate binaries (bug 5813, r=asherkin). 2013-07-21 11:53:56 -04:00
convar_sm_ob.h Compile and link fixes for Mac OS X (bug 4392, r=dvander). 2010-05-13 04:22:31 -05:00
convar_sm_swarm.h Added engine support for Insurgency (bug 5951, r=asherkin). 2013-10-13 14:16:08 -04:00
convar_sm.h Spring Cleaning, Part Ichi (1) 2008-03-30 07:00:22 +00:00
ConVarManager.cpp Fix automatic language detection on CS:GO (bug 6163). 2014-08-05 01:41:44 -04:00
ConVarManager.h Remove unfinished ConVar queries on client disconnect (bug 6003, r=psychonic). 2014-02-27 19:55:13 -07:00
CoreConfig.cpp Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
CoreConfig.h Remove CoreConfig use of memtables (bug 5899 part 1, r=fyren). 2013-08-31 11:50:11 -07:00
CrazyDebugger.cpp Fixed CrazyDebug not working with Episode One games 2008-05-25 12:46:03 +00:00
EventManager.cpp Update for hl2sdk-dota changes 2014-08-29 09:53:43 -07:00
EventManager.h Update for hl2sdk-dota changes 2014-08-29 09:53:43 -07:00
frame_hooks.cpp Move DBManager and DB natives from core to logic (bug 5953, r=fyren). 2013-10-09 08:43:08 -04:00
frame_hooks.h Initial import of updater extension, currently incomplete - just getting it in the tree (bug 3530). 2009-02-02 15:41:25 -05:00
HalfLife2.cpp Fix ICommandLine not being found in Dark Messiah. 2015-01-11 11:44:45 -05:00
HalfLife2.h Switch HalfLife2 off KTrie (bug 5884 part 7, r=ds). 2013-08-25 11:59:48 -07:00
LibrarySys.cpp Added detection for clang compiler and fixed various warnings triggered by it (bug 4878, r=dvander). 2011-04-23 21:53:53 -05:00
LibrarySys.h Another gamedata cleanup sponsored by an r=pred (bug 3351). 2008-12-26 23:26:21 -05:00
Logger.cpp Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
Logger.h Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
logic_bridge.cpp Move menu natives from core to logic 2014-09-05 08:24:40 -07:00
logic_bridge.h Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
Makefile Updated for CS:S sync (r=asherkin). 2013-02-05 21:45:11 +00:00
MenuManager.cpp Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
MenuManager.h Remove MenuManager use of memtables (bug 5899 part 2, r=fyren). 2013-08-31 11:50:28 -07:00
MenuStyle_Base.cpp AMTL updates and changes to adapt for them to fix menu crashes (bug 5921, r=psychonic). 2013-11-30 10:51:28 -05:00
MenuStyle_Base.h AMTL updates and changes to adapt for them to fix menu crashes (bug 5921, r=psychonic). 2013-11-30 10:51:28 -05:00
MenuStyle_Radio.cpp Root Menu Handles during Display. 2015-02-21 17:10:26 -08:00
MenuStyle_Radio.h Root Menu Handles during Display. 2015-02-21 17:10:26 -08:00
MenuStyle_Valve.cpp Root Menu Handles during Display. 2015-02-21 17:10:26 -08:00
MenuStyle_Valve.h Root Menu Handles during Display. 2015-02-21 17:10:26 -08:00
MenuVoting.cpp Fixed client console vote output missing newlines (bug 5205, r=psychonic). 2012-05-26 18:25:28 -04:00
MenuVoting.h Added voting output (bug 1997, r=dvander) 2009-09-17 18:54:40 +12:00
NextMap.cpp Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
NextMap.h Increase mapname buffer size in nextmap to accomodate longer map names. 2013-09-13 13:47:55 -04:00
PlayerManager.cpp Prevent null auth string comparisons. 2015-01-19 07:48:45 -05:00
PlayerManager.h Convert CPlayer::m_AuthID to ke::AString. 2014-12-13 19:39:44 -05:00
sm_autonatives.cpp Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
sm_autonatives.h Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
sm_fastlink.h Added detection for clang compiler and fixed various warnings triggered by it (bug 4878, r=dvander). 2011-04-23 21:53:53 -05:00
sm_globals.h Moved gameconf code from core to logic (bug 4406 part 11, r=ds). 2010-05-14 23:35:42 -07:00
sm_memtable.h Refactor Trie natives to use HashMap instead of KTrie; add iteration API (bug 5892, r=ds). 2013-08-29 10:09:02 -07:00
sm_srvcmds.cpp Actually use game path instead of SM path as base. 2015-02-07 09:25:25 -08:00
sm_srvcmds.h Switch sm_srvcmds off KTrie (bug 5884 part 12, r=ds). 2013-08-25 12:17:25 -07:00
sm_stringutil.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
sm_stringutil.h Moved gameconf code from core to logic (bug 4406 part 11, r=ds). 2010-05-14 23:35:42 -07:00
smn_bitbuffer.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smn_commandline.cpp Number -> Int, per recommendation. 2014-10-08 21:47:15 -05:00
smn_console.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smn_entities.cpp Fix regression stopping -1 from being a valid value in SetEntPropEnt. 2014-07-09 22:23:20 -04:00
smn_events.cpp Port events to transitional syntax. 2014-12-13 12:51:16 -08:00
smn_halflife.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smn_hudtext.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smn_keyvalues.cpp Port KeyValues to the transitional syntax. 2014-11-08 15:54:40 -08:00
smn_nextmap.cpp - Added ForceChangeLevel and Map History to nextmap api 2008-07-13 05:13:37 +00:00
smn_player.cpp Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
smn_protobuf.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smn_usermsgs.cpp Unify Maximum supported clients, raised SDKTools limit (bug 5964, r=psychonic). 2014-05-06 18:40:35 -07:00
smn_usermsgs.h Added initial support for protobuf usermessages on CS:GO (bug 5579, r=asherkin). 2013-01-22 21:43:12 -05:00
smn_vector.cpp Added preliminary support for Left 4 Dead; some things may not yet work. 2008-11-14 09:18:30 -06:00
sourcemm_api.cpp Don't looks for IServerTools on ep1 games. 2015-01-01 14:56:37 -05:00
sourcemm_api.h Don't looks for IServerTools on ep1 games. 2015-01-01 14:56:37 -05:00
sourcemod.cpp Refactor the public API entrypoint for SourcePawn. 2015-02-24 01:52:13 -08:00
sourcemod.h Fix various problems with unloading ClientPrefs and SourceMod (bug 5874, r=ds). 2013-08-22 14:05:44 -07:00
TimerSys.cpp Move ForwardSys from core to logic (bug 5953, r=fyren). 2013-10-09 08:43:08 -04:00
TimerSys.h Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
UserMessagePBHelpers.h Add PbRemoveRepeatedFieldValue native (bug 6066, r=asherkin). 2014-03-21 13:23:48 -04:00
UserMessages.cpp Switch UserMessages off KTrie (bug 5884 part 11, r=ds). 2013-08-25 12:16:07 -07:00
UserMessages.h Switch UserMessages off KTrie (bug 5884 part 11, r=ds). 2013-08-25 12:16:07 -07:00
version.rc Overhauled versioning information (bug 5453, r=dvander). 2012-08-26 01:33:54 +01:00
vprof_tool.cpp Add a command to dump profiling output. 2014-08-09 13:32:05 -05:00
vprof_tool.h Add a command to dump profiling output. 2014-08-09 13:32:05 -05:00