Commit Graph

40 Commits

Author SHA1 Message Date
David Anderson
e30b57cb4a Update build scripts for new AMTL folder structure. 2015-08-26 15:54:55 -04:00
David Anderson
eaea3c927d Update upstream AMTL as a submodule. 2015-03-08 00:24:03 -08:00
David Anderson
561004c4bf Move SourcePawn headers out of public/ into sourcepawn/include. 2015-03-07 11:13:32 -08: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
c62e7458f9 Disable RTTI for Loader, Logic, and JIT bins 2014-09-11 17:15:59 -07:00
Nicholas Hastings
ad7d920ce0 Move menu natives from core to logic 2014-09-05 08:24:40 -07:00
Nicholas Hastings
17d5af0e2f Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
David Anderson
ec61d4d188 Add a general profiling abstraction layer. 2014-06-24 01:04:13 -07:00
Nicholas Hastings
35784c018d Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
Scott Ehlert
e00e879af5 Use == instead of is operator for checking string equality in AMBuild scripts (bug 6043, r=dvander). 2014-02-09 22:50:20 -06:00
David Anderson
e1a820dcf9 Port simple C++ build scripts to AMBuild 2 (bug 5997 part 1, r=ds). 2013-12-30 17:50:56 -05:00
Nicholas Hastings
1ba6b2653a Move ForwardSys from core to logic (bug 5953, r=fyren).
--HG--
rename : core/ForwardSys.cpp => core/logic/ForwardSys.cpp
rename : core/ForwardSys.h => core/logic/ForwardSys.h
2013-10-09 08:43:08 -04:00
Nicholas Hastings
1d1b5d1c6d Move DBManager and DB natives from core to logic (bug 5953, r=fyren).
--HG--
rename : core/Database.cpp => core/logic/Database.cpp
rename : core/Database.h => core/logic/Database.h
rename : core/sm_simple_prioqueue.h => core/logic/sm_simple_prioqueue.h
rename : core/smn_database.cpp => core/logic/smn_database.cpp
rename : core/sm_queue.h => public/sm_queue.h
2013-10-09 08:43:08 -04:00
Nicholas Hastings
9027d15211 Move ADTFactory from core to logic (bug 5953, r=fyren).
--HG--
rename : core/ADTFactory.cpp => core/logic/ADTFactory.cpp
rename : core/ADTFactory.h => core/logic/ADTFactory.h
2013-10-09 08:43:08 -04:00
David Anderson
de8726ab73 Move ke_ headers to new public/amtl folder.
--HG--
rename : public/sourcepawn/ke_allocator_policies.h => public/amtl/ke_allocator_policies.h
rename : public/sourcepawn/ke_inline_list.h => public/amtl/ke_inline_list.h
rename : public/sourcepawn/ke_thread_posix.h => public/amtl/ke_thread_posix.h
rename : public/sourcepawn/ke_thread_utils.h => public/amtl/ke_thread_utils.h
rename : public/sourcepawn/ke_thread_windows.h => public/amtl/ke_thread_windows.h
rename : public/sourcepawn/ke_utility.h => public/amtl/ke_utility.h
rename : public/sourcepawn/ke_vector.h => public/amtl/ke_vector.h
2013-08-22 16:30:44 -07:00
David Anderson
45856816c1 Rewrite IThreader implementation around new synchronization primitives (bug 5862, r=fyren). 2013-08-19 20:58:02 -07: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
Asher Baker
0f62a8ec2f Generate debugging information during compilation (bug 5227, r=ds). 2013-03-17 21:00:28 +00: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
David Anderson
5f0a55057e Move filesystem natives from Core to Logic (bug 5606, r=psychonic).
--HG--
rename : core/smn_filesystem.cpp => core/logic/smn_filesystem.cpp
2013-02-16 15:52:11 -08:00
Scott Ehlert
0d795fc651 Added support for CS:GO on Mac OS X (bug 5459, r=psychonic). 2012-08-25 11:28:52 -05:00
Asher Baker
5f551fa67a Backed out changeset: 387b27fb575b (bug 5227) 2012-04-14 01:12:24 +01:00
Asher Baker
393c54fdc2 Generate debugging information during compilation. (bug 5227, r=ds) 2012-02-16 19:26:49 +00:00
Scott Ehlert
4c878c4963 Fixed crash in MemoryUtils::ResolveSymbol() on OS X Lion (10.7) (bug 4951, r=dvander). 2011-06-15 16:02:05 -05:00
David Anderson
5b45e29533 Move profile natives to logic, add linux support (bug 4927, r=ds). 2011-05-22 02:04:34 -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
96f6cdf677 Moved datapack natives from core to logic (bug 4406 part 10, r=ds).
--HG--
rename : core/smn_datapacks.cpp => core/logic/smn_datapacks.cpp
2010-05-14 21:16:35 -07:00
David Anderson
c188491289 Moved handle natives from core to logic (bug 4406 part 9, r=ds).
--HG--
rename : core/smn_handles.cpp => core/logic/smn_handles.cpp
2010-05-14 21:06:06 -07:00
David Anderson
85bedca236 Move string natives from logic to core (bug 4406 part 8, r=fyren).
--HG--
rename : core/smn_string.cpp => core/logic/smn_string.cpp
2010-05-14 20:04:44 -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
b5b002aa4b Move banning natives from core to logic (bug 4406 part 3, r=fyren).
--HG--
rename : core/smn_banning.cpp => core/logic/smn_banning.cpp
2010-05-14 18:22:03 -07:00
David Anderson
78f5b513c0 Move admin natives from core to logic (bug 4406 part 2, r=ds).
--HG--
rename : core/smn_admin.cpp => core/logic/smn_admin.cpp
2010-05-14 17:46:19 -07:00
David Anderson
0032fcaa66 Move memutils from core to logic (bug 4406, r=ds).
--HG--
rename : core/MemoryUtils.cpp => core/logic/MemoryUtils.cpp
rename : core/MemoryUtils.h => core/logic/MemoryUtils.h
rename : core/sm_symtable.h => core/logic/sm_symtable.h
2010-05-14 16:14:59 -07:00
David Anderson
28217f10cb Added ProcessTargetString simple filter API (bug 4404, r=ds). 2010-05-13 12:28:51 -07:00
David Anderson
a6ceb337b2 Move timer natives into logic binary (bug 4402, r=ds).
--HG--
rename : core/smn_timers.cpp => core/logic/smn_timers.cpp
2010-05-13 01:47:12 -07:00
David Anderson
94d01e9e5a Moved CRC32 from core to logic (no bug, r=me). 2010-01-18 03:08:52 -08:00
David Anderson
db97c2a5b1 Thanks, Python. 2009-08-30 17:27:44 -07:00
David Anderson
70993256b9 Added -lpthread to sourcemod.logic binary. 2009-08-30 17:26:03 -07:00
David Anderson
d682361cfc More changes for new build system. 2009-08-30 00:46:56 -07:00