public TotemDynamicStackFrame(CodeContext/*!*/ context, FunctionCode/*!*/ funcCode, int line) : base(GetMethod(context, funcCode), funcCode.Code.Name, funcCode.File, line) { Assert.NotNull(context, funcCode); _context = context; _code = funcCode; }
private static MethodBase GetMethod(CodeContext context, FunctionCode funcCode) { MethodBase method; Debug.Assert(funcCode._normalDelegate != null || funcCode._tracingDelegate != null); if (!context.LanguageContext.EnableTracing || funcCode._tracingDelegate == null) { method = funcCode._normalDelegate.GetMethodInfo(); } else { method = funcCode._tracingDelegate.GetMethodInfo(); } return method; }
public TotemFunction(CodeContext/*!*/ context, FunctionCode code, TotemDictionary globals, string name, object[] defaults, object[] closure) : base(context.LanguageContext.GetType<Types.Function>()) { Assert.NotNull(context, code); _context = context; _defaults = defaults ?? ArrayUtils.EmptyObjects; _code = code; _name = code.Name; Debug.Assert(_defaults.Length <= code.ArgCount); Closure = closure; }
protected void PushFrame(CodeContext context, FunctionCode code) { if (((TotemContext)SourceUnit.LanguageContext).TotemOptions.Frames) { throw new NotImplementedException(); //TotemOps.PushFrame(context, code); } }
public TargetUpdaterForCompilation(TotemContext context, FunctionCode code) { _code = code; _context = context; }
public static object MakeFunctionDebug(CodeContext context, FunctionCode funcInfo, object modName, MutableTuple closure, object[] defaults, Delegate target) { funcInfo.SetDebugTarget(context.LanguageContext, target); return new TotemFunction(context, funcInfo, modName, defaults, closure); }
public static object MakeFunction(CodeContext context, FunctionCode funcInfo, object modName, MutableTuple closure, object[] defaults) { return new TotemFunction(context, funcInfo, modName, defaults, closure); }
public static void UpdateStackTrace(Exception e, CodeContext context, FunctionCode funcCode, int line) { if (line != -1) { Debug.Assert(line != SourceLocation.None.Line); List<DynamicStackFrame> totemFrames = e.GetFrameList(); if (totemFrames == null) { e.SetFrameList(totemFrames = new List<DynamicStackFrame>()); } var frame = new TotemDynamicStackFrame(context, funcCode, line); funcCode.LightThrowCompile(context); totemFrames.Add(frame); } }
protected void PushFrame(CodeContext context, FunctionCode code) { // push if full frame (not supported yet) }
public static object MakeFunctionDebug(CodeContext/*!*/ context, FunctionCode funcInfo, string name, string[] argNames, object[] defaults, Delegate target) { funcInfo.SetDebugTarget(context.LanguageContext, target); return new TotemFunction(context, funcInfo, null, name, /*argNames, */defaults, null); }
internal virtual void RewriteBody(TotemAst.LookupVisitor visitor) { _funcCode = null; }
public static object MakeFunction(CodeContext/*!*/ context, FunctionCode funcInfo, string name, string[] argNames, object[] defaults) { return new TotemFunction(context, funcInfo, null, name, /*argNames, */defaults, null); }
private object OptimizedEvalWrapper(FunctionCode funcCode) { try { return _optimizedTarget(funcCode); } catch (Exception e) { throw new NotImplementedException(); //PythonOps.UpdateStackTrace(e, _optimizedContext, Code, 0); //throw; } }
internal override void RewriteBody(TotemAst.LookupVisitor visitor) { _funcCode = null; }
public TotemDebuggingPayload(FunctionCode code) { Code = code; }
private object OptimizedEvalWrapper(FunctionCode funcCode) { try { return _optimizedTarget(funcCode); } catch (Exception e) { TotemOps.UpdateStackTrace(e, _optimizedContext, Code, 0); throw; } }