MCPcopy Index your code
hub / github.com/nodejs/node / processTick

Method processTick

deps/v8/tools/tickprocessor.mjs:838–871  ·  view source on GitHub ↗
(
        pc, ns_since_start, is_external_callback, tos_or_external_callback,
        vmState, stack)

Source from the content-addressed store, hash-verified

836 }
837
838 processTick(
839 pc, ns_since_start, is_external_callback, tos_or_external_callback,
840 vmState, stack) {
841 this.distortion += this.distortion_per_entry;
842 ns_since_start -= this.distortion;
843 if (ns_since_start < this.range_start || ns_since_start > this.range_end) {
844 return;
845 }
846 this.ticks_.total++;
847 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
848 if (!this.includeTick(vmState)) {
849 this.ticks_.excluded++;
850 return;
851 }
852 if (is_external_callback) {
853 // Don't use PC when in external callback code, as it can point
854 // inside callback's code, and we will erroneously report
855 // that a callback calls itself. Instead we use tos_or_external_callback,
856 // as simply resetting PC will produce unaccounted ticks.
857 pc = tos_or_external_callback;
858 tos_or_external_callback = 0;
859 } else if (tos_or_external_callback) {
860 // Find out, if top of stack was pointing inside a JS function
861 // meaning that we have encountered a frameless invocation.
862 const funcEntry = this.profile_.findEntry(tos_or_external_callback);
863 if (!funcEntry || !funcEntry.isJSFunction || !funcEntry.isJSFunction()) {
864 tos_or_external_callback = 0;
865 }
866 }
867
868 this.profile_.recordTick(
869 ns_since_start, vmState,
870 this.processStack(pc, tos_or_external_callback, stack));
871 }
872
873 advanceDistortion() {
874 this.distortion += this.distortion_per_entry;

Callers

nothing calls this directly

Calls 5

includeTickMethod · 0.95
recordTickMethod · 0.80
processStackMethod · 0.80
findEntryMethod · 0.45
isJSFunctionMethod · 0.45

Tested by

no test coverage detected