I've been studying the v8 source, particularly at how the 'mksnapshot' tool includes a compiled image of the native javascript files(runtime.js, json.js...) in the v8 binaries and noticed that it also includes a (somewhat) minified version of the source. For example, when inspecting the contents of the d8 executable, I see the following snippet:
var $JSON=global.JSON;
function Revive(a,b,c){
var d=a[b];
if((%_IsObject(d))){
if((%_IsArray(d))){
var g=d.length;
and at the start of 'src/json.js' I see:
var $JSON = global.JSON;
function Revive(holder, name, reviver) {
var val = holder[name];
if (IS_OBJECT(val)) {
if (IS_ARRAY(val)) {
var length = val.length;
clearly both snippets are equivalent but the second was transformed into the first in the compilation process.
I would have understood if the original code was included for inspecting with 'toString' but when I enter 'JSON.stringify' in d8 all I see is 'function stringify() { [native code] }', so what is the point of this?