Commit Graph

253 Commits

Author SHA1 Message Date
Asher Baker
f7c6fc9d1f Restore check_thunks error message. 2015-05-07 21:53:38 +01:00
David Anderson
eaea3c927d Update upstream AMTL as a submodule. 2015-03-08 00:24:03 -08:00
David Anderson
1d313e3120 Move macro assembler out of public/assembler into sourcepawn/vm/x86. 2015-03-07 11:16:37 -08:00
David Anderson
561004c4bf Move SourcePawn headers out of public/ into sourcepawn/include. 2015-03-07 11:13:32 -08:00
Nicholas Hastings
2d53547e03 Merge pull request #289 from alliedmodders/more-ninvoke-killing
Remove references to INativeInvoker.h from extension boilerplate.
2015-03-06 07:37:46 -05:00
Nicholas Hastings
6f8ffd55a7 Merge pull request #263 from alliedmodders/admins-trans
Update admins.inc with methodmaps, newdecls (r=dvander, asherkin).
2015-03-05 14:32:15 -05:00
Nicholas Hastings
96703c247c Remove references to INativeInvoker.h from extension boilerplate. 2015-03-05 10:59:19 -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
David Anderson
04827466b0 Rewrite the .smx parser.
This removes one the last remnants of the SourceMod 1.0 VM implementation.

The new parser introduces a number of design changes in the VM. First, the VM now takes greater responsibility for validating and sanity checking the structure of the SMX container format. Previously, malformed SMX files could easily crash SourcePawn. The loader now rejects files that have out-of-bounds offsets or incomplete sections. Complex sections, like debug info or the code stream, are verified lazily.

Internally, the sp_plugin_t structure has been removed. It has been replaced by a new LegacyImage class, designed to be independent from the SPVM API. This potentially lets us load code streams from non-.smx containers. More importantly, it removes a lot of bookkeeping and pre-computed state from PluginRuntime. The LegacyImage class is now responsible for handling debug info as well.

PluginRuntime is now intended to hold only cached or immutable data, and PluginContext holds all VM state. As such PluginContext is now responsible for allocating a plugin's runtime memory, not PluginRuntime.

