Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openjdk/src/hotspot/cpu/s390/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 135 kB image not shown  

SSL async-implicit.js   Sprache: JAVA

 

// Test AutoSetAsyncStackForNewCalls's IMPLICIT kind.

// Given a SavedFrame stack, return a string listing the frame's function names
// and their async causes, if any.
function stackFunctions(stack) {
  const frames = [];
  for (; stack; stack = stack.parent || stack.asyncParent) {
    if (!stack.functionDisplayName) {
      frames.push('(top level)');
    } else if (stack.asyncCause) {
      frames.push(`${stack.asyncCause}*${stack.functionDisplayName}`);
    } else {
      frames.push(stack.functionDisplayName);
    }
  }
  return frames.join(', ');
}

let fakeStack = (function fake1() {
  function fake2() {
    return saveStack();
  }
  return fake2();
})();

function bindAndExpect(options, expected) {
  function bindee() {
    assertEq(stackFunctions(saveStack()), expected);
  }

  return bindToAsyncStack(bindee, options);
}

function caller(f) {
  return f();
}

// An explicit async stack always overrides the actual callers of the bindee.
// An implicit async stack never overrides callers; it is only attached when
// the stack is otherwise empty.
caller(bindAndExpect({ stack: fakeStack, cause: 'ano', explicit: false },
                     "bindee, caller, (top level)"));

caller(bindAndExpect({ stack: fakeStack, cause: 'hi', explicit: true },
                     "bindee, hi*fake2, fake1, (top level)"));

Promise.resolve()
  .then(function () {
    bindAndExpect({ stack: fakeStack, cause: 'hana', explicit: true },
                  "bindee, hana*fake2, fake1, (top level)");
  });
Promise.resolve()
  .then(function () {
    bindAndExpect({ stack: fakeStack, cause: 'hana', explicit: true },
                  "bindee, hana*fake2, fake1, (top level)");
  });

Messung V0.5 in Prozent
C=90 H=92 G=90

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet am  2026-09-27) ¤

*© 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.