db5d4bb5f1
SpiderMonkey-related changes in preparation for the upgrade to SpiderMonkey 45, refs #4893 .
...
- Remove JSVAL_ZERO and JSVAL_NULL
https://bugzilla.mozilla.org/show_bug.cgi?id=1177825
- Remove *_TO_JSVAL https://bugzilla.mozilla.org/show_bug.cgi?id=1177892
- Drop support for parent object in the deserializer
https://bugzilla.mozilla.org/show_bug.cgi?id=1136345 ,
https://bugzilla.mozilla.org/show_bug.cgi?id=805052
- Correctly use boolean values in JS::RuntimeOptionsRef
- Use JS_FN instead of JS_FS: in future versions, JS_FS is not public
because it isn't supposed to be used in JSAPI code
- Allow to select flags for global objects, and correctly mark progress
bars in the loading screen as not readonly+permanent
- Remove empty JSI_props in IGUIObject
Reviewed By: wraitii, elexis
Differential Revision: https://code.wildfiregames.com/D1716
This was SVN commit r22052.
2019-01-13 16:37:41 +00:00
43a291a071
Simple refactoring of Singleton. Make it non-copyable.
...
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1564
This was SVN commit r22050.
2019-01-13 15:11:40 +00:00
962815c898
Fix build without PCH for some targets.
...
Patch By: Angen
Reviewed By: vladislavbelov
Tested By: Stan, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1361
This was SVN commit r21964.
2018-12-28 14:58:35 +00:00
d6ae354158
Fix mod check of non-visual replays and allow conversion of a vector of vectors of strings via ScriptConversions
...
Reviewed by: elexis
Fixes #5044
Differential Revision: https://code.wildfiregames.com/D1316
This was SVN commit r21603.
2018-03-22 15:26:27 +00:00
89e339dd16
Remove VFS cache, because it is less effective and less efficient than the OS cache (and partially redundant with higher level application caches).
...
Patch By: Sandarac
Discussed with: Philip, echotangoecho, Bezerra
Fixes #4072 .
Differential Revision: https://code.wildfiregames.com/D587
This was SVN commit r20639.
2017-12-10 17:33:03 +00:00
9f0484e5ce
Delete unused SpiderMonkey GarbageCollection ScriptFunctions ForceGC in the AI and GUI context ( e9e05f4efc
) and MaybeGC in the random mapgen context ( 942a45372c
).
...
Optimizing the memory footprint requires likely different functions
following the new SM versions and a lot of testing,
so having these doesn't lower the effort to achieve optimization while
confusing the reader.
Differential Revision: https://code.wildfiregames.com/D1073
Reviewed By: Yves
This was SVN commit r20572.
2017-12-03 12:48:21 +00:00
f7206dc77d
More ScriptInterface const.
...
Reviewed By: elexis; some comments by bb
Differential Revision: https://code.wildfiregames.com/D863
This was SVN commit r20519.
2017-11-25 06:49:58 +00:00
189da09a7e
Make FromJSProperty actually part of ScriptInterface.
...
Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D876
This was SVN commit r20179.
2017-09-12 22:52:15 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
417c84870c
Actually remove trailing tabs from source/.
...
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
6149dd3841
Actually remove trailing whitespace for non-header files as well.
...
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
162535c7b7
Tiny whitespace cleanup.
...
This was SVN commit r18587.
2016-08-07 17:44:27 +00:00
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
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
72ca6c5f80
Style cleanup by leper, preparing the SpiderMonkey update. Refs #3708
...
This was SVN commit r18579.
2016-08-02 16:12:11 +00:00
a4a45e4dc4
Fix compiler warning, thanks to elexis. Refs #4056
...
This was SVN commit r18442.
2016-06-26 16:51:52 +00:00