elexis
de050ef7e2
Remove some unused Profiler.h and CLogger.h includes.
...
NativeWrapperDefns.h from 4e87fef3da , found in audit of 7c21a0cf8e .
Differential Revision: https://code.wildfiregames.com/D2268
Tested on: clang 8.0.1, Jenkins
This was SVN commit r22863.
2019-09-07 13:35:45 +00:00
elexis
afaa4417e4
Add ScriptInterface::AssignOrToJSVal<JS::Heap<JS::Value> > to support ScriptInterface::SetGlobal, SetProperty, CreateObject with JS::Heap values.
...
Differential Revision: https://code.wildfiregames.com/D2263
Tested on: gcc 9.1.0, Jenkins
Refs D2264
This was SVN commit r22853.
2019-09-05 16:45:16 +00:00
elexis
d5c1fd09a4
Add ToJSVal<CRect> to make the conversion reusable, remove unused PSERROR_Scripting_ConversionFailed and dead catch.
...
Avoids the CRect copy or stops relying on optimization to avoid the
copy.
Split from D2142.
Differential Revision: https://code.wildfiregames.com/D2259
Tested on: gcc 9.1.0, Jenkins
This was SVN commit r22847.
2019-09-04 16:15:37 +00:00
elexis
742f361b2d
Improve performance of ScriptInterface::CreateObject from b4626359f5 / D2080 by creating the JSAutoRequest struct only once instead of once per property.
...
Differential Revision: https://code.wildfiregames.com/D2127
Comments By: Vladislav
This was SVN commit r22680.
2019-08-17 03:30:07 +00:00
elexis
64e80471d0
Replace JS_THIS_OBJECT and JS::CallReceiver in preparation for SpiderMonkey 49 and 61.
...
Differential Revision: https://code.wildfiregames.com/D2173
Refs #4893 , D1699, D2142, D844, 7c2e9027c2 , ...
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1270977
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1255800
Tested on: clang 8, VS2015, Jenkins
This was SVN commit r22661.
2019-08-13 14:11:43 +00:00
Itms
9325992232
Revert use of the isRunOnce flag after removal in 64b477625d of compile'n go, refs #4893 .
...
This breaked a SM assertion, which was only caught in debug mode. It
could have led to subtle bugs during the compilation of JS scripts.
Still set the flag to its default value, because SM devs wanted to
change the default in the future.
This was SVN commit r22629.
2019-08-08 09:05:42 +00:00
Itms
64b477625d
Upgrade SpiderMonkey to version 45.0.2, refs #4893 .
...
- Various build changes, in particular NSPR is not needed on Unix
anymore
- Add js/Initialization.h to source/scriptinterface/ScriptEngine.h
- Use nullptr instead of JS::NullPtr(), see
https://bugzilla.mozilla.org/show_bug.cgi?id=1164602
- Remove `JS::RuntimeOptionsRef.varObjFix`, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1171177
- Remove uses of `AutoIdArray`, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1191529
- `JS_InternUCStringN` has been renamed, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1178581
- `JS::Evaluate` now takes scope chains explicitly, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1097987
- Array functions (such as `JS_IsArrayObject`) are fallible and output
to params, see https://bugzilla.mozilla.org/show_bug.cgi?id=f3d35d8
- Remove `JSCLASS_CACHED_PROTO_WIDTH` workaround in our code, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1236373
- Remove compile'n go (`setCompileAndGo`) and replace it by
`setIsRunOnce` which will become the default in the future, see
https://bugzilla.mozilla.org/show_bug.cgi?id=679939
- Mark shared memory in direct access operations
(`JS_GetUint16ArrayData` and `JS_GetUint8ArrayData`), see
https://bugzilla.mozilla.org/show_bug.cgi?id=1176214
- Use new `JS::ObjectOpResult`, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1113369
Thanks to wraitii, elexis, Krinkle and historic_bruno for contributions
and comments, and to gentz, madpilot, s0600204 and Stan for testing and
indirect contributions.
Differential Revision: https://code.wildfiregames.com/D1510
This was SVN commit r22627.
2019-08-07 22:37:43 +00:00
elexis
eb20fe3626
Replace ScriptInterface ErrorReporter layered hack from 5e15a0279e with proper code, refs f6c1d98c9a.
...
Avoids preparation for the SpiderMonkey 45 update, refs #4893 / D1510 .
Add JSAutoRequest missing from 5e15a0279e too.
Differential Revision: https://code.wildfiregames.com/D2152
Reviewed By: Itms
This was SVN commit r22622.
2019-08-06 22:13:06 +00:00
elexis
d6b93b3be6
Add missing CPos FromJSVal, ToJSVal following 659a9ea57a.
...
This was SVN commit r22573.
2019-07-29 11:56:11 +00:00
elexis
52d58d9845
Wipe MaybeGC/ForceGC declaration leftover from 9f0484e5ce / D1073.
...
This was SVN commit r22555.
2019-07-26 12:41:22 +00:00
elexis
b4626359f5
Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later.
...
Differential Revision: https://code.wildfiregames.com/D2080
Previous version reviewed By: Krinkle
Comments By: historic_bruno, wraitii
This was SVN commit r22528.
2019-07-22 19:35:14 +00:00
Itms
cca7627d88
Improvements to simulation hotloading before the SM upgrade, refs #4893 .
...
SM45 will enforce property attributes described at
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/Property_attributes .
We thus cannot hotload properties with the DontDelete attribute.
Fix an oversight in the hotloading code.
Rename a confusing parameter.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1844
This was SVN commit r22516.
2019-07-19 21:58:58 +00:00
Itms
6230bbea24
Update of the scripting tests. Test some modding features and update JS::Value integer limits.
...
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1850
This was SVN commit r22513.
2019-07-19 15:41:27 +00:00
elexis
65b02395b3
Remove Vector2D/Vector3D prototype workaround from EngineScriptConversions.
...
Fixes #5376 , refs #2394 .
Differential Revision: https://code.wildfiregames.com/D1991
Patch By: Krinkle
Comments By: Vladislav, wraitii
This was SVN commit r22487.
2019-07-16 21:52:49 +00:00
Itms
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
vladislavbelov
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
vladislavbelov
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
Imarok
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
elexis
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
elexis
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
leper
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
leper
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
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
leper
2ec4d87abf
Use .assign instead of operator=.
...
This was SVN commit r17634.
2016-01-11 20:57:03 +00:00
leper
39eb7fb243
Fix JS_SetGCZeal call.
...
https://bugzilla.mozilla.org/show_bug.cgi?id=650978
https://bugzilla.mozilla.org/show_bug.cgi?id=742570
This was SVN commit r17632.
2016-01-11 20:03:31 +00:00
leper
775f856421
Use .assign instead of operator=.
...
This was SVN commit r17631.
2016-01-11 20:03:28 +00:00
leper
d08044c8ad
JS_DumpHeap is removed in SpiderMonkey 38, since we have nothing using it remove it. Refs #3708 .
...
https://bugzilla.mozilla.org/show_bug.cgi?id=1105069
https://bugzilla.mozilla.org/show_bug.cgi?id=1122842
This was SVN commit r17630.
2016-01-11 20:03:09 +00:00
leper
785acdb1c6
Fix test failure on Windows.
...
This was SVN commit r17629.
2016-01-11 20:03:01 +00:00
leper
b18cd3254c
Test FixedVector{2,3}D script conversions, and test calling functions of the prototypes.
...
Also ENSURE that the given value identifier is actually present in the
cache instead of creating one if it is not.
This was SVN commit r17603.
2016-01-04 21:41:40 +00:00
leper
d5d60d53ed
Replace JS_ASSERT (which is renamed to MOZ_ASSERT in SpiderMonkey 38) with TS_ASSERT, since the former was used for no apparent reason.
...
This was SVN commit r17588.
2016-01-01 21:28:25 +00:00
leper
6970ebba16
Test non-ASCII string conversions.
...
This was SVN commit r17535.
2015-12-22 17:30:05 +00:00
leper
848efb56b3
Make a method const.
...
This was SVN commit r17527.
2015-12-22 14:08:32 +00:00
leper
509028d738
CompileOptions::setFileAndLine does not copy the string, so create a copy for it.
...
This was SVN commit r17512.
2015-12-19 02:55:30 +00:00
leper
190f9176df
SpiderMonkey 38 removes JS_NewPropertyIterator, use JS_Enumerate instead.
...
https://bugzilla.mozilla.org/show_bug.cgi?id=1081660
This was SVN commit r17510.
2015-12-19 02:21:22 +00:00
leper
753936e7df
SpiderMonkey 38 removes JS_Evaluate{,UC}Script, use JS::Evaluate.
...
https://bugzilla.mozilla.org/show_bug.cgi?id=1100579
This was SVN commit r17508.
2015-12-19 01:58:03 +00:00
leper
2239fe338c
The jschar typedef is removed in SpiderMonkey 38.
...
Since it already is char16_t in 31 replace it by that.
https://bugzilla.mozilla.org/show_bug.cgi?id=1063962
This was SVN commit r17506.
2015-12-19 01:29:55 +00:00
leper
8bfe16cac8
Use in-place construction.
...
This was SVN commit r16894.
2015-07-29 23:44:17 +00:00
leper
c5eb9b7bb7
Range-based for for VfsPath loops.
...
This was SVN commit r16893.
2015-07-29 23:44:12 +00:00
leper
5a0b9b0e70
Fix some issues found by static analysis (clang-analyzer and cppcheck).
...
This was SVN commit r16801.
2015-06-21 18:46:31 +00:00
historic_bruno
4af117434d
Fixes clang unused parameter warning
...
This was SVN commit r16770.
2015-06-14 23:45:15 +00:00
leper
c93c1c92eb
Replace std::auto_ptr uses by std::unique_ptr since the former is deprecated.
...
This was SVN commit r16674.
2015-05-25 01:23:27 +00:00
historic_bruno
1ac24adde2
Disables some SpiderMonkey-related build warnings with clang
...
This was SVN commit r16379.
2015-02-22 21:15:47 +00:00
Ykkrosh
bb9de80dd4
Convert CConsole to take UTF-8 strings.
...
This avoids vswprintf failures when printing non-ASCII char* strings
from CLogger into the console.
Also convert ScriptInterface::ToString to return UTF-8, to avoid some
utf8_from_wstring calls.
Also remove some unused and redundant CConsole functions.
This was SVN commit r16333.
2015-02-14 01:49:34 +00:00
Ykkrosh
e06a7b37d8
Convert debug_printf to take UTF-8 strings instead of wchar_t.
...
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.
Fixes #3021 .
This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
scythetwirler
5e7b55996c
Fixes build with libmozjs-31-dev package from Ubuntu PPA. Fixes #3039 .
...
This was SVN commit r16283.
2015-02-07 18:28:44 +00:00
fabio
0a34e6106d
Improve readability printing a single error message.
...
This was SVN commit r16237.
2015-01-27 09:14:30 +00:00
leper
4c1903500b
Switch to std::shared_ptr and std::weak_ptr.
...
This was SVN commit r16227.
2015-01-25 03:10:58 +00:00
leper
fc902df07c
Remove checks for unsupported GCC versions (<4.6).
...
This was SVN commit r16224.
2015-01-24 20:37:07 +00:00
Yves
15e8637b67
Fix build with Visual Studio
...
I've reverted this workaround before the SM31 commit because I thought
it's only a problem with VS2010. Actually VS2013 still doesn't support
C++11 well enough and still requires the workaround.
Refs #2669 , #2462
This was SVN commit r16215.
2015-01-24 16:33:27 +00:00
Yves
c02a7e1a7b
SpiderMonkey 31 upgrade
...
This upgrade also introduces exact stack rooting (see to the wiki:
JSRootingGuide) and fixes problems with moving GC. This allows us to
enable generational garbage collection (GGC).
Measurements a few months ago have shown a performance improvement of a
non-visual replay of around 13.5%. This probably varies quite a bit, but
it should be somewhere between 5-20%. Memory usage has also been
improved. Check the forum thread for details.
Thanks to everyone from the team who helped with this directly or
indirectly (review, finding and fixing issues, the required C++11
upgrade, the new autobuilder etc.)! Also thanks to the SpiderMonkey
developers who helped on the #jsapi channel or elsewhere!
Fixes #2462 , #2415 , #2428 , #2684 , #1374
Refs #2973 , #2669
This was SVN commit r16214.
2015-01-24 14:46:52 +00:00
Ykkrosh
f350a24c73
Disable "assignment operator could not be generated" warning globally on Windows, since it's never useful.
...
This was SVN commit r16192.
2015-01-22 21:09:33 +00:00