elexis
e95f4e9744
Unify deepcopy and clone.
...
Delete clone globalscripts function introduced by 9f47ed536d .
Rename the better supported deepcopy function to clone.
Delete unused Vector2D and Vector3D clone prototype functions that can
just use clone if needed.
Differential Revision: https://code.wildfiregames.com/D870
Reviewed By: leper
This was SVN commit r20125.
2017-09-06 20:58:27 +00:00
elexis
1b47451d32
Add deepfreeze function to recursively mark JS Objects as read-only.
...
Refs #4257 , D829
Proofread By: leper
This was SVN commit r20099.
2017-09-03 12:50:45 +00:00
elexis
1b44946078
Replace deprecated jsval with JS::Value.
...
Remove unused SGUIBaseSettings and GUI comment.
Fix indentation of a macro, refs D794.
Differential Revision: https://code.wildfiregames.com/D838
Review by: leper.
Itms came up with the same patch for the SpiderMonkey 45 update
independently.
This was SVN commit r20062.
2017-08-28 10:27:36 +00:00
leper
9defd11440
Pass ScriptInterface as a const ref where possible.
...
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
leper
7d6bfe27ab
Clean up FromJSProperty a little. Patch by Vladislav.
...
Differential Revision: https://code.wildfiregames.com/D399
This was SVN commit r19489.
2017-05-01 00:58:35 +00:00
elexis
ce5c10c7bb
Add FromJSProperty helper function that gets the property of a JS object, thus reducing duplicate checks when getting many properties.
...
Differential Revision: https://code.wildfiregames.com/D338
Patch By: Vladislav
Refs: https://code.wildfiregames.com/D317
This was SVN commit r19421.
2017-04-16 23:59:20 +00:00
elexis
1e07787e76
Revert 64bit number conversions added in c0ca70efd2, don't add the previous long and unsigned long conversions back and use double in the Replay menu.
...
64bit conversions (including the long ones) are not safe, because not
every number can be converted to the 2^53 JS numbers and pretending to
do so is asking for bugs.
Explicitly use the double type in the Replay menu, because std::time_t
is unspecified and some platforms like Ubuntu yakkety:i386 fail to
build, looking for long.
Double should work for the next 285 million years, becomes consistent
with SavedGame.cpp, is tested by test_ScriptConversions.cpp and doesn't
pretend to cover all 64bit numbers.
Patch By: echotangoecho
Differential Revision: https://code.wildfiregames.com/D205
Refs #3848 D84 D112
This was SVN commit r19367.
2017-04-01 21:06:55 +00:00
leper
3648ba448d
Some const for scriptinterface.
...
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D155
This was SVN commit r19339.
2017-03-24 18:47:03 +00:00
Itms
c0ca70efd2
Fix 64-bit integer script conversions by removing the discrepancy between Windows and Linux.
...
Patch by echotangoecho, fixes #3848 .
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D84
This was SVN commit r19189.
2017-01-30 10:21:08 +00:00
leper
6ae2db53db
Employ some variadic macros to make some of the C++ -> JS function calling code nicer.
...
Template-ize CallFunctionVoid.
Changes CallFunction parameter order to make template parameter
deduction with
variadic parameters work nicely.
Reviewed By: Itms, wraitii, Yves
Differential Revision: https://code.wildfiregames.com/D77
This was SVN commit r19183.
2017-01-28 23:37:15 +00:00
leper
be1a205f91
Add support for const methods in components and make those that can be const const.
...
Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D75
This was SVN commit r19156.
2017-01-20 02:25:19 +00:00
wraitii
2bae30c454
Fix [19027] by using generic code for conversions and fixing a few other issues. Refs #3403 . Reviewed by leper.
...
Also fix some of the warnings that jenkins showed.
Differential Revision: https://code.wildfiregames.com/D24
This was SVN commit r19115.
2017-01-06 11:14:03 +00:00
elexis
417c84870c
Actually remove trailing tabs from source/.
...
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
elexis
6149dd3841
Actually remove trailing whitespace for non-header files as well.
...
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
elexis
b18f74da44
Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
...
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
Itms
172c222e9b
Fix a possible source of segmentation fault in our custom version of ObjectIdCache.
...
Patch by echotangoecho, refs #4053
This was SVN commit r18757.
2016-09-24 13:48:11 +00:00
Itms
0cc23c1964
SpiderMonkey 38 upgrade: 33/35
...
Remove a workaround. Note that this removal is incomplete. Based on
patch by leper.
This was SVN commit r18687.
2016-09-02 16:53:22 +00:00
Itms
9b794593db
SpiderMonkey 38 upgrade: 32/35
...
JS_GetStringCharsAndLength was removed, use
JS_Get{Latin1,TwoByte}StringCharsAndLength instead.
Actually handle strings in both the Latin1 and TwoByte cases since we
need to.
This saves some space when serializing and also when running as they are
stored that way in the vm.
Also handle the error case.
Patch by leper.
For more information:
https://blog.mozilla.org/javascript/2014/07/21/slimmer-and-faster-javascript-strings-in-firefox/
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1037869
This was SVN commit r18686.
2016-09-02 16:51:09 +00:00
Itms
72ec5d9767
SpiderMonkey 38 upgrade: 31/35
...
Remove workaround for crash when using multiple ctxts per runtime, this
was fixed upstream. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=890243 and
https://bugzilla.mozilla.org/show_bug.cgi?id=905926
This was SVN commit r18685.
2016-09-02 16:50:07 +00:00
Itms
f06eb5536b
SpiderMonkey 38 upgrade: 30/35
...
Upstream added a compartment option to preserve JIT code during
non-shrinking GCs, so use it. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1068697
This was SVN commit r18684.
2016-09-02 16:48:41 +00:00
Itms
27c434e2bd
SpiderMonkey 38 upgrade: 29/35
...
We now have better error messages, so fix the tests to account for that.
Patch by leper.
This was SVN commit r18683.
2016-09-02 16:47:33 +00:00
Itms
fe52bf0457
SpiderMonkey 38 upgrade: 28/35
...
The GC API changed to have explicit start and step methods, and the
start/shrink cases now take the gc kind as a parameter. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1099152
This was SVN commit r18682.
2016-09-02 16:46:39 +00:00
Itms
80c8c2c3d6
SpiderMonkey 38 upgrade: 27/35
...
JS_NewRuntime had the useHelperThreads param removed and a
maxNurseryBytes param added. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=941805 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1034621
This was SVN commit r18681.
2016-09-02 16:45:45 +00:00
Itms
58cace1156
SpiderMonkey 38 upgrade: 26/35
...
JS_Define{,UC}Property{,ById} has the attrs parameter moved in front of
the getter and setter params. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=959787
https://bugzilla.mozilla.org/show_bug.cgi?id=1088002 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1211607
This was SVN commit r18680.
2016-09-02 16:44:33 +00:00
Itms
99534a15f1
SpiderMonkey 38 upgrade: 25/35
...
Remove the proto parameter from JS_DefineObject. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1127494
This was SVN commit r18679.
2016-09-02 16:41:36 +00:00
Itms
c396155ad8
SpiderMonkey 38 upgrade: 22/35
...
Parallel compilation was renamed to Offthread compilation. Patch by
leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1020364
This was SVN commit r18676.
2016-09-02 16:37:35 +00:00
Itms
f77441fb10
SpiderMonkey 38 upgrade: 20/35
...
Some options have been moved from ctxt to runtime. Patch by leper.
This was SVN commit r18674.
2016-09-02 16:35:58 +00:00
Itms
8f7ba9acf8
SpiderMonkey 38 upgrade: 18/35
...
JS_SetErrorReporter now takes a JSRuntime instead of a JSContext. Patch
by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=981198
This was SVN commit r18673.
2016-09-02 16:35:03 +00:00
Itms
2aa75a05d4
SpiderMonkey 38 upgrade: 18/35
...
Renamed JS_Compile{,UC}Function to JS::CompileFunction. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1089026
This was SVN commit r18672.
2016-09-02 16:34:02 +00:00
Itms
c06eda0209
SpiderMonkey 38 upgrade: 16/35
...
JS_GetTypeName was removed from the API, but we asked upstream to add it
back (https://bugzilla.mozilla.org/show_bug.cgi?id=1037718 ).
This was SVN commit r18670.
2016-09-02 16:32:26 +00:00
Itms
c3710c9632
SpiderMonkey 38 upgrade: 14/35
...
JS_NewObject has no parent or proto arg anymore, use
JS_NewObjectWithGivenProto instead. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1136906
https://bugzilla.mozilla.org/show_bug.cgi?id=1127443 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1136345
This was SVN commit r18668.
2016-09-02 16:29:21 +00:00
Itms
8d15411abf
SpiderMonkey 38 upgrade: 13/35
...
Update JS_NewObject to JS_NewPlainObject, with new parameters. Patch by
leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1136906 and
https://bugzilla.mozilla.org/show_bug.cgi?id=1125356
This was SVN commit r18667.
2016-09-02 16:28:17 +00:00
Itms
c99ae7ca1c
SpiderMonkey 38 upgrade: 12/35
...
Major update to the JSClass stubs. Based on patch by leper.
https://bugzilla.mozilla.org/show_bug.cgi?id=1103152
This was SVN commit r18666.
2016-09-02 16:26:54 +00:00
Itms
c7c3ef9f92
SpiderMonkey 38 upgrade: 09/35
...
Use .toFoo() instead of JSVAL_TO_FOO. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=952650
This was SVN commit r18663.
2016-09-02 16:23:44 +00:00
Itms
1223efcef8
SpiderMonkey 38 upgrade: 08/35
...
Update ObjectToIDMap to the ESR38 version and use the unbarriered
tracers. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=1052388
This was SVN commit r18662.
2016-09-02 16:22:42 +00:00
Itms
548601b2d8
SpiderMonkey 38 upgrade: 07/35
...
Use operator[] instead of handleAt. Patch by leper.
Addresses https://bugzilla.mozilla.org/show_bug.cgi?id=972385
This was SVN commit r18661.
2016-09-02 16:21:03 +00:00
Itms
4b028508ae
SpiderMonkey 38 upgrade: 06/35
...
Check for the new SpiderMonkey version.
This was SVN commit r18660.
2016-09-02 16:19:31 +00:00
Itms
162535c7b7
Tiny whitespace cleanup.
...
This was SVN commit r18587.
2016-08-07 17:44:27 +00:00
Yves
9e4f0cc543
Properly shut down SpiderMonkey using JS_ShutDown.
...
This also adds some validation to ensure the correct order of JS_Init,
JS_NewRuntime, JS_DestroyRuntime and JS_ShutDown calls.
Refs #3708
This was SVN commit r18584.
2016-08-06 15:41:59 +00:00
Itms
4e87fef3da
The old debug API has been removed in SpiderMonkey 38, so remove profiler1 script profiling.
...
Patch by leper, refs #3708
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1069694
This was SVN commit r18580.
2016-08-02 16:58:30 +00:00
Itms
72ca6c5f80
Style cleanup by leper, preparing the SpiderMonkey update. Refs #3708
...
This was SVN commit r18579.
2016-08-02 16:12:11 +00:00
wraitii
a4a45e4dc4
Fix compiler warning, thanks to elexis. Refs #4056
...
This was SVN commit r18442.
2016-06-26 16:51:52 +00:00
wraitii
898ab5229b
Change profiling calls to get a better view of what is actually slow and what is not.
...
This was SVN commit r18438.
2016-06-25 13:12:35 +00:00
wraitii
3cbe96d24c
Revamp Profiler2 to make it more usable.
...
Features include new graphs to compare runtime of functions and runtimes
across reports, as well as new profiling functions that only profile
spikes.
This was SVN commit r18423.
2016-06-22 13:38:05 +00:00
wraitii
7c21a0cf8e
Header cleanup: profile.h is no longer unnecessarily included in scriptinterface.h but rather in the required .cpp files
...
This was SVN commit r18417.
2016-06-21 10:33:11 +00:00
fabio
2a830fdb6a
Support building with mozjs 31.5 used in Ubuntu PPA.
...
Fixes #3039 .
This was SVN commit r18153.
2016-05-10 09:02:58 +00:00
Yves
199d38dfec
Work around clang bug to fix compiling.
...
This was SVN commit r17703.
2016-01-24 10:34:38 +00:00
Yves
1a66f510d0
Use const T& for parameters of some types in script-exposed native functions
...
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.
This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
Yves
5f86beea6f
Replace HandleWrapper and avoid repoint function
...
JS::Handle<T>::repoint gets removed with SpiderMonkey 38, so the
existing solution has to be replaced. The new approach should also be a
bit clearer. Named Return Value Optimization (NRVO) should avoid a
superfluous temporary for the return value in the generic template
function implementation of AssignOrFromJSVal.
Refs #3708
This was SVN commit r17695.
2016-01-23 14:42:59 +00:00
leper
cfb2216b8c
Remove JSDebugger. Closes #2419 , #2973 . Refs #410 , #2348 , #3708 .
...
https://bugzilla.mozilla.org/show_bug.cgi?id=1069694
This was SVN commit r17655.
2016-01-17 00:34:33 +00:00