logoalt Hacker News

mikehall314last Sunday at 2:13 PM1 replyview on HN

Supposedly, although the team at Apple were able to implement it. I think they had some oddly named technology like Chicken which created a shadow stack trace? Half remembered.


Replies

senfiajlast Sunday at 3:54 PM

Yes, It's called ShadowChicken, and it has negative implications for debuggability. To make debugging tolerable, JavaScriptCore added an (intentionally silly) mechanism called ShadowChicken: a shadow stack used by Web Inspector that can show a finite number of tail-deleted frames (they mention 128). It's has some tradeoff.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... .

https://webkit.org/blog/6240/ecmascript-6-proper-tail-calls-...

V8 team decided that it's not worth it, since proper stack traces (such as Error.stack) are essential for some libraries, such as Sentry (!). Removing some stack trace info can break some code. Also imagine you have missing info from the error stack trace in production code running on NodeJS, that's not good. If you need TCO, you can compile that code in WASM. V8 does TCO in WASM.