TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Browser as an Interactive Disassembler (2015)

66 pointsby Halienjaabout 9 years ago

2 comments

userbinatorabout 9 years ago
<i>The code produced by a compiler is usually well-behaved: it uses well-defined calling conventions, keeps the stack balanced, does not self-modify at all or limits self-modification to certain sites.</i><p>Incidentally, this is one of the ways in which you can distinguish between compiler output and human-written Asm... and likewise, why compilers just &quot;aren&#x27;t quite there&quot; in terms of &quot;extreme&quot; optimisation. Calling conventions are pretty much the first thing to go; it&#x27;s common to have functions that return as many values as there are registers, use a per-function combination of registers for arguments&#x2F;return values, or access its <i>caller</i>&#x27;s &quot;local variables&quot; directly --- all of which compilers would find very difficult to produce via optimisation even if it could be expressed in the higher-level language.
评论 #11748552 未加载
rosstexabout 9 years ago
TLDR; Compilers break a for loop into three distinct loop portions -- a main loop where special invariants are satisfied (and thus less checks are required), and pre&#x2F;post loops with additional bounds checks.