mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
68b323635d
TLDR: Remove broken code which constructs stackTrace(). Happy never to have to read those NOTE(MH) comments in the pushLocation code again! (1) This code was fundamentally broken for various reasons: - It doesn't make sense to track location info on the continuation stack. The continuation stack is a record of the evaluation still to come; not a context for the current evaluation. - Stack traces can't sensibly be provided in a language such as Daml which promises that tail-recursion is evaluated in constant stack-space. - Attempting to keep location info on the continuation stack does not play well when exceptions are thrown and the stack is unwound. (2) The stack-trace management code was also very hacky: - The pushLocation code contained special cases when the continuation stack was headed by a KArg/SToken continuation. This is an internal implementation detail. The KArg doesn't even exist when we stop using the deprecated SEAppGeneral expression constructor. - The pushLocation code also contained special support for copying stack-traces into SEVal and SDefinition caches, and then later back on to the continuation stack. Yuck! (3) The stackTrace() code was barely used: - Some time ago an alternative/simpler location tracking system (lastLocation) was implemented. - Only ScenarioRunner makes use of the stackTrace() - Only a single test changes behaviour when we drop use of stackTrace() in favour of getLastLocation |
||
---|---|---|
.. | ||
src | ||
BUILD.bazel |