processor.ts ×5

Frontier kind: Code frontier

unlabeled · c_3d28bef58383

406 tests · 5345 LOC · 31 files · introduces 0 tests · 43 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges43 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
728 ranges5345 lines · 31 files · Browse complete extent
All tests (intent)
406 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 43 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/test/common/virtualScheduling/processor.ts 32 introduced LOC · 5 ranges

Open complete file

234 this._settleFinishedRuns();
235 if (this._runs.size === 0) { return 'quiesce'; }
236 > processor.ts
237 > const next = this._clock.peekNext();
238 > if (next === undefined) { return 'park'; }
239 >
240 > // Per-run trace-depth check: reject any run whose limit this event
241 > // would exceed, before executing.
242 const traceDepth = next.trace?.depth ?? 0;
243 let depthOverflow = false;
244 for (const run of [...this._runs.keys()]) {
245 > const limit = run.options.maxTraceDepth; processor.ts
246 > if (limit !== undefined && traceDepth > limit) {
247 this._settleRun(run, this._buildDepthOverflow(run, traceDepth));
248 depthOverflow = true;
249 }
250 > } processor.ts
251 > if (depthOverflow) { return 'progress'; }
252 >
253 > this._executeOne(next);
254 > return 'progress';
255 }
256
257 private _executeOne(event: VirtualEvent): void {
258 > try { processor.ts
259 > TraceContext.instance.runAsHandler(
260 > event.trace ?? ROOT_TRACE,
261 > () => {
262 > const e = this._clock.runNext();
263 > if (e) {
264 > this._history.push(e);
265 > this._executedTotal++;
266 > }
267 > },
268 > {
269 > // Route the trace-reset through the same host primitive
270 > // the embedding uses, so there is no race between this
271 > // timer and the embedding's next hop.
272 > afterMicrotaskClosure: cb => nextMacrotask(this._realApi, cb),
273 > },
274 > );
275 > } catch (e) {
276 const err = e instanceof Error ? e : new Error(String(e));
277 // We can't tell which run "owned" the throwing event. Reject all
279 for (const run of [...this._runs.keys()]) { this._settleRun(run, err); }
280 }
281 > } processor.ts
282
283 // ---- The trampoline -------------------------------------------------
src/vs/base/test/common/virtualScheduling/virtualClock.ts 11 introduced LOC · 2 ranges

Open complete file

81
82 runNext(): VirtualEvent | undefined {
83 > const e = this._queue.removeMin(); virtualClock.ts
84 > if (e) {
85 > this._now = e.time;
86 > e.run();
87 > }
88 > return e;
89 > }
90
91 getEvents(): readonly VirtualEvent[] { return this._queue.toSortedArray(); }
115
116 private _ensureSorted(): void {
117 > if (this._sorted) { return; } virtualClock.ts
118 > this._items.sort(this._compare);
119 > this._sorted = true;
120 > }
121 }