private void EnsureTracingTarget() {
if (_tracingTarget == null) {
PythonContext pc = (PythonContext)Ast.CompilerContext.SourceUnit.LanguageContext;
var debugProperties = new PythonDebuggingPayload(null);
var debugInfo = new Microsoft.Scripting.Debugging.CompilerServices.DebugLambdaInfo(
null, // IDebugCompilerSupport
null, // lambda alias
false, // optimize for leaf frames
null, // hidden variables
null, // variable aliases
debugProperties // custom payload
);
var lambda = (Expression<LookupCompilationDelegate>)pc.DebugContext.TransformLambda((MSAst.LambdaExpression)Ast.GetLambda().Reduce(), debugInfo);
LookupCompilationDelegate func;
if (ShouldInterpret(pc)) {
func = (LookupCompilationDelegate)CompilerHelpers.LightCompile(lambda, pc.Options.CompilationThreshold);
} else {
func = (LookupCompilationDelegate)lambda.Compile(pc.EmitDebugSymbols(Ast.CompilerContext.SourceUnit));
}
_tracingTarget = func;
debugProperties.Code = EnsureFunctionCode(_tracingTarget, true, true);
}
}
}