Add JS::Value::dump
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox124 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
(Blocks 1 open bug)
Details
Attachments
(19 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Comment hidden (obsolete) |
Assignee | ||
Comment 2•2 years ago
|
||
the Symbol's description
field was wrong.
I'll fix it.
Assignee | ||
Comment 3•2 years ago
•
|
||
js> dumpValue(true);
{
"type": "boolean",
"value": true
}
js> dumpValue(null);
{
"type": "null"
}
js> dumpValue(undefined);
{
"type": "undefined"
}
js> dumpValue(10);
{
"type": "int32",
"value": 10
}
js> dumpValue(1.1);
{
"type": "double",
"value": "1.1",
"private": "0x3ff199999999999a"
}
js> dumpValue(10n);
{
"type": "bigint",
"address": "(JS::BigInt*)0x11199796b030",
"digitLength": 1,
"value": "10n"
}
js> dumpValue("foo");
{
"type": "string",
"address": "(JSAtom*)0x11199792d440",
"flags": [ "ATOM_BIT", "LINEAR_BIT", "INLINE_BIT", "PERMANENT", "LATIN1_CHARS_BIT", "PINNED_ATOM_BIT" ],
"isTenured": true,
"length": 3,
"chars": "(JS::Latin1Char*)0x11199792d448",
"value": "foo"
}
js> dumpValue(Symbol.iterator);
{
"type": "symbol",
"address": "(JS::Symbol*)0x11199793a040",
"code": "iterator",
"description": "Symbol.iterator"
}
js> dumpValue(Symbol("foo"));
{
"type": "symbol",
"address": "(JS::Symbol*)0x11199796c030",
"code": "UniqueSymbol",
"description": "foo"
}
js> dumpValue(Symbol.for("foo"));
{
"type": "symbol",
"address": "(JS::Symbol*)0x11199796c040",
"code": "InSymbolRegistry",
"description": "foo"
}
js> dumpValue(/foo/ig);
{
"type": "object",
"address": "(JSObject*)0x203dde901158",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<RegExp @ (JSClass*)0x105e2bc00>",
"shape": "<(js::Shape*)0x111997966fe0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c298",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x1119979410d0"
},
"source": "foo",
"flags": [ "IgnoreCase", "Global" ],
"lastIndex": "0",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "0",
"1": "'foo' @ (JSAtom*)0x11199792d440",
"2": "3",
"3": "<private GCThing @ 0x111997971098>"
},
"properties": {
"lastIndex": "0 (map=(js::CompactPropMap*)0x111997944f30, index=0, writable, slot=0)"
}
}
js> dumpValue({});
{
"type": "object",
"address": "(JSObject*)0x203dde901278",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Object @ (JSClass*)0x105e1f8e8>",
"shape": "<(js::Shape*)0x111997972040, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c0e8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941040"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"properties": {
}
}
js> dumpValue([]);
{
"type": "object",
"address": "(JSObject*)0x203dde901398",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Array @ (JSClass*)0x105e1d520>",
"shape": "<(js::Shape*)0x111997966500, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c220",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x11199793e088"
},
"elementsHeader": "<(js::ObjectElements*)0x203dde9013b0, flags=[FIXED], init=0, capacity=6, length=0>",
"properties": {
"length": "(map=(js::NormalPropMap*)0x11199795f780, index=0, writable, <custom-data-prop>)"
}
}
js> dumpValue(Array);
{
"type": "object",
"address": "(JSObject*)0x111997963820",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Function @ (JSClass*)0x105e29760>",
"shape": "<(js::Shape*)0x1119979662a0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c0a0",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997943040"
},
"displayAtom": "Array",
"nargs": 1,
"flags": [ "NORMAL_KIND", "CONSTRUCTOR" ],
"native": "0x1024e63d8",
"jitInfo": "0x104930578",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "65664",
"1": "2.14111208e-314 / <private @ 0x1024e63d8>",
"2": "2.1599123926e-314 / <private @ 0x104930578>",
"3": "'Array' @ (JSAtom*)0x11199792c520"
},
"properties": {
"isArray": "<Function isArray @ (JSObject*)0x111997963b30> (map=(js::CompactPropMap*)0x111997944bf0, index=0, configurable, writable, slot=4)"
"from": "<Function from @ (JSObject*)0x111997945dc0> (map=(js::CompactPropMap*)0x111997944bf0, index=1, configurable, writable, slot=5)"
"of": "<Function of @ (JSObject*)0x111997963b68> (map=(js::CompactPropMap*)0x111997944bf0, index=2, configurable, writable, slot=6)"
"Symbol.species": "getter=0x111997945e08, setter=0x0 (map=(js::CompactPropMap*)0x111997944bf0, index=3, configurable, slot=7)"
"prototype": "<Array @ (JSObject*)0x11199793e088> (map=(js::CompactPropMap*)0x111997944bf0, index=4, slot=8)"
}
}
js> dumpValue(function f() {});
{
"type": "object",
"address": "(JSObject*)0x203dde9015b0",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Function @ (JSClass*)0x105e29760>",
"shape": "<(js::Shape*)0x11199793d160, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c0a0",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997943040"
},
"displayAtom": "f",
"baseScript": "/Users/arai/Documents/xpi/mozpatch/dump-value/test.js line 3 > eval:1:20 @ 0x11199796a560",
"nargs": 0,
"flags": [ "NORMAL_KIND", "BASESCRIPT", "CONSTRUCTOR", "LAMBDA" ],
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "672",
"1": "<Call @ (JSObject*)0x203dde9014d8>",
"2": "9.2892321007895e-311 / <private @ 0x11199796a560>",
"3": "'f' @ (JSAtom*)0x111997904d00"
},
"properties": {
}
}
js> dumpValue(new Int8Array([1, 2, 3]));
{
"type": "object",
"address": "(JSObject*)0x203dde9016c8",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Int8Array @ (JSClass*)0x105e2fe60>",
"shape": "<(js::Shape*)0x111997972b20, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c328",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941100"
},
"length": "3",
"byteOffset": "0",
"data": "0x203dde901700",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "null",
"1": "1.5e-323 / <private @ 0x3>",
"2": "0 / <private @ 0x0>",
"3": "1.7514676096559e-310 / <private @ 0x203dde901700>"
},
"properties": {
}
}
js> dumpValue(new Int8Array(new Int8Array([1, 2, 3]).buffer, 1));
{
"type": "object",
"address": "(JSObject*)0x203dde901860",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Int8Array @ (JSClass*)0x105e2fe60>",
"shape": "<(js::Shape*)0x111997972b20, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c328",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941100"
},
"length": "2",
"byteOffset": "1",
"data": "0x111997974069",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "<ArrayBuffer byteLength=3, bufferKind=INLINE_DATA, flags=[], data=0x111997974068 @ (JSObject*)0x111997974030>",
"1": "1e-323 / <private @ 0x2>",
"2": "5e-324 / <private @ 0x1>",
"3": "9.2892321203985e-311 / <private @ 0x111997974069>"
},
"properties": {
}
}
js> dumpValue(new Int32Array([1, 2, 3]));
{
"type": "object",
"address": "(JSObject*)0x203dde901978",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Int32Array @ (JSClass*)0x105e2ff20>",
"shape": "<(js::Shape*)0x111997972d80, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c388",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941160"
},
"length": "3",
"byteOffset": "0",
"data": "0x203dde9019b0",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "null",
"1": "1.5e-323 / <private @ 0x3>",
"2": "0 / <private @ 0x0>",
"3": "1.7514676096899e-310 / <private @ 0x203dde9019b0>"
},
"properties": {
}
}
js> dumpValue(new Int32Array(new Int32Array([1, 2, 3]).buffer, 4));
{
"type": "object",
"address": "(JSObject*)0x203dde901b10",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Int32Array @ (JSClass*)0x105e2ff20>",
"shape": "<(js::Shape*)0x111997972d80, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c388",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941160"
},
"length": "2",
"byteOffset": "4",
"data": "0x1119979740c4",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "<ArrayBuffer byteLength=12, bufferKind=INLINE_DATA, flags=[], data=0x1119979740c0 @ (JSObject*)0x111997974088>",
"1": "1e-323 / <private @ 0x2>",
"2": "2e-323 / <private @ 0x4>",
"3": "9.2892321204434e-311 / <private @ 0x1119979740c4>"
},
"properties": {
}
}
js> dumpValue(new Int8Array([1, 2, 3]).buffer);
{
"type": "object",
"address": "(JSObject*)0x1119979740e0",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<ArrayBuffer @ (JSClass*)0x105e21340>",
"shape": "<(js::Shape*)0x111997972cc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c358",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941148"
},
"byteLength": "3",
"bufferKind": "INLINE_DATA",
"flags": [ ],
"data": "0x111997974118",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "9.289232120485e-311 / <private @ 0x111997974118>",
"1": "1.5e-323 / <private @ 0x3>",
"2": "<Int8Array length=3, byteOffset=0, data=0x111997974118 @ (JSObject*)0x203dde901c28>",
"3": "0"
},
"properties": {
}
}
js> dumpValue(new Promise(() => {}));
{
"type": "object",
"address": "(JSObject*)0x203dde901da0",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Promise @ (JSClass*)0x105e29cf8>",
"shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c3b8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941178"
},
"flags": [ ],
"state": "pending",
"reactions": [
],
"allocationTime": "591.630542",
"allocationSite": "<SavedFrame @ (JSObject*)0x11199794d138>",
"resolutionTime": "0.000000",
"resolutionSite": "null",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "0",
"1": "undefined",
"2": "<Function (anonymous) @ (JSObject*)0x203dde901e90>",
"3": "<PromiseDebugInfo @ (JSObject*)0x203dde901de0>"
},
"properties": {
}
}
js> var p = new Promise(() => {}); p.then(() => {}); dumpValue(p);
{
"type": "object",
"address": "(JSObject*)0x203dde901ff8",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Promise @ (JSClass*)0x105e29cf8>",
"shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c3b8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941178"
},
"flags": [ "HANDLED" ],
"state": "pending",
"reactions": [
{
"promise": "<Promise @ (JSObject*)0x203dde902178>",
"incumbentGlobal": "<Object @ (JSObject*)0x111997941040>",
"flags": [ ]
}
],
"allocationTime": "652.663083",
"allocationSite": "<SavedFrame @ (JSObject*)0x11199794d240>",
"resolutionTime": "0.000000",
"resolutionSite": "null",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "4",
"1": "<PromiseReactionRecord @ (JSObject*)0x203dde902218>",
"2": "<Function (anonymous) @ (JSObject*)0x203dde9020e8>",
"3": "<PromiseDebugInfo @ (JSObject*)0x203dde902038>"
},
"properties": {
}
}
js> var p = new Promise(() => {}); p.then(() => {}); p.then(() => {}); dumpValue(p);
{
"type": "object",
"address": "(JSObject*)0x203dde902390",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Promise @ (JSClass*)0x105e29cf8>",
"shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c3b8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941178"
},
"flags": [ "HANDLED" ],
"state": "pending",
"reactions": [
{
"promise": "<Promise @ (JSObject*)0x203dde902510>",
"incumbentGlobal": "<Object @ (JSObject*)0x111997941040>",
"flags": [ ]
},
{
"promise": "<Promise @ (JSObject*)0x203dde902650>",
"incumbentGlobal": "<Object @ (JSObject*)0x111997941040>",
"flags": [ ]
}
],
"allocationTime": "711.244417",
"allocationSite": "<SavedFrame @ (JSObject*)0x11199794d3a0>",
"resolutionTime": "0.000000",
"resolutionSite": "null",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "4",
"1": "<Array @ (JSObject*)0x203dde902750>",
"2": "<Function (anonymous) @ (JSObject*)0x203dde902480>",
"3": "<PromiseDebugInfo @ (JSObject*)0x203dde9023d0>"
},
"properties": {
}
}
js> dumpValue(Promise.resolve(10));
{
"type": "object",
"address": "(JSObject*)0x203dde902868",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Promise @ (JSClass*)0x105e29cf8>",
"shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c3b8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941178"
},
"flags": [ "RESOLVED", "FULFILLED", "DEFAULT_RESOLVING_FUNCTIONS", "DEFAULT_RESOLVING_FUNCTIONS_ALREADY_RESOLVED" ],
"state": "fulfilled",
"value": {
"type": "int32",
"value": 10
},
"allocationTime": "717.482875",
"allocationSite": "<SavedFrame @ (JSObject*)0x11199794d558>",
"resolutionTime": "717.531500",
"resolutionSite": "<SavedFrame @ (JSObject*)0x11199794d558>",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "27",
"1": "10",
"2": "undefined",
"3": "<PromiseDebugInfo @ (JSObject*)0x203dde9028a8>"
},
"properties": {
}
}
js> var p = Promise.reject(10); dumpValue(p);
{
"type": "object",
"address": "(JSObject*)0x203dde9029e0",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Promise @ (JSClass*)0x105e29cf8>",
"shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c3b8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941178"
},
"flags": [ "RESOLVED", "DEFAULT_RESOLVING_FUNCTIONS", "DEFAULT_RESOLVING_FUNCTIONS_ALREADY_RESOLVED" ],
"state": "rejected",
"reason": {
"type": "int32",
"value": 10
},
"allocationTime": "756.589917",
"allocationSite": "<SavedFrame @ (JSObject*)0x11199794d660>",
"resolutionTime": "756.620458",
"resolutionSite": "<SavedFrame @ (JSObject*)0x11199794d660>",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "25",
"1": "10",
"2": "undefined",
"3": "<PromiseDebugInfo @ (JSObject*)0x203dde902a20>"
},
"properties": {
}
}
js> dumpValue((async function() {})());
{
"type": "object",
"address": "(JSObject*)0x203dde902c18",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Promise @ (JSClass*)0x105e29cf8>",
"shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c3b8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941178"
},
"flags": [ "RESOLVED", "FULFILLED", "DEFAULT_RESOLVING_FUNCTIONS", "ASYNC" ],
"state": "fulfilled",
"value": {
"type": "undefined"
},
"allocationTime": "818.985458",
"allocationSite": "<SavedFrame @ (JSObject*)0x11199794d7c0>",
"resolutionTime": "819.177167",
"resolutionSite": "<SavedFrame @ (JSObject*)0x11199794d7c0>",
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "43",
"1": "undefined",
"2": "undefined",
"3": "<PromiseDebugInfo @ (JSObject*)0x203dde902c58>"
},
"properties": {
}
}
js> dumpValue(new Date());
{
"type": "object",
"address": "(JSObject*)0x203dde902e30",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Date @ (JSClass*)0x105e37250>",
"shape": "<(js::Shape*)0x111997975de0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c4d8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x1119979411d8"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "1660745415458 / <private @ 0x42782ac23fb22000>",
"1": "undefined",
"2": "undefined",
"3": "undefined",
"4": "undefined",
"5": "undefined",
"6": "undefined",
"7": "undefined"
},
"properties": {
}
}
js> dumpValue(new Map([ ["foo", 10], ["bar", 20] ]));
{
"type": "object",
"address": "(JSObject*)0x203dde902fa8",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Map @ (JSClass*)0x105e1ef48>",
"shape": "<(js::Shape*)0x111997977080, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c508",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x1119979411f0"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "2.201448021e-314 / <private @ 0x10995d030>",
"1": "0 / <private @ 0x0>",
"2": "true"
},
"properties": {
}
}
js> dumpValue(new Set([1, 2, 3]));
{
"type": "object",
"address": "(JSObject*)0x203dde903190",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Set @ (JSClass*)0x105e1f368>",
"shape": "<(js::Shape*)0x111997975500, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c448",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x1119979411a8"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "2.2014473886e-314 / <private @ 0x10995cb30>",
"1": "0 / <private @ 0x0>",
"2": "true"
},
"properties": {
}
}
js> dumpValue(new WeakMap([ [{}, 10], [{}, 20] ]));
{
"type": "object",
"address": "(JSObject*)0x11199793f150",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<WeakMap @ (JSClass*)0x105e33db8>",
"shape": "<(js::Shape*)0x1119979773a0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c550",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941208"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "2.201325232e-314 / <private @ 0x109920560>"
},
"properties": {
}
}
js> dumpValue(new WeakSet([{}, {}]));
{
"type": "object",
"address": "(JSObject*)0x11199793f178",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<WeakSet @ (JSClass*)0x105e34120>",
"shape": "<(js::Shape*)0x1119979774e0, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c580",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941220"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "2.2013261726e-314 / <private @ 0x109920cd0>"
},
"properties": {
}
}
js> dumpValue(new Proxy({}, {}));
{
"type": "object",
"address": "(JSObject*)0x111997942190",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Proxy @ (JSClass*)0x105e20a10>",
"shape": "<(js::Shape*)0x111997977540, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c598",
"realm": "(JS::Realm*)0x109916000",
"proto": "<dynamic>"
},
"handler": "(js::BaseProxyHandler*)0x105e20b70",
"private": "<Object @ (JSObject*)0x203dde903728>"
}
js> dumpValue((function* f() {})());
{
"type": "object",
"address": "(JSObject*)0x203dde903940",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Generator @ (JSClass*)0x105e28448>",
"shape": "<(js::Shape*)0x111997977780, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c5f8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941268"
},
"elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
"reservedSlots": {
"0": "<Function f (/Users/arai/Documents/xpi/mozpatch/dump-value/test.js line 3 > eval:1:22 @ 0x11199796af10) @ (JSObject*)0x203dde903880>",
"1": "<Call @ (JSObject*)0x203dde9038c0>",
"2": "undefined",
"3": "<Array @ (JSObject*)0x203dde9039a0>",
"4": "0"
},
"properties": {
}
}
js> dumpValue({
1: true,
2: {},
foo: false,
bar: null,
get x() {},
set x(c) {},
});
{
"type": "object",
"address": "(JSObject*)0x203dde903ad8",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Object @ (JSClass*)0x105e1f8e8>",
"shape": "<(js::Shape*)0x111997977800, objectFlags=[HasEnumerable, HasNonWritableOrAccessorPropExclProto, HadGetterSetterChange]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c0e8",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x111997941040"
},
"elementsHeader": "<(js::ObjectElements*)0x203dde903af0, flags=[NON_PACKED], init=3, capacity=5, length=0>",
"properties": {
"foo": "false (map=(js::CompactPropMap*)0x111997973a50, index=0, enumerable, configurable, writable, slot=0)"
"bar": "null (map=(js::CompactPropMap*)0x111997973a50, index=1, enumerable, configurable, writable, slot=1)"
"x": "getter=0x203dde903bb0, setter=0x203dde903bf0 (map=(js::CompactPropMap*)0x111997973a50, index=2, enumerable, configurable, slot=2)"
},
"elements": {
"0": "<magic JS_ELEMENTS_HOLE>",
"1": "true",
"2": "<Object @ (JSObject*)0x203dde903b30>"
}
}
js> dumpValue([
true,
null,
undefined,
10,
1.1,
10n,
"foo",
Symbol.iterator,
Symbol("foo"),
Symbol.for("foo"),
/foo/ig,
{},
[],
Array,
function f() {},
new Int8Array([1, 2, 3]),
new Int8Array([1, 2, 3]).buffer,
]);
{
"type": "object",
"address": "(JSObject*)0x203dde903d08",
"nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
"clasp": "<Array @ (JSClass*)0x105e1d520>",
"shape": "<(js::Shape*)0x111997966500, objectFlags=[]>",
"shape.base": {
"address": "(js::BaseShape*)0x11199793c220",
"realm": "(JS::Realm*)0x109916000",
"proto": "(JSObject*)0x11199793e088"
},
"elementsHeader": "<(js::ObjectElements*)0x203dde903d30, flags=[], init=17, capacity=17, length=17>",
"properties": {
"length": "(map=(js::NormalPropMap*)0x11199795f780, index=0, writable, <custom-data-prop>)"
},
"elements": {
"0": "true",
"1": "null",
"2": "undefined",
"3": "10",
"4": "1.1 / <private @ 0x3ff199999999999a>",
"5": "10n @ (JS::BigInt*)0x11199796b040",
"6": "'foo' @ (JSAtom*)0x11199792d440",
"7": "Symbol.iterator",
"8": "Symbol('foo') @ (JS::Symbol*)0x11199796c050",
"9": "Symbol.for('foo') @ (JS::Symbol*)0x11199796c040",
"10": "<RegExp /foo/ig @ (JSObject*)0x203dde903dd0>",
"11": "<Object @ (JSObject*)0x203dde903e10>",
"12": "<Array @ (JSObject*)0x203dde903e50>",
"13": "<Function Array @ (JSObject*)0x111997963820>",
"14": "<Function f (/Users/arai/Documents/xpi/mozpatch/dump-value/test.js line 3 > eval:16:12 @ 0x111997979100) @ (JSObject*)0x203dde903eb0>",
"15": "<Int8Array length=3, byteOffset=0, data=0x203dde903f28 @ (JSObject*)0x203dde903ef0>",
"16": "<ArrayBuffer byteLength=3, bufferKind=INLINE_DATA, flags=[], data=0x111997974170 @ (JSObject*)0x111997974138>"
}
}
Assignee | ||
Comment 4•2 years ago
|
||
Also
js> var s = "Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! "; dumpStringRepresentation(s.slice(4, 80));
{
"address": "(JSDependentString*)0x1b81a000798",
"flags": [ "LINEAR_BIT", "DEPENDENT_BIT", "LATIN1_CHARS_BIT" ],
"isTenured": false,
"length": 76,
"offset": 4,
"base": {
"address": "(JSLinearString*)0x17c287167040",
"flags": [ "LINEAR_BIT", "LATIN1_CHARS_BIT" ],
"isTenured": true,
"length": 126,
"chars": "(JS::Latin1Char*)0x10a624a80",
"value": "Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! "
},
"chars": "(JS::Latin1Char*)0x10a624a84",
"value": "o, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, Wor"
}
js> var rope = "test".repeat(10); dumpStringRepresentation(rope);
{
"address": "(JSRope*)0x1b81a000818",
"flags": [ "LATIN1_CHARS_BIT" ],
"isTenured": false,
"length": 40,
"left": {
"address": "(JSThinInlineString*)0x1b81a0007b8",
"flags": [ "LINEAR_BIT", "INLINE_BIT", "LATIN1_CHARS_BIT" ],
"isTenured": false,
"length": 8,
"chars": "(JS::Latin1Char*)0x1b81a0007c0",
"value": "testtest"
},
"right": {
"address": "(JSRope*)0x1b81a0007f8",
"flags": [ "LATIN1_CHARS_BIT" ],
"isTenured": false,
"length": 32,
"left": {
"address": "(JSThinInlineString*)0x1b81a0007d8",
"flags": [ "LINEAR_BIT", "INLINE_BIT", "LATIN1_CHARS_BIT" ],
"isTenured": false,
"length": 16,
"chars": "(JS::Latin1Char*)0x1b81a0007e0",
"value": "testtesttesttest"
},
"right": {
"address": "(JSThinInlineString*)0x1b81a0007d8",
"flags": [ "LINEAR_BIT", "INLINE_BIT", "LATIN1_CHARS_BIT" ],
"isTenured": false,
"length": 16,
"chars": "(JS::Latin1Char*)0x1b81a0007e0",
"value": "testtesttesttest"
}
}
}
Assignee | ||
Comment 5•2 years ago
|
||
so far, indent-based dump around string and object are replaced with JSON dump, with extra information.
there's limitation that, compact notation for special value needs to be in string, and JSString vs non-string became unclear,
so, I've added single quotation for JSStrings in some cases.
Assignee | ||
Comment 6•2 years ago
|
||
Assignee | ||
Comment 7•1 year ago
|
||
Assignee | ||
Comment 8•1 year ago
|
||
Assignee | ||
Comment 9•1 year ago
|
||
Assignee | ||
Comment 10•1 year ago
|
||
Assignee | ||
Comment 11•1 year ago
|
||
Assignee | ||
Comment 12•1 year ago
|
||
Assignee | ||
Comment 13•1 year ago
|
||
Assignee | ||
Comment 14•1 year ago
|
||
Assignee | ||
Comment 15•1 year ago
|
||
Assignee | ||
Comment 16•1 year ago
|
||
Assignee | ||
Comment 17•1 year ago
|
||
Assignee | ||
Comment 18•1 year ago
|
||
Assignee | ||
Comment 19•1 year ago
|
||
This reverts commit 5f149f8b11b9f725663845475f2be0365f25575f.
Assignee | ||
Comment 20•1 year ago
|
||
Assignee | ||
Comment 21•1 year ago
|
||
Assignee | ||
Comment 22•1 year ago
|
||
Assignee | ||
Comment 23•1 year ago
|
||
Assignee | ||
Comment 24•1 year ago
|
||
Assignee | ||
Comment 25•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 26•1 year ago
|
||
Comment 27•1 year ago
•
|
||
Backed out for causing spidermonkey bustages
- Backout link
- Push with failures
- Failure Log
- Failure Log 2
- Failure line: /builds/worker/checkouts/gecko/js/src/vm/Id.cpp:86:49: error: format specifies type 'unsigned long' but the argument has type 'uintptr_t' (aka 'unsigned int') [-Werror,-Wformat]
/builds/worker/checkouts/gecko/js/src/vm/Value.cpp:252:30: error: member reference type 'JSObject' is not a pointer; did you mean to use '.'?
Comment 28•1 year ago
|
||
Comment 29•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ca70023ae54b
https://hg.mozilla.org/mozilla-central/rev/a1b0aa328d77
https://hg.mozilla.org/mozilla-central/rev/82312c5cf445
https://hg.mozilla.org/mozilla-central/rev/07f3b0a19ff5
https://hg.mozilla.org/mozilla-central/rev/e3f72d580893
https://hg.mozilla.org/mozilla-central/rev/865ed9e42941
https://hg.mozilla.org/mozilla-central/rev/d2f48f681ab4
https://hg.mozilla.org/mozilla-central/rev/be5cab83ca84
https://hg.mozilla.org/mozilla-central/rev/520e28927657
https://hg.mozilla.org/mozilla-central/rev/54687ab737ec
https://hg.mozilla.org/mozilla-central/rev/03ce887fcd1a
https://hg.mozilla.org/mozilla-central/rev/3b7fb84c8ac8
https://hg.mozilla.org/mozilla-central/rev/41ba51bc740b
https://hg.mozilla.org/mozilla-central/rev/8d7916c07be5
https://hg.mozilla.org/mozilla-central/rev/f856e45cb9b9
https://hg.mozilla.org/mozilla-central/rev/dfc51d76c7f3
https://hg.mozilla.org/mozilla-central/rev/f5698a260f72
https://hg.mozilla.org/mozilla-central/rev/b26174e58a5e
https://hg.mozilla.org/mozilla-central/rev/1cc0fa18c2bf
Assignee | ||
Updated•1 year ago
|
Description
•