JavaScript:New to SpiderMonkey: Difference between revisions

Jump to navigation Jump to search
Use mach-based workflow
(Mention that recent hg uses bundles automatically)
(Use mach-based workflow)
Line 15: Line 15:
=== Build the js shell ===
=== Build the js shell ===


Most of the time, you'll be working with the Javascript shell, instead of the full Firefox browser. So build the shell:  
Most of the time, you'll be working with the JavaScript shell, instead of the full Firefox browser. See the [https://firefox-source-docs.mozilla.org/js/build.html SpiderMonkey build documentation] for how to do that.
 
cd spidermonkey/js/src
cp configure.in configure && chmod +x configure # or autoconf2.13 or autoconf-2.13
mkdir build_DBG.OBJ
cd build_DBG.OBJ
../configure --enable-debug --disable-optimize
make # or make -j8
cd ..
 
If this doesn't work, refer to [https://developer.mozilla.org/en/SpiderMonkey/Build_Documentation the SpiderMonkey build documentation].


=== Fix something ===
=== Fix something ===
Line 37: Line 27:
Having made the change, build the shell again.  
Having made the change, build the shell again.  


  make -C build_DBG.OBJ
  ./mach build


==== Testing your changes ====
==== Testing your changes ====
Line 43: Line 33:
It builds. Hurray. Time to run the tests to check you haven't broken anything.  
It builds. Hurray. Time to run the tests to check you haven't broken anything.  


  jit-test/jit_test.py build_DBG.OBJ/dist/bin/js
  ./mach jit-test
(The location of the shell has changed, it used to be build_DBG.OBJ/js)


The jit-tests are pretty quick, and should give you an idea if you've gotten something wrong. Assuming nothing goes wrong, try the ref-tests:  
The jit-tests are pretty quick, and should give you an idea if you've gotten something wrong. Assuming nothing goes wrong, try the ref-tests:  


  tests/jstests.py build_DBG.OBJ/dist/bin/js
  ./mach jstests


Note that some of these tests fail depending on the timezone and locale they're run in, so if you get any errors that don't seem related to your changes, re-run the tests with a shell build without your changes applied and compare the results.


==== Benchmark your changes ====
==== Benchmark your changes ====
Confirmed users
33

edits

Navigation menu