This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FILE: liquid-resize-norrowed.js | |
| // -*- mode: js2; indent-tabs-mode: nil; -*- | |
| var baz = new Array(100); | |
| function F() { } | |
| baz.__proto__ = new F(); // <-- need this to expose issue | |
| for (var i=0; i < 99; i++) { | |
| // ^-- this threshold needs to be high to expose issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 18-56-51 src/parjs-benchmarks (git:(no branch)) % git diff | |
| diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp | |
| index b166722..0ad677d 100644 | |
| --- a/js/src/jsmath.cpp | |
| +++ b/js/src/jsmath.cpp | |
| @@ -96,6 +96,18 @@ js_math_abs(JSContext *cx, unsigned argc, Value *vp) | |
| { | |
| double x, z; | |
| +#ifdef DEBUG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % cat math/mat.rs | |
| pub struct Mat4<T> { x:T } | |
| % cat main.rs | |
| // // Don't do this: | |
| // use math::mat::*; | |
| // // Do this: | |
| mod math { mod mat; } | |
| fn main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % git diff | |
| diff --git a/js/src/parjs-benchmarks/nbody.js b/js/src/parjs-benchmarks/nbody.js | |
| index 1a0195e..9055381 100644 | |
| --- a/js/src/parjs-benchmarks/nbody.js | |
| +++ b/js/src/parjs-benchmarks/nbody.js | |
| @@ -474,6 +474,22 @@ function emulateNBody(mode, numBodies, ticks) { | |
| const NUMBODIES = 4000; | |
| const TICKS = 10; | |
| -benchmark("NBODY", 1, DEFAULT_MEASURE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (gdb) r -e 'var libdir="../js/src/parjs-benchmarks/"; var MODE="compare";' ../js/src/parjs-benchmarks/nbody.js | |
| Starting program: /Users/fklock/Dev/Mozilla/iontrail/objdir-dbg-js/js -e 'var libdir="../js/src/parjs-benchmarks/"; var MODE="compare";' ../js/src/parjs-benchmarks/nbody.js | |
| BFD: /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork(i386:x86-64): unknown load command 0x20 | |
| Warming up sequential runs | |
| . | |
| Measuring sequential runs | |
| Measuring parallel runs | |
| Assertion failure: hasParallelIonScript(), at /Users/fklock/Dev/Mozilla/iontrail/js/src/jsscript.h:621 | |
| [New Thread 0x1f03 of process 71782] | |
| [New Thread 0x2003 of process 71782] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Driving Code (put at bottom of nbody.js): | |
| ----------------------------------------- | |
| for (var k=1; k < 9; k++) { | |
| benchmark("NBODY_"+k+"K", 1, DEFAULT_MEASURE, | |
| function () { emulateNBody("seq", k*1000, TICKS); }, | |
| function () { emulateNBody("par", k*1000, TICKS); }); | |
| benchmark("NBODY_"+k+".5K", 1, DEFAULT_MEASURE, | |
| function () { emulateNBody("seq", k*1000+500, TICKS); }, | |
| function () { emulateNBody("par", k*1000+500, TICKS); }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OVERVIEW | |
| -------- | |
| I grabbed http://davidbau.com/encode/seedrandom.js and threw it into parjs-benchmarks. (Can we just add it? Its license looks like it is likely to be compatible, but IANAL.) Then I loaded the file, and changed `emulateNBody` to set the seed before each run: | |
| Here's the description of the concrete changes I made to use the seed and iterate on various workloads. | |
| % diff --git a/js/src/parjs-benchmarks/nbody.js b/js/src/parjs-benchmarks/nbody.js | |
| index 1a0195e..aba2cef 100644 | |
| --- a/js/src/parjs-benchmarks/nbody.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Top-most portion of backtrace: | |
| #0 js::ion::CodeLocationJump::raw (this=0x7fff5fbd0890) at Assembler-shared.h:444 | |
| #1 0x00000001009ea082 in js::ion::PatchJump (jump={raw_ = 0xdeadc0de <Address 0xdeadc0de out of bounds>, absolute_ = true, jumpTableEntry_ = 0xdeadab1e <Address 0xdeadab1e out of bounds>}, label={raw_ = 0x106eee0f6 "<felix-deleted-non-utf8-garbage-in-string>", absolute_ = true}) at Assembler-x64.h:600 | |
| #2 0x00000001009e8909 in js::ion::IonCache::reset (this=0x104034698) at /Users/fklock/Dev/Mozilla/iontrail/js/src/ion/IonCaches.cpp:1359 | |
| #3 0x00000001009e886f in js::ion::ParallelGetPropertyIC::reset (this=0x104034698) at /Users/fklock/Dev/Mozilla/iontrail/js/src/ion/IonCaches.cpp:1145 | |
| #4 0x0000000100947f34 in js::ion::IonScript::purgeCaches (this=0x104034600, c=0x10289dc00) at /Users/fklock/Dev/Mozilla/iontrail/js/src/ion/Ion.cpp:801 | |
| Scroll down to bottom to see full backtrace. Something is wrong and niko said it is in code that shu recently touched. Unfortunately it takes a long time for t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (gdb) pwd | |
| Working directory /Users/fklock/Dev/Mozilla/iontrail/objdir-dbg-js. | |
| (gdb) cd /Users/fklock/Dev/Mozilla/iontrail/js/src/parjs-benchmarks | |
| Working directory /Users/fklock/Dev/Mozilla/iontrail/js/src/parjs-benchmarks. | |
| (gdb) r -e 'var libdir="./"; var MODE="compare";' nbody-fail.js | |
| Starting program: /Users/fklock/Dev/Mozilla/iontrail/objdir-dbg-js/js -e 'var libdir="./"; var MODE="compare";' nbody-fail.js | |
| Reading symbols for shared libraries ++++++++.............................................................. done | |
| Warming up sequential runs | |
| . | |
| Measuring sequential runs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn vec_peek<T>(v: &'r [T]) -> Option< (&'r T, &'r [T]) > { | |
| if v.len() == 0 { | |
| None | |
| } else { | |
| let head = &v[0]; | |
| let tail = v.view(1, v.len()); | |
| Some( (head, tail) ) | |
| } | |
| } |