Yves Posted June 7, 2013 Author Report Share Posted June 7, 2013 @fabioThanks for updating the GamePerformance wiki page.I didn't know they already have a page for Spidermonkey24. I found a good description of the issues with changed integer types and conflicts with our typedefs/defines there. http://whereswalden....mes-to-mozilla/ok, I checked my fixes for this upgrade into main trunk. It just makes things so much easier. I did incorporate the suggestions you made on the first batch.Thanks. Quote Link to comment Share on other sites More sharing options...
Flamadeck Posted June 16, 2013 Report Share Posted June 16, 2013 (edited) Here is some very interesting approach to improving performance:http://www.reddit.co...uce_nearnative/Achieving near native performance with Javascript. Edited June 18, 2013 by Flamadeck Quote Link to comment Share on other sites More sharing options...
abral Posted June 16, 2013 Report Share Posted June 16, 2013 The new Mozilla's JS engine, IonMonkey, brought a lot of performance improvements, and it only landed in Firefox 18. So most probably v22 would be a lot faster than v17.But, if you could use v24 it would be even better, as the performance is improving from release to release, and v24 contains also OdinMonkey (asm.js) that you could use in some cases (for example for the AI, instead of moving code to C++, you could use asm.js so that the code would be a lot faster and there wouldn't be any performance penalty caused by JS-C++ calls). 2 Quote Link to comment Share on other sites More sharing options...
Yves Posted June 21, 2013 Author Report Share Posted June 21, 2013 The good news is that my working copy is now ready for Spidermonkey 24!The bad news is that it performs even worse than Firefox 17 and much worse than 1.8.5.On the other hand the good news is that it seems very unlikely that Spidermonkey 24 with all the new improvements like Ion-Monkey and the new Baseline compiler can really be slower than the old 1.8.5 from Firefox 4. I still hope there's a "--make-everything-fast" switch or something .I've already tested the jemalloc switch because of all the memory performance discussions. I don't know what it actually does or if it works but there's no visible difference.... some hard work for this weekend. Quote Link to comment Share on other sites More sharing options...
scroogie Posted June 22, 2013 Report Share Posted June 22, 2013 Haha, every release gets slower. Crazy. Quote Link to comment Share on other sites More sharing options...
wraitii Posted June 22, 2013 Report Share Posted June 22, 2013 Generally speaking, this is a fairly surprising turn of events Quote Link to comment Share on other sites More sharing options...
Yves Posted June 22, 2013 Author Report Share Posted June 22, 2013 I also tested alpine lakes random map generation../pyrogenesis -autostart=alpine_lakes -autostart-random=123 -autostart-size=256TIMER| Load RMS: 253.25 sIt was between 35 and 37 seconds for 1.8.5 and 17.Someone on the #jsapi channel suggested setting the IONFLAGS environment variable and running a debug build.I think that was quite a good suggestion:./pyrogenesis_dbg -autostart=alpine_lakes -autostart-random=123 -autostart-size=256Cache: 500 (total: 3952) MiBTIMER| InitVfs: 687.686 usTIMER| CONFIG_Init: 12.1607 msWARNING: JavaScript warning: reference to undefined property options.weekdayWARNING: JavaScript warning: reference to undefined property options.hour12[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of hwdetect/hwdetect.js:120[Abort] Disabling Ion mode 0 compilation of script hwdetect/hwdetect.js:120TIMER| RunHardwareDetection: 273.778 msTIMER| write_sys_info: 16.5116 msWARNING: JavaScript warning: reference to undefined property options.weekdayWARNING: JavaScript warning: reference to undefined property options.hour12TIMER| InitRenderer: 2.65053 msWARNING: JavaScript warning: reference to undefined property options.weekdayWARNING: JavaScript warning: reference to undefined property options.hour12WARNING: loading timer component[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/helpers/FSM.js:161[Abort] Disabling Ion mode 0 compilation of script simulation/helpers/FSM.js:161[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyTemplateManager.js:17[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyTemplateManager.js:17WARNING: JavaScript warning: reference to undefined property options.weekdayWARNING: JavaScript warning: reference to undefined property options.hour12[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:94[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:94[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-goWARNING: JavaScript warning: simulation/components/TechnologyManager.js line 123reference to undefined property template.requirements[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:127[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:127[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:63[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:63[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:21[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:21[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:77[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:77[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:100[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:100[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/TechnologyManager.js:401[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:401[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/EntityLimits.js:41[Abort] Disabling Ion mode 0 compilation of script simulation/components/EntityLimits.js:41WARNING: JavaScript warning: simulation/components/Player.js line 333reference to undefined property this.diplomacy[idx]WARNING: JavaScript warning: simulation/components/Player.js line 426reference to undefined property this.diplomacy[id][Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/PlayerManager.js:34[Abort] Disabling Ion mode 0 compilation of script simulation/components/PlayerManager.js:34[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/PlayerManager.js:23[Abort] Disabling Ion mode 0 compilation of script simulation/components/PlayerManager.js:23[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/Player.js:348[Abort] Disabling Ion mode 0 compilation of script simulation/components/Player.js:348[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/Player.js:424[Abort] Disabling Ion mode 0 compilation of script simulation/components/Player.js:424[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/Player.js:432[Abort] Disabling Ion mode 0 compilation of script simulation/components/Player.js:432[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/components/Player.js:548[Abort] Disabling Ion mode 0 compilation of script simulation/components/Player.js:548[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] not compile-and-go[Abort] Aborted compilation of simulation/helpers/Player.js:153[Abort] Disabling Ion mode 0 compilation of script simulation/helpers/Player.js:153[Abort] not compile-and-go[Abort] not compile-and-goWARNING: JavaScript warning: reference to undefined property options.weekdayWARNING: JavaScript warning: reference to undefined property options.hour12[Abort] Script too large (7380 bytes)[Abort] Script too large (7380 bytes)[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:39[Abort] Builder failed to build.[Abort] Script too large (11166 bytes)[Abort] Script too large (11166 bytes)[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:17[Abort] Builder failed to build.[Abort] Script too large (2149 bytes)[Abort] Script too large (2149 bytes)[Abort] Script too large (2149 bytes)[Abort] Aborted compilation of maps/random/rmgen/pathplacer.js:33[Abort] Disabling Ion mode 0 compilation of script maps/random/rmgen/pathplacer.js:33[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:39[Abort] Builder failed to build.[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:39[Abort] Builder failed to build.[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:39[Abort] Builder failed to build.[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:39[Abort] Builder failed to build.Now I just have to solve these problems somehow... Quote Link to comment Share on other sites More sharing options...
Yves Posted June 22, 2013 Author Report Share Posted June 22, 2013 Yay, finally something is faster instead of slower! TIMER| Load RMS: 13.2699 s... which is quite an improvement compared to 253 seconds and it's also much faster than the unpatched v1.8.5 or v17 with 35-37 seconds!This was the important hint:[Abort] NYI inlined get argument element[Abort] aborted @ maps/random/rmgen/random.js:39[Abort] Builder failed to build.I had to replace dynamic argument number checking in the functions randInt and randFloat.rm_random_perf_fix_v1.0.diff 1 Quote Link to comment Share on other sites More sharing options...
Echelon9 Posted June 23, 2013 Report Share Posted June 23, 2013 Well done on the debugging progress Quote Link to comment Share on other sites More sharing options...
k776 Posted June 23, 2013 Report Share Posted June 23, 2013 Well done :-) Looks like an important step toward upgrading SpiderMonkey to get some great speed benefits. Quote Link to comment Share on other sites More sharing options...
fabio Posted June 23, 2013 Report Share Posted June 23, 2013 I had to replace dynamic argument number checking in the functions randInt and randFloat.rm_random_perf_fix_v1.0.diffGreat news indeed! But this patch only speeds up 24 or also older versions? Quote Link to comment Share on other sites More sharing options...
Yves Posted June 23, 2013 Author Report Share Posted June 23, 2013 Great news indeed! But this patch only speeds up 24 or also older versions?Actually I've already tested replacing the randInt function in Spidermonkey 17, but not randFloat because that was called less often.It didn't make a big difference.There's also a bug for this in Bugzilla. Quote Link to comment Share on other sites More sharing options...
Yves Posted June 23, 2013 Author Report Share Posted June 23, 2013 I enabled some more logging. There are hundreds of these messages (same file, same line).What bailouts are is described here.[BaselineBailouts] Invalidating due to bounds check failure[Bailouts] Took bailout! Snapshot offset: 5848[BaselineBailouts] Bailing to baseline simulation/ai/common-api-v3/terrain-analysis-pathfinder.js:146 (IonScript=0x7b82eb0) (FrameType=3)[BaselineBailouts] Reading from snapshot offset 5848 size 30172[BaselineBailouts] Incoming frame ptr = 0x7fffea55e978[BaselineBailouts] Callee function (simulation/ai/common-api-v3/terrain-analysis-pathfinder.js:146)[BaselineBailouts] Not constructing![BaselineBailouts] Restoring frames:[BaselineBailouts] FrameNo 0[BaselineBailouts] Unpacking simulation/ai/common-api-v3/terrain-analysis-pathfinder.js:146[BaselineBailouts] [BASELINE-JS FRAME][BaselineBailouts] WRITE_PTR 0x6b58778/0x7fffea55e970 PrevFramePtr (nil)[BaselineBailouts] SUB_072 0x6b58730/0x7fffea55e928 BaselineFrame[BaselineBailouts] FrameSize=264[BaselineBailouts] ScopeChain=0x7f14cd8d6060[BaselineBailouts] Is function![BaselineBailouts] thisv=fffbff14cc590400[BaselineBailouts] frame slots 26, nargs 1, nfixed 21[BaselineBailouts] arg 0 = fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b58728/0x7fffea55e920 FixedValue fff8800000000140[BaselineBailouts] WRITE_VAL 0x6b58720/0x7fffea55e918 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b58718/0x7fffea55e910 FixedValue fffbff14cd8eb500[BaselineBailouts] WRITE_VAL 0x6b58710/0x7fffea55e908 FixedValue fffbff14cd8eb580[BaselineBailouts] WRITE_VAL 0x6b58708/0x7fffea55e900 FixedValue fff9800000000000[BaselineBailouts] WRITE_VAL 0x6b58700/0x7fffea55e8f8 FixedValue fff9800000000000[BaselineBailouts] WRITE_VAL 0x6b586f8/0x7fffea55e8f0 FixedValue 7ff0000000000000[BaselineBailouts] WRITE_VAL 0x6b586f0/0x7fffea55e8e8 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b586e8/0x7fffea55e8e0 FixedValue fff8800000013357[BaselineBailouts] WRITE_VAL 0x6b586e0/0x7fffea55e8d8 FixedValue fff880000000658b[BaselineBailouts] WRITE_VAL 0x6b586d8/0x7fffea55e8d0 FixedValue fff88000000004d3[BaselineBailouts] WRITE_VAL 0x6b586d0/0x7fffea55e8c8 FixedValue fffbff14cc590a00[BaselineBailouts] WRITE_VAL 0x6b586c8/0x7fffea55e8c0 FixedValue fffbff14cc590a40[BaselineBailouts] WRITE_VAL 0x6b586c0/0x7fffea55e8b8 FixedValue fffaff14ccd43880[BaselineBailouts] WRITE_VAL 0x6b586b8/0x7fffea55e8b0 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b586b0/0x7fffea55e8a8 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b586a8/0x7fffea55e8a0 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b586a0/0x7fffea55e898 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b58698/0x7fffea55e890 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b58690/0x7fffea55e888 FixedValue fff9000000000000[BaselineBailouts] WRITE_VAL 0x6b58688/0x7fffea55e880 FixedValue fff9000000000000[BaselineBailouts] pushing 2 expression stack slots[BaselineBailouts] WRITE_VAL 0x6b58680/0x7fffea55e878 StackValue fffbff14cd1b5190[BaselineBailouts] WRITE_VAL 0x6b58678/0x7fffea55e870 StackValue fff880000001267f[BaselineBailouts] Resuming after pc offset 690 (op getprop) (line 196) of simulation/ai/common-api-v3/terrain-analysis-pathfinder.js:146[BaselineBailouts] Bailout kind: Bailout_BoundsCheck[BaselineBailouts] [TYPE-MONITOR CHAIN][BaselineBailouts] Popping top stack value into R0.[BaselineBailouts] Adjusted framesize -= 8: 256[BaselineBailouts] Set resumeAddr=0x7f14ce60c7b8 monitorStub=0x60df570[BaselineBailouts] Done restoring frames[BaselineBailouts] Done restoring frames[BaselineBailouts] Got pc=0x5d0186a[BaselineBailouts] Restored outerScript=(simulation/ai/common-api-v3/terrain-analysis-pathfinder.js:146,1200) innerScript=(simulation/ai/common-api-v3/terrain-analysis-pathfinder.js:146,1200) (bailoutKind=4)EDIT: The access to this.widthMap[index] here is an out of bounds access.It's even printed as warning but only once so I didn't fix it before. This out of bounds access happens many times per turn.I'll try to fix it tomorrow.EDIT2: h4writer from the #jsapi channel suggested another solution for the random map performance issue.According to him it's only the access to arguments[x] that causes problems and not the arguments.length.function randInt(arg0, arg1){ if (arguments.length == 1) { var maxVal = arg0; return Math.floor(Math.random() * maxVal); } else if (arguments.length == 2) { var minVal = arg0; var maxVal = arg1; return minVal + randInt(maxVal - minVal + 1); } else { error("randInt: invalid number of arguments: "+arguments.length); return undefined; }} Quote Link to comment Share on other sites More sharing options...
h4writer Posted June 25, 2013 Report Share Posted June 25, 2013 About the constant hitting bound check. I'm not sure this is a JS error, it could potentially be an IonMonkey issue. I'm willing to look into it and fix it if you can provide me a shell version of it.About the messages: [Abort] Script too large (2149 bytes)This is telling me you are running a non-threadsafe build. Therefore you don't have parallel compilation and we cap the max script size to 2000 bytes.You should really try a threadsafe build. (That's the default in the browser). The maximum script is 20000bytes and compilation happens on background thread.Should give a nice performance boost.To compile a threadsafe shell:$ cd mozilla-inbound// this is needed for threadsafe build$ cd nsprpub$ mkdir build-64$ cd build-64$ ../configure --disable-debug --enable-optimize$ make// building js shell$ cd mozilla-inbound/js/src$ autoconf2.13$ mkdir build-64$ cd build-64$ ../configure --disable-debug --enable-optimize --enable-threadsafe --with-nspr-cflags="-I/PATH_TO/mozilla-inbound/nsprpub/build-64/dist/include/nspr" --with-nspr-libs="/PATH_TO/mozilla-inbound/nsprpub/build-64/dist/lib/libnspr4.a /PATH_TO/mozilla-inbound/nsprpub/build-64/dist/lib/libplc4.a /PATH_TO/mozilla-inbound/nsprpub/build-64/dist/lib/libplds4.a"$ makeExecute test.js$ ./js --ion-parallel-compile=on test.js 2 Quote Link to comment Share on other sites More sharing options...
Yves Posted June 25, 2013 Author Report Share Posted June 25, 2013 Thanks for your input and your offer to help with troubleshooting!I'll try your suggestion about the threadsafe build and will also try to provide a standalone test-script for the bound-issues.That could be a bit tricky but I'll see what I can do. I will have some time to work on it this Thursday and then on the weekend again. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted June 26, 2013 Report Share Posted June 26, 2013 Something worth investigating if we upgrade Spidermonkey, we've been having a discussion about Spidermonkey floating point math (spurred by #1633, #1990 and #433), does the new Spidermonkey still try for consistent floating point rounding on different platforms? In the past, some people cared enough to find and fix any discrepancies that popped up, but that bug report is 4 years old and surely much has changed. Quote Link to comment Share on other sites More sharing options...
h4writer Posted June 26, 2013 Report Share Posted June 26, 2013 Something worth investigating if we upgrade Spidermonkey, we've been having a discussion about Spidermonkey floating point math (spurred by #1633, #1990 and #433), does the new Spidermonkey still try for consistent floating point rounding on different platforms? In the past, some people cared enough to find and fix any discrepancies that popped up, but that bug report is 4 years old and surely much has changed.Running code in JIT or the interpreter shouldn't make a difference. So we definitely care for these issues! That was an issue reported by Gary and is about an problem in JM/TM vs the interpreter. Both are removed now in favor of IM. I'm not gonna pretend we don't have these issues in IM, but we try to fix them. Gkw, decoder and Jesse are running special bots to find these issues. Now and than they pop up during differential testing. So reporting bugs about that is highly welcome!Just reading the bugs, I don't think we can do much about floating point issues on different platforms, though that wouldn't be a total performance loss. Also I don't know how widespread the issues are and what the error range is. I assume they are very very small and in that case I don't think it will make such a difference? Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted June 27, 2013 Report Share Posted June 27, 2013 Running code in JIT or the interpreter shouldn't make a difference. So we definitely care for these issues! That was an issue reported by Gary and is about an problem in JM/TM vs the interpreter. Both are removed now in favor of IM. I'm not gonna pretend we don't have these issues in IM, but we try to fix them. Gkw, decoder and Jesse are running special bots to find these issues. Now and than they pop up during differential testing. So reporting bugs about that is highly welcome!Just reading the bugs, I don't think we can do much about floating point issues on different platforms, though that wouldn't be a total performance loss. Also I don't know how widespread the issues are and what the error range is. I assume they are very very small and in that case I don't think it will make such a difference?Thanks for responding and it's good to hear that's still important Actually even very small differences across platforms matter to us, because we do a hash of our binary simulation state to detect if a client goes out of sync. Even one bit difference is an OOS (as I've discovered recently where NaN can have different internal representations possibly due to JIT behavior/bugs? - which is fine according to the spec, but a headache for us).This is why we are implementing our own Math functions for trig, pow, exp, etc. Assuming the last comment from this bug report is still valid, and like Philip I can't blame you all if it is. Quote Link to comment Share on other sites More sharing options...
Yves Posted June 27, 2013 Author Report Share Posted June 27, 2013 I also wondered what this setting in the configure script does: --enable-more-deterministic Enable changes that make the shell more deterministic" Quote Link to comment Share on other sites More sharing options...
h4writer Posted June 27, 2013 Report Share Posted June 27, 2013 (edited) Thanks for responding and it's good to hear that's still important Actually even very small differences across platforms matter to us, because we do a hash of our binary simulation state to detect if a client goes out of sync. Even one bit difference is an OOS (as I've discovered recently where NaN can have different internal representations possibly due to JIT behavior/bugs? - which is fine according to the spec, but a headache for us).This is why we are implementing our own Math functions for trig, pow, exp, etc. Assuming the last comment from this bug report is still valid, and like Philip I can't blame you all if it is.About the rounding errors. Yes I think the last comment is still valid and I don't think that will change soon.I'm sure that we use one NaN representation in the JIT. Since that makes our live easier. I actually assumed that is also the case in the interpreter? If NaN is the same across platform is another question.I can ask around if you want to know.I also wondered what this setting in the configure script does: --enable-more-deterministic Enable changes that make the shell more deterministic"That is a flag mostly for fuzzers. It contains little hacks to make life easier for them. To make scripts more deterministic in output/behaviour.E.g. last bug I can remember (not implemented yet) is don't show the compilation time of asm.js in the warning. (Since that is not deterministic and a nightmare for fuzzers)But it will mostly make sure that the error messages are always the same. We try to always give as much as possible information in the error message. So we try to give the value that is fault. But in the JIT we often cannot give that. So we get different error messages, depending on which engine is running. Very annoying for the fuzzer.This is definitely not for production Edited June 27, 2013 by h4writer Quote Link to comment Share on other sites More sharing options...
Yves Posted June 27, 2013 Author Report Share Posted June 27, 2013 I tried running a threadsafe build today.First it segfaulted instantly when loading the library in debug mode. I figured out that it's our override of the free function that causes it.Uncommenting the whole #IF block here works around the issue.Now it triggers a Spidermonkey assertion in Debug mode when starting a match (the main-menu loads fine):#0 0x7ffff5b08244 JSRuntime::assertValidThread(this=0x11d4ac0) (/home/yves/Projekte/firefox24/mozilla-central/js/src/jsapi.cpp:1107)#1 0x7ffff5b660dd JS::AutoCheckRequestDepth::AutoCheckRequestDepth(this=0x7fffffffbd70, cx=0x1888900) (/home/yves/Projekte/firefox24/mozilla-central/js/src/jscntxt.cpp:1511)#2 0x7ffff5b299f7 JS_Enumerate(cx=0x1888900, objArg=0x7fffbfb8ff70) (/home/yves/Projekte/firefox24/mozilla-central/js/src/jsapi.cpp:4600)#3 0x672d19 ValueCloner::Clone(this=0x7fffffffc020, val=...) (../../../source/scriptinterface/ScriptInterface.cpp:1442)#4 0x672854 ValueCloner::GetOrClone(this=0x7fffffffc020, val=...) (../../../source/scriptinterface/ScriptInterface.cpp:1392)#5 0x6708e1 ScriptInterface::CloneValueFromOtherContext(this=0x1b561f8, otherContext=..., val=...) (../../../source/scriptinterface/ScriptInterface.cpp:1493)#6 0x9aed73 (anonymous namespace)::StartGame(scriptInterface=0x1887f30, cbdata=0x17, attribs=..., playerID=1) (../../../source/gui/scripting/ScriptFunctions.cpp:242)#7 0x9bd807 ScriptInterface_NativeWrapper<void>::call<CScriptVal, int, void (*)(ScriptInterface*, void*, CScriptVal, int) (../../../source/scriptinterface/NativeWrapperDefns.h:58)#8 0x9b4de7 ScriptInterface::call<void, CScriptVal, int, {anonymous}::StartGame>(JSContext *, uint32_t, jsval *) (cx=0x1888900, argc=2, vp=0x7fffc0c2c170) (../../../source/scriptinterface/NativeWrapperDefns.h:116)#9 ?? 0x00007ffff59e82f9 in js::CallJSNative (cx=0x1888900, native=0x9b4c3a <ScriptInterface::call<void, CScriptVal, int, {anonymous}::StartGame>(JSContext *, uint32_t, jsval *)>, args=...) (../jscntxtinlines.h:339)#10 0x7ffff59f1d76 js::Invoke(cx=0x1888900, args=..., construct=js::NO_CONSTRUCT) (/home/yves/Projekte/firefox24/mozilla-central/js/src/vm/Interpreter.cpp:454)#11 0x7ffff59f212a js::Invoke(cx=0x1888900, thisv=..., fval=..., argc=2, argv=0x7fffffffc9a0, rval=0x7fffffffc948) (/home/yves/Projekte/firefox24/mozilla-central/js/src/vm/Interpreter.cpp:504)#12 0x7ffff5db1452 js::ion::DoCallFallback(cx=0x1888900, frame=0x7fffffffca58, stub=0x1b56b00, argc=2, vp=0x7fffffffc990, res=...) (/home/yves/Projekte/firefox24/mozilla-central/js/src/ion/BaselineIC.cpp:7004)#13 0x7ffff7e97fb5 ?? () (??:??)#14 0x7fffffffc950 ?? () (??:??)#15 0x7fffffffc948 ?? () (??:??)#16 0x7fffffffc960 ?? () (??:??)#17 0xfff9000000000000 ?? () (??:??)#18 0x7ffff6eeb0e0 js::ion::DoCallNativeSetterInfo() (/home/yves/Projekte/0ad_spidermonkey2_trunk/binaries/system/libmozjs24-ps-debug.so:??)#19 0x7fffc0b395b0 ?? () (??:??)#20 0x7ffff7e4a90f ?? () (??:??)#21 0x502 ?? () (??:??)#22 0x7fffffffca58 ?? () (??:??)#23 0x1b56b00 ?? () (??:??)#24 0x2 ?? () (??:??)#25 0x7fffffffc990 ?? () (??:??)#26 0xfffbffffbfba9280 ?? () (??:??)#27 0xfffbffffbfb143a0 ?? () (??:??)#28 0xfffbffffbfb8ff70 ?? () (??:??)#29 0xfff8800000000001 ?? () (??:??)Apparently I'm not the only one with this problem. It seems that having multiple runtimes in one thread isn't supported anymore.Is that true? Quote Link to comment Share on other sites More sharing options...
h4writer Posted June 28, 2013 Report Share Posted June 28, 2013 I do not know the details (yet) about that part. So I could ask it on irc myself. But I suggest you do it yourself? Since that way you will get the most information about what is possible and not and how to work around it. I think Luke (:luke) would be the best person to ask it. He is stationed in Mountain View, but is online from 18h CEST. If getting online on those times is hard, you can always mail him. (luke AT mozilla . com). I introduced him yesterday to this project, since he didn't know it yet .https://blog.mozilla.org/luke/2012/01/24/jsruntime-is-now-officially-single-threaded/ Quote Link to comment Share on other sites More sharing options...
Yves Posted June 30, 2013 Author Report Share Posted June 30, 2013 I've created a standalone test script. It calculates a specified number of random paths (random start-point and random end-point) using hardcoded JSON map data (I copied that from our acropolis scenario map).It's probably a bit buggy and definitely ugly, but it can reliably reproduce the BoundCheck messages which is most important.Btw. the JSON map data is quite large. If you want to edit the script you need a text editor that doesn't have problems with 800'000+ characters per line. export IONFLAGS=aborts,bailouts,bl-bails./js --ion-parallel-compile=on tests/pathfind.jspathfind.js.zip Quote Link to comment Share on other sites More sharing options...
Yves Posted July 4, 2013 Author Report Share Posted July 4, 2013 I've made my working copy ready for the threadsafe build. I also found that there were some structured clones left from my tests that could be replaced by wrappers. Removing these structured clones improved performance quite a bit but the threadsafe build has nearly no impact at all in this scenario.It should be able to do Ion compiling and garbage collection in another thread now, so it has nothing to do with moving the AI or the Simulation code to another thread. Since I'm now only testing the Simulation and the AI context is constantly in use I expect some more improvements for the threadsafe build in normal games.From the documentation:at any given moment there can either be multiple threads in active requests, or one thread doing GC and all requests suspended.This means to me that if we move the AI to a separate thread and into a separate runtime it can do all the garbage collection in another thread between simulation turns when no active requests are needed. That should make quite a difference because a lot of time is spent doing garbage collection.There's an issue with the threadsafe build when running the HWDetect script at startup. I've filed a bug for that here.Here are some other abort messages from Ion, if anyone can provide some helpful information (I haven't analyzed them much yet).[Abort] Unsupported opcode: setrval (line 174)[Abort] aborted @ simulation/helpers/FSM.js:174[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/helpers/FSM.js:161[Abort] Unsupported opcode: delelem (line 247)[Abort] aborted @ simulation/components/TechnologyManager.js:247[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:186Turn 1 (200)... [Abort] Unsupported opcode: delelem (line 268)[Abort] aborted @ simulation/ai/common-api-v3/shared.js:268[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/ai/common-api-v3/shared.js:223[Abort] Unsupported opcode: setrval (line 90)[Abort] aborted @ simulation/ai/common-api-v3/filters.js:90[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/ai/common-api-v3/filters.js:87[Abort] Unsupported opcode: delelem (line 244)[Abort] aborted @ simulation/ai/common-api-v3/entitycollection.js:244[Abort] Builder failed to build.[Abort] Unsupported opcode: delelem (line 244)[Abort] aborted @ simulation/ai/common-api-v3/entitycollection.js:244[Abort] Builder failed to build.[Abort] Unsupported opcode: delelem (line 244)[Abort] aborted @ simulation/ai/common-api-v3/entitycollection.js:244[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/ai/common-api-v3/entitycollection.js:237Turn 4 (200)... [Abort] Unsupported opcode: delelem (line 87)[Abort] aborted @ simulation/components/Timer.js:87[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/Timer.js:61Turn 7 (200)... [Abort] Unsupported opcode: delelem (line 70)[Abort] aborted @ simulation/components/TechnologyManager.js:70[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/TechnologyManager.js:63Turn 258 (200)... [Abort] Unsupported opcode: setrval (line 283)[Abort] aborted @ simulation/components/ResourceGatherer.js:283[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/ResourceGatherer.js:279Turn 663 (200)... [Abort] Unsupported opcode: delelem (line 57)[Abort] aborted @ simulation/components/Timer.js:57[Abort] Builder failed to build.Turn 1044 (200)... [Abort] Unsupported opcode: delelem (line 302)[Abort] aborted @ simulation/components/ResourceGatherer.js:302[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/ResourceGatherer.js:293Turn 1115 (200)... [Abort] Unsupported opcode: setrval (line 3071)[Abort] aborted @ simulation/components/UnitAI.js:3071[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/UnitAI.js:3046Turn 1155 (200)... [Abort] OSR script has argsobjTurn 1211 (200)... [Abort] OSR script has argsobjTurn 1251 (200)... [Abort] OSR script has argsobjTurn 1299 (200)... [Abort] OSR script has argsobjTurn 1301 (200)... [Abort] OSR script has argsobjTurn 1347 (200)... [Abort] OSR script has argsobjTurn 1357 (200)... [Abort] OSR script has argsobjTurn 1403 (200)... [Abort] OSR script has argsobjTurn 1405 (200)... [Abort] OSR script has argsobjTurn 1443 (200)... [Abort] OSR script has argsobjTurn 1445 (200)... [Abort] OSR script has argsobjTurn 1491 (200)... [Abort] OSR script has argsobjTurn 1493 (200)... [Abort] OSR script has argsobjTurn 1494 (200)... [Abort] Unsupported opcode: delelem (line 57)[Abort] aborted @ simulation/components/Timer.js:57[Abort] Builder failed to build.Turn 1539 (200)... [Abort] OSR script has argsobjTurn 1541 (200)... [Abort] OSR script has argsobjTurn 1595 (200)... [Abort] OSR script has argsobjTurn 1597 (200)... [Abort] OSR script has argsobjTurn 1635 (200)... [Abort] OSR script has argsobjTurn 1637 (200)... [Abort] OSR script has argsobjTurn 1683 (200)... [Abort] OSR script has argsobjTurn 1684 (200)... [Abort] OSR script has argsobjTurn 1685 (200)... [Abort] OSR script has argsobjTurn 1731 (200)... [Abort] OSR script has argsobjTurn 1732 (200)... [Abort] OSR script has argsobjTurn 1733 (200)... [Abort] OSR script has argsobjTurn 1779 (200)... [Abort] OSR script has argsobjTurn 1780 (200)... [Abort] OSR script has argsobjTurn 1789 (200)... [Abort] OSR script has argsobjTurn 1835 (200)... [Abort] OSR script has argsobjTurn 1836 (200)... [Abort] OSR script has argsobjTurn 1837 (200)... [Abort] OSR script has argsobjTurn 1875 (200)... [Abort] OSR script has argsobjTurn 1876 (200)... [Abort] OSR script has argsobjTurn 1877 (200)... [Abort] OSR script has argsobjTurn 1900 (200)... [Abort] Unsupported opcode: setrval (line 496)[Abort] aborted @ simulation/ai/common-api-v3/gamestate.js:496[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/ai/common-api-v3/gamestate.js:487Turn 1923 (200)... [Abort] OSR script has argsobjTurn 1924 (200)... [Abort] OSR script has argsobjTurn 1925 (200)... [Abort] OSR script has argsobjTurn 1971 (200)... [Abort] OSR script has argsobjTurn 1972 (200)... [Abort] OSR script has argsobjTurn 1973 (200)... [Abort] OSR script has argsobjTurn 2027 (200)... [Abort] OSR script has argsobjTurn 2028 (200)... [Abort] OSR script has argsobjTurn 2029 (200)... [Abort] OSR script has argsobjTurn 2075 (200)... [Abort] OSR script has argsobjTurn 2076 (200)... [Abort] OSR script has argsobjTurn 2077 (200)... [Abort] OSR script has argsobjTurn 2115 (200)... [Abort] OSR script has argsobjTurn 2116 (200)... [Abort] OSR script has argsobjTurn 2117 (200)... [Abort] OSR script has argsobjTurn 2163 (200)... [Abort] OSR script has argsobjTurn 2164 (200)... [Abort] OSR script has argsobjTurn 2165 (200)... [Abort] OSR script has argsobjTurn 2211 (200)... [Abort] OSR script has argsobjTurn 2220 (200)... [Abort] OSR script has argsobjTurn 2221 (200)... [Abort] OSR script has argsobjTurn 2261 (200)... [Abort] OSR script has argsobjTurn 2267 (200)... [Abort] OSR script has argsobjTurn 2268 (200)... [Abort] OSR script has argsobjTurn 2307 (200)... [Abort] OSR script has argsobjTurn 2308 (200)... [Abort] OSR script has argsobjTurn 2309 (200)... [Abort] OSR script has argsobjTurn 2354 (200)... [Abort] OSR script has argsobjTurn 2355 (200)... [Abort] OSR script has argsobjTurn 2356 (200)... [Abort] OSR script has argsobjTurn 2357 (200)... [Abort] OSR script has argsobjTurn 2403 (200)... [Abort] OSR script has argsobjTurn 2410 (200)... [Abort] OSR script has argsobjTurn 2412 (200)... [Abort] OSR script has argsobjTurn 2413 (200)... [Abort] OSR script has argsobjTurn 2415 (200)... [Abort] Unsupported opcode: delelem (line 57)[Abort] aborted @ simulation/components/Timer.js:57[Abort] Builder failed to build.Turn 2450 (200)... [Abort] OSR script has argsobjTurn 2451 (200)... [Abort] OSR script has argsobjTurn 2452 (200)... [Abort] OSR script has argsobjTurn 2453 (200)... [Abort] OSR script has argsobjTurn 2498 (200)... [Abort] OSR script has argsobjTurn 2499 (200)... [Abort] OSR script has argsobjTurn 2500 (200)... [Abort] OSR script has argsobjTurn 2501 (200)... [Abort] OSR script has argsobjTurn 2546 (200)... [Abort] OSR script has argsobjTurn 2547 (200)... [Abort] OSR script has argsobjTurn 2556 (200)... [Abort] OSR script has argsobjTurn 2557 (200)... [Abort] OSR script has argsobjTurn 2595 (200)... [Abort] OSR script has argsobjTurn 2596 (200)... [Abort] OSR script has argsobjTurn 2602 (200)... [Abort] OSR script has argsobjTurn 2605 (200)... [Abort] OSR script has argsobjTurn 2642 (200)... [Abort] OSR script has argsobjTurn 2643 (200)... [Abort] OSR script has argsobjTurn 2644 (200)... [Abort] OSR script has argsobjTurn 2645 (200)... [Abort] OSR script has argsobjTurn 2690 (200)... [Abort] OSR script has argsobjTurn 2691 (200)... [Abort] OSR script has argsobjTurn 2692 (200)... [Abort] OSR script has argsobjTurn 2693 (200)... [Abort] OSR script has argsobjTurn 2739 (200)... [Abort] OSR script has argsobjTurn 2746 (200)... [Abort] OSR script has argsobjTurn 2748 (200)... [Abort] OSR script has argsobjTurn 2749 (200)... [Abort] OSR script has argsobjTurn 2786 (200)... [Abort] OSR script has argsobjTurn 2787 (200)... [Abort] OSR script has argsobjTurn 2788 (200)... [Abort] OSR script has argsobjTurn 2789 (200)... [Abort] OSR script has argsobjTurn 2834 (200)... [Abort] OSR script has argsobjTurn 2835 (200)... [Abort] OSR script has argsobjTurn 2836 (200)... [Abort] OSR script has argsobjTurn 2837 (200)... [Abort] OSR script has argsobjTurn 2882 (200)... [Abort] OSR script has argsobjTurn 2891 (200)... [Abort] OSR script has argsobjTurn 2892 (200)... [Abort] OSR script has argsobjTurn 2893 (200)... [Abort] OSR script has argsobjTurn 2932 (200)... [Abort] OSR script has argsobjTurn 2938 (200)... [Abort] OSR script has argsobjTurn 2939 (200)... [Abort] OSR script has argsobjTurn 2941 (200)... [Abort] OSR script has argsobjTurn 2978 (200)... [Abort] OSR script has argsobjTurn 2979 (200)... [Abort] OSR script has argsobjTurn 2980 (200)... [Abort] OSR script has argsobjTurn 2981 (200)... [Abort] OSR script has argsobjTurn 3026 (200)... [Abort] OSR script has argsobjTurn 3027 (200)... [Abort] OSR script has argsobjTurn 3028 (200)... [Abort] OSR script has argsobjTurn 3037 (200)... [Abort] OSR script has argsobjTurn 3066 (200)... [Abort] Unsupported opcode: delelem (line 57)[Abort] aborted @ simulation/components/Timer.js:57[Abort] Builder failed to build.Turn 3075 (200)... [Abort] OSR script has argsobjTurn 3082 (200)... [Abort] OSR script has argsobjTurn 3084 (200)... [Abort] OSR script has argsobjTurn 3085 (200)... [Abort] OSR script has argsobjTurn 3122 (200)... [Abort] OSR script has argsobjTurn 3123 (200)... [Abort] OSR script has argsobjTurn 3124 (200)... [Abort] OSR script has argsobjTurn 3125 (200)... [Abort] OSR script has argsobjTurn 3170 (200)... [Abort] OSR script has argsobjTurn 3171 (200)... [Abort] OSR script has argsobjTurn 3172 (200)... [Abort] OSR script has argsobjTurn 3173 (200)... [Abort] OSR script has argsobjTurn 3226 (200)... [Abort] OSR script has argsobjTurn 3227 (200)... [Abort] OSR script has argsobjTurn 3228 (200)... [Abort] OSR script has argsobjTurn 3229 (200)... [Abort] OSR script has argsobjTurn 3266 (200)... [Abort] OSR script has argsobjTurn 3267 (200)... [Abort] OSR script has argsobjTurn 3268 (200)... [Abort] OSR script has argsobjTurn 3269 (200)... [Abort] OSR script has argsobjTurn 3314 (200)... [Abort] OSR script has argsobjTurn 3315 (200)... [Abort] OSR script has argsobjTurn 3316 (200)... [Abort] OSR script has argsobjTurn 3317 (200)... [Abort] OSR script has argsobjTurn 3362 (200)... [Abort] OSR script has argsobjTurn 3371 (200)... [Abort] OSR script has argsobjTurn 3372 (200)... [Abort] OSR script has argsobjTurn 3373 (200)... [Abort] OSR script has argsobjTurn 3410 (200)... [Abort] OSR script has argsobjTurn 3411 (200)... [Abort] OSR script has argsobjTurn 3412 (200)... [Abort] OSR script has argsobjTurn 3413 (200)... [Abort] OSR script has argsobjTurn 3458 (200)... [Abort] OSR script has argsobjTurn 3459 (200)... [Abort] OSR script has argsobjTurn 3460 (200)... [Abort] OSR script has argsobjTurn 3461 (200)... [Abort] OSR script has argsobjTurn 3506 (200)... [Abort] OSR script has argsobjTurn 3508 (200)... [Abort] OSR script has argsobjTurn 3515 (200)... [Abort] OSR script has argsobjTurn 3517 (200)... [Abort] OSR script has argsobjTurn 3554 (200)... [Abort] OSR script has argsobjTurn 3555 (200)... [Abort] OSR script has argsobjTurn 3556 (200)... [Abort] OSR script has argsobjTurn 3557 (200)... [Abort] OSR script has argsobjTurn 3602 (200)... [Abort] OSR script has argsobjTurn 3603 (200)... [Abort] OSR script has argsobjTurn 3604 (200)... [Abort] OSR script has argsobjTurn 3605 (200)... [Abort] OSR script has argsobjTurn 3651 (200)... [Abort] OSR script has argsobjTurn 3658 (200)... [Abort] OSR script has argsobjTurn 3660 (200)... [Abort] OSR script has argsobjTurn 3661 (200)... [Abort] OSR script has argsobjTurn 3698 (200)... [Abort] OSR script has argsobjTurn 3699 (200)... [Abort] OSR script has argsobjTurn 3700 (200)... [Abort] OSR script has argsobjTurn 3701 (200)... [Abort] OSR script has argsobj[Abort] Unsupported opcode: delelem (line 57)[Abort] aborted @ simulation/components/Timer.js:57[Abort] Builder failed to build.Turn 3747 (200)... [Abort] OSR script has argsobjTurn 3748 (200)... [Abort] OSR script has argsobjTurn 3749 (200)... [Abort] OSR script has argsobjTurn 3754 (200)... [Abort] OSR script has argsobjTurn 3794 (200)... [Abort] OSR script has argsobjTurn 3796 (200)... [Abort] OSR script has argsobjTurn 3797 (200)... [Abort] OSR script has argsobjTurn 3803 (200)... [Abort] OSR script has argsobjTurn 3820 (200)... [Abort] Unsupported opcode: setrval (line 70)[Abort] aborted @ globalscripts/Technologies.js:70[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script globalscripts/Technologies.js:59Turn 3843 (200)... [Abort] OSR script has argsobjTurn 3844 (200)... [Abort] OSR script has argsobjTurn 3850 (200)... [Abort] OSR script has argsobjTurn 3853 (200)... [Abort] OSR script has argsobjTurn 3890 (200)... [Abort] OSR script has argsobjTurn 3892 (200)... [Abort] OSR script has argsobjTurn 3899 (200)... [Abort] OSR script has argsobjTurn 3940 (200)... [Abort] OSR script has argsobjTurn 3946 (200)... [Abort] OSR script has argsobjTurn 3947 (200)... [Abort] OSR script has argsobjTurn 3986 (200)... [Abort] OSR script has argsobjTurn 3988 (200)... [Abort] OSR script has argsobjTurn 3995 (200)... [Abort] OSR script has argsobjTurn 3997 (200)... [Abort] OSR script has argsobjTurn 4034 (200)... [Abort] OSR script has argsobjTurn 4035 (200)... [Abort] OSR script has argsobjTurn 4036 (200)... [Abort] OSR script has argsobjTurn 4037 (200)... [Abort] OSR script has argsobjTurn 4083 (200)... [Abort] OSR script has argsobjTurn 4084 (200)... [Abort] OSR script has argsobjTurn 4090 (200)... [Abort] OSR script has argsobjTurn 4130 (200)... [Abort] OSR script has argsobjTurn 4131 (200)... [Abort] OSR script has argsobjTurn 4132 (200)... [Abort] OSR script has argsobjTurn 4133 (200)... [Abort] OSR script has argsobjTurn 4178 (200)... [Abort] OSR script has argsobjTurn 4180 (200)... [Abort] OSR script has argsobjTurn 4187 (200)... [Abort] OSR script has argsobjTurn 4189 (200)... [Abort] OSR script has argsobjTurn 4227 (200)... [Abort] OSR script has argsobjTurn 4228 (200)... [Abort] OSR script has argsobjTurn 4229 (200)... [Abort] OSR script has argsobjTurn 4234 (200)... [Abort] OSR script has argsobjTurn 4274 (200)... [Abort] OSR script has argsobjTurn 4275 (200)... [Abort] OSR script has argsobjTurn 4276 (200)... [Abort] OSR script has argsobjTurn 4277 (200)... [Abort] OSR script has argsobjTurn 4322 (200)... [Abort] OSR script has argsobjTurn 4324 (200)... [Abort] OSR script has argsobjTurn 4325 (200)... [Abort] OSR script has argsobjTurn 4331 (200)... [Abort] OSR script has argsobjTurn 4370 (200)... [Abort] OSR script has argsobjTurn 4371 (200)... [Abort] OSR script has argsobjTurn 4372 (200)... [Abort] OSR script has argsobjTurn 4380 (200)... [Abort] Unsupported opcode: delelem (line 57)[Abort] aborted @ simulation/components/Timer.js:57[Abort] Builder failed to build.Turn 4381 (200)... [Abort] OSR script has argsobjTurn 4418 (200)... [Abort] OSR script has argsobjTurn 4419 (200)... [Abort] OSR script has argsobjTurn 4420 (200)... [Abort] OSR script has argsobjTurn 4421 (200)... [Abort] OSR script has argsobjTurn 4466 (200)... [Abort] OSR script has argsobjTurn 4467 (200)... [Abort] OSR script has argsobjTurn 4468 (200)... [Abort] OSR script has argsobjTurn 4471 (200)... [Abort] Unsupported opcode: setrval (line 110)[Abort] aborted @ simulation/components/ResourceGatherer.js:110[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/ResourceGatherer.js:106Turn 4477 (200)... [Abort] OSR script has argsobjTurn 4478 (200)... [Abort] Unsupported opcode: setrval (line 3107)[Abort] aborted @ simulation/components/UnitAI.js:3107[Abort] Builder failed to build.[Abort] Disabling Ion mode 0 compilation of script simulation/components/UnitAI.js:3081Especially these are annoying because they don't point to a line of code and because there are so many of them:[Abort] OSR script has argsobj Quote Link to comment Share on other sites More sharing options...
h4writer Posted July 4, 2013 Report Share Posted July 4, 2013 Sorry about the delay. Next week I'll be more responsive. I've got all the important stuff done now.I looked to the BoundsCheck issue and it definitely looks like an issue of IonMonkey. It should remember an element was set out of bound and when recompiling using a alternate version that doesn't bail in this case. I still have to look why and create a patch. I hope I can create a patch this weekend. Else I will provide one in the beginning of next week. Thanks for reporting!About "OSR script has argsobj". You can see which script it is, by providing IONFLAGS=scripts,aborts. The line before the abort is the script where it is failing on. I would definitely suggest to not use "arguments" as much as possible. It is known to decrease performance on all engines a lot...Another issue that causes JS engines to deoptimize a lot is using "delete". Never use that! It pollutes the type information. It is much better to set it to undefined or null.http://jsperf.com/delete-vs-undefined-vs-null/16 (I'm not a fan of jsperf and microbenchmarks, but here it is quite accurate)Also it seems like we haven't added JSOP_DELPROP to ionmonkey yet. So that means the whole script will run in baseline compiler and will be much slower. So I would suggest to adjust that! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.