Finally, some aspects of the loading process have been cleaned up. The
decompression and image handoff logic should now be easier to
understand.
2015-02-25 22:28:10 -08:00
David Anderson
fcaa5361c8 Don't expose mutable sp_native_t. 2015-02-24 23:10:18 -08:00
David Anderson
21f5400d9c Remove ICompilationData. 2015-02-24 02:03:57 -08:00
David Anderson
499f7b3929 Refactor the public API entrypoint for SourcePawn. 2015-02-24 01:52:13 -08:00
Developer
94c439e533 Updated Visual Studio sample_ext files 2015-02-18 10:34:38 +01:00
Nicholas Hastings
67e74581cc Make result ptr in IForward::Execute default to NULL (which is allowed). 2015-02-17 06:43:07 -08:00
Ruben Gonzalez
213e7ced8c Initial CSGO GetWeaponPrice fixes 2015-01-31 12:44:18 -05:00
Kyle Sanderson
37d9867c06 Merge pull request #129 from KyleSanderson/SDKDep
Enable SDK independence with MM:S enabled extensions.
2015-01-20 17:22:04 -08:00
Asher Baker
c28426a09f Fix threads leaking if they're not joined. (bug 3460, r=dvander) 2015-01-06 20:29:47 +00:00
Ryan Stecker
679b2863fa Update manual builds to use version 1.8.0 2014-12-18 18:18:55 -06:00
Asher Baker
686cf9c5ba Use GCC builtins for bsr/bsf where available. 2014-11-09 04:15:49 +00:00
Nicholas Hastings
96fbb7ecda Unify Player::GetSteamXId returns, clarify doc, and fix checks 2014-09-09 17:57:54 -07:00
Nicholas Hastings
775a35c5ab Update OnClientAuthorized function doc 2014-09-09 17:56:29 -07:00
Nicholas Hastings
a597277a64 Merge pull request #153 from alliedmodders/auth-fixups
More auth fixups for Steam auth (bug 6243, r=asherkin).
2014-09-09 16:24:57 -04:00
Nicholas Hastings
ad7d920ce0 Move menu natives from core to logic 2014-09-05 08:24:40 -07:00
Nicholas Hastings
1bf4eb80bd Cache Steam ID and rendered forms when caching networkID 2014-09-04 16:14:34 -07:00
Nicholas Hastings
f1dc24c089 Move Steam2/3 id rendering logic to CPlayer 2014-09-04 15:27:44 -07:00
David Anderson
a00adaf9fb Sync with AMTL one last time. 2014-09-03 22:05:10 -07:00
David Anderson
8686957dee Final sync of AMTL. 2014-09-03 21:48:48 -07:00
David Anderson
e6e90fb8b8 Sync am-string. 2014-09-03 21:45:44 -07:00
David Anderson
6068d341c8 Sync am-hashmap. 2014-09-03 21:44:51 -07:00
David Anderson
105cd27d19 Sync am-utility.h from upstream. 2014-09-03 21:40:03 -07:00
David Anderson
e608057304 Sync a change from AMTL. 2014-09-03 21:31:06 -07:00
Nicholas Hastings
7f3656215b Consistency Fixes (ID->Id, AuthString->AuthId) 2014-09-03 15:13:30 -07:00
Nicholas Hastings
8c89b72fbc Expose explicit client auth string formats 2014-09-02 14:40:39 -07:00
David Anderson
9267d0c803 Eliminate Newborn/NoAddRef (bug 5907, r=ds). 2014-08-22 22:50:25 -07:00
David Anderson
225954a27c Modernize the smx headers. 2014-08-21 22:16:07 -07:00
Kyle Sanderson
766b6e1770 Merge pull request #127 from alliedmodders/coremapend
Add OnCoreMapEnd to extension's interface.
2014-08-15 20:48:59 -07:00
David Anderson
4b8e26463a Merge pull request #122 from peace-maker/datapack_funcpointer
Add WritePackFunction and ReadPackFunction natives
2014-08-12 10:33:27 -07:00
Kyle Sanderson
901890e36d Eliminate SDK dependence for MM:S enabled extensions. 2014-08-09 14:42:38 -07:00
Ryan Stecker
0bde28cc17 Add a command to dump profiling output. 2014-08-09 13:32:05 -05:00
Ruben Gonzalez
2ba0b794ea Added note to know what version OnCoreMapEnd was added to. 2014-08-08 10:57:38 -04:00
Ruben Gonzalez
7a88386568 Add OnCoreMapEnd to extension's interface. 2014-08-08 01:01:47 -04:00
Peace-Maker
bfcfbbe107 Add WritePackFunction and ReadPackFunction natives
Adds type safety to CDataPack. Cells can't be read as Float anymore. Now
you're able to store a function pointer in a datapack and be sure the
pointer can't be read as a cell and a cell can't be read as a function
pointer.
2014-08-04 02:05:25 +02:00
Ryan Stecker
226c0a456d Update version for manual builds of the 1.7 branch. 2014-07-09 11:03:02 -05:00
David Anderson
f9defa7b37 Remove JIT registration API; this needs more time. 2014-06-24 20:44:30 -07:00
David Anderson
fac52a2897 Fill out API more. 2014-06-24 01:18:16 -07:00
David Anderson
ec61d4d188 Add a general profiling abstraction layer. 2014-06-24 01:04:13 -07:00
Nicholas Hastings
4a75be1c92 Fix KE_OVERRIDE typo in amtl (already fixed upstream). 2014-06-19 20:58:26 -04:00
Nicholas Hastings
35784c018d Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
Nicholas Hastings
dbc881143b Move many player natives from core to logic. 2014-05-28 23:20:41 -04:00
Kyle Sanderson
556d5e0949 Merge pull request #9 from KyleSanderson/amtlutilloudness
Quell isNaN MSVC performance warning.
2014-05-28 18:12:32 -07:00