mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-23 05:16:05 +00:00
Use JSFastNative API in more places, for improved compatibility with future SpiderMonkey versions.
Remove some unnecessary script-exposed functions, and move some more into the Engine namespace. This was SVN commit r8428.
This commit is contained in:
@@ -29,6 +29,9 @@
|
||||
#include "ScriptTypes.h"
|
||||
#include "ScriptVal.h"
|
||||
|
||||
#include "js/jsapi.h"
|
||||
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/utf16string.h"
|
||||
|
||||
class AutoGCRooter;
|
||||
@@ -40,6 +43,12 @@ namespace boost { class rand48; }
|
||||
// but as large as necessary for all wrapped functions)
|
||||
#define SCRIPT_INTERFACE_MAX_ARGS 6
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define ENABLE_SCRIPT_PROFILING 0
|
||||
#else
|
||||
#define ENABLE_SCRIPT_PROFILING 1
|
||||
#endif
|
||||
|
||||
struct ScriptInterface_impl;
|
||||
class ScriptInterface
|
||||
{
|
||||
@@ -241,7 +250,7 @@ private:
|
||||
static JSClass* GetClass(JSContext* cx, JSObject* obj);
|
||||
static void* GetPrivate(JSContext* cx, JSObject* obj);
|
||||
|
||||
void Register(const char* name, JSNative fptr, size_t nargs);
|
||||
void Register(const char* name, JSFastNative fptr, size_t nargs);
|
||||
std::auto_ptr<ScriptInterface_impl> m;
|
||||
|
||||
// The nasty macro/template bits are split into a separate file so you don't have to look at them
|
||||
@@ -253,10 +262,10 @@ public:
|
||||
// void RegisterFunction(const char* functionName);
|
||||
//
|
||||
// template <R, T0..., TR (*fptr) (void* cbdata, T0...)>
|
||||
// static JSNative call;
|
||||
// static JSFastNative call;
|
||||
//
|
||||
// template <R, T0..., JSClass*, TC, TR (TC:*fptr) (T0...)>
|
||||
// static JSNative callMethod;
|
||||
// static JSFastNative callMethod;
|
||||
//
|
||||
// template <dummy, T0...>
|
||||
// static size_t nargs();
|
||||
|
||||
Reference in New Issue
Block a user