Skip to content

Instantly share code, notes, and snippets.

View nanake's full-sized avatar
:octocat:
flaneuring

ななけだよ nanake

:octocat:
flaneuring
View GitHub Profile

Self-Hosting in SpiderMonkey

Firefox has always contained large amounts of JavaScript in the application itself, and with each release, that amount usually grows. Some of the JS code that is contained in Firefox 21, released last Tuesday, is special, however: it forms part of SpiderMonkey itself, the virtual machine that runs all JS code in Firefox and on websites loaded into the browser.

Implementing parts or the whole of a runtime or compilation environment for a language in that very language itself is called self-hosting, and it isn't a new invention by any means. Examples of languages with (partly) self-hosted compilers include C/C++, Pascal and Rust. Partially self-hosted VMs exist, among others, for Lisps of all ages, Python, Ruby, Java, .Net, ActionScript3 - and JS. In fact, the V8 VM that executes JS in Chromium and Node.js has been partially self-hosted for a number of years now (maybe even from the outset, I don't know).

Why?

Various reasons. Code that is implemented in managed, memory-saf

commit 5115d4348ee720be3db77ae54a06c492049e5ea3
Author: Naseer Ahmed <naseer@codeaurora.org>
Date: Mon Nov 19 19:27:37 2012 -0500
msm_mdp: Update header for 4 layer support
Bug: 7626586
Change-Id: I37730470dc09b7a9d6336b1603f87efd98f45e97
Signed-off-by: Iliyan Malchev <malchev@google.com>
commit fbef8b9578aaa422d5bd3153eb50df739815672c
@archon810
archon810 / Changelog_android-4.2.1_r1.2_android-4.2.2_r1.txt
Created February 12, 2013 20:08
Short version of the 4.2.2 changelog.
Project name: /platform/development
•Chris Banes - Update bitmapfun sample to call recycle()
•Dirk Dougherty - Add redirect for removed file.
•Dirk Dougherty - Minor updates to keep androiddevdocs redirect in sync with devsite version (in frameworks/base)
•Adam Koch - Bitmapfun Sample: Fix bug where background image loading could hang
•Chet Haase - Cherrypick from Change-Id: I4ae984cf776604cede32b98db6b1eb3cb6c59c7e
•Adam Koch - Bitmapfun Sample: Change cache memory calculation to use maxMemory()
•Adam Koch - Bitmapfun Sample: Fix inSampleSize selection and update dependencies
•Katie McCormick - Network sample: fix typo in manifest
•Xavier Ducrohet - Update platform tools rev to 16.0.2
@zpao
zpao / run-this.js
Created June 10, 2011 23:27
Simple Window + Tab Stats
/* Run this in your error console */
var wc=0, tc=0, tgc=0;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/DownloadUtils.jsm");
var wm = Services.wm;
var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
var e = wm.getEnumerator("navigator:browser");
var uc = { };
while (e.hasMoreElements()) {