override fun onMethodCall()

in trace-recorder/src/main/org/jetbrains/lincheck/trace/recorder/TraceCollectingEventTracker.kt [571:604]


    override fun onMethodCall(
        threadDescriptor: ThreadDescriptor,
        codeLocation: Int,
        methodId: Int,
        receiver: Any?,
        params: Array<Any?>,
        interceptor: ResultInterceptor?,
    ): Unit = threadDescriptor.runInsideInjectedCode {
        val threadData = threadDescriptor.eventTrackerData as? ThreadData? ?: return
        val methodDescriptor = context.getMethodDescriptor(methodId)

        val methodSection = methodAnalysisSectionType(receiver, methodDescriptor.className, methodDescriptor.methodName)

        // Should this method call be ignored?
        if (methodSection == AnalysisSectionType.IGNORED) {
            threadData.enterAnalysisSection(methodSection)
            return
        }

        val parentTracepoint = threadData.currentTopTracePoint()
        val tracePoint = TRMethodCallTracePoint(
            context = context,
            threadId = threadData.threadId,
            codeLocationId = codeLocation,
            methodId = methodId,
            obj = TRObjectOrNull(context, receiver),
            parameters = params.map { TRObjectOrNull(context, it) },
            parentTracePoint = parentTracepoint,
        )
        strategy.tracePointCreated(parentTracepoint, tracePoint)
        threadData.pushStackFrame(tracePoint, receiver, isInline = false)
        // if the method has certain guarantees, enter the corresponding section
        threadData.enterAnalysisSection(methodSection)
    }