Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/heap-analysis/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  findPath.js

  Sprache: JAVA
 

load(libdir + "match.js")

// At the moment, findPath just returns the names as provided by ubi::Node,
// which just uses js::TraceChildren for now. However, we have various plans
// to improve the quality of ubi::Node's metadata, to improve the precision
// and clarity of the results here.

var o = { w: { x: { y: { z: {} } } } };
Match.Pattern([{node: {}, edge: "w"},
               {node: {}, edge: "x"},
               {node: {}, edge: "y"},
               {node: {}, edge: "z"}])
  .assert(findPath(o, o.w.x.y.z));
print(JSON.stringify(findPath(o, o.w.x.y.z)));

var a = [ , o ];
Match.Pattern([{node: {}, edge: "objectElements[1]"}])
  .assert(findPath(a, o));
print(JSON.stringify(findPath(a, o)));

function C() {}
C.prototype.obj = {};
var c = new C;
Match.Pattern([{node: {}, edge: "shape"},
               {node: Match.Pattern.ANY, edge: "base"},
               {node: Match.Pattern.ANY, edge: "baseshape_proto"},
               {node: { constructor: Match.Pattern.ANY }, edge: "obj"}])
  .assert(findPath(c, c.obj));
print(JSON.stringify(findPath(c, c.obj)));

function f(x) { return function g(y) { return x+y; }; }
var o = {}
var gc = f(o);
Match.Pattern([{node: gc, edge: "**UNKNOWN SLOT 1**"},
               {node: Match.Pattern.ANY, edge: "x"}])
  .assert(findPath(gc, o));
print(JSON.stringify(findPath(gc, o)));

Match.Pattern([{node: {}, edge: "shape"},
               {node: Match.Pattern.ANY, edge: "base"},
               {node: Match.Pattern.ANY, edge: "baseshape_global"},
               {node: {}, edge: "o"}])
  .assert(findPath(o, o));
print(findPath(o, o).map((e) => e.edge).toString());

// Check that we can generate ubi::Nodes for Symbols.
var so = { sym: Symbol() };
Match.Pattern([{node: {}, edge: "sym" }])
  .assert(findPath(so, so.sym));
print(findPath(so, so.sym).map((e) => e.edge).toString());

Messung V0.5 in Prozent
C=90 H=82 G=86

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.