성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Roll A Lisp In C - Reading ; https...
[정성태] Java - How to use the Foreign Funct...
[정성태] 제가 큰 실수를 했군요. ^^; Delegate를 통한 Bein...
[정성태] Working with Rust Libraries from C#...
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
닷넷
.NET 3.0
.NET 3.5
.NET 4.0
VC++
개발 환경 구성
제품 소개
VS.NET IDE
Vista
Windows 7
Windows 8
Windows 서버
Team Foundation Server
IIS
디버깅 기술
Win32
64비트
오피스
웹
기타
Phone
부모글 보이기/감추기
내용
출처: <a href="http://blogs.msdn.com/jmstall/archive/2006/03/13/dead_code_elimination.aspx" target="_blank">http://blogs.msdn.com/jmstall/archive/2006/03/13/dead_code_elimination.aspx</a> <hr /> <div class="post"> <div class="postsub"> <h2> The JIT does dead-code elimination in Debuggable code</h2> <p> The desktop CLR JIT (at least x86) does dead-code elimination, even in debuggable code. This is obviously perfectly safe, transparent, (and good), from a program-execution perspective. But it can be a little surprising under the debugger because you can't set-next-statement (setip) to eliminated code.</p> <p> In other words, if you have this C# code:<br /> <font face="Courier New" size="2"> Console.WriteLine("Hi!");<br /> if (false) {<br /> Console.WriteLine("Boo!"); // <-- can't setip here<br /> }<br /> Console.WriteLine("Bye");</font></p> <p> You couldn't Set-next-statement to the "Boo!" line. Normally this is fine, but every now and then it gets me. I think code-generators are more likely to produce code like that than a real person. </p> <p> However, the JIT will not remove side-effect free expressions in debuggable code. For example, <br /> <font face="Courier New" size="2"> void Foo() {<br /> int x = 5;<br /> x ++; <br /> } </font> </p> <p> The JIT will not remove either of those lines, even though 'x' is unused and so they don't actually do anything for program behavior. This means you can still set and hit breakpoints on those lines, which is what you'd expect from debuggable (non-optimized) code. </p> <p> In optimized-code, anything's fair game and a function like Foo() would very likely be optimized out of existence.</p> <div class="postfoot"> Published Monday, March 13, 2006 5:44 PM by <a id="_ctl0____ctl0____ctl1___Entry___AuthorLink" href="/user/Profile.aspx?UserID=4072">jmstall</a> </div> </div> </div> <div id="postToolbar"> <h2 class="CommonSubTitle"> Comment Notification</h2> <p> If you would like to receive an email when updates are made to this post, please register <a id="_ctl0____ctl0____ctl1___DetailedSubBar___RegisterLink" href="/user/CreateUser.aspx?ReturnUrl=/jmstall/archive/2006/03/13/dead_code_elimination.aspx"> here</a> </p> <p> You can also stay up to date using your favorite aggregator by subscribing to the <a id="_ctl0____ctl0____ctl1___DetailedSubBar___CommentRssLink" href="/jmstall/commentrss.aspx?PostID=550769"> CommentRss Feed</a></p> </div>
첨부파일
스팸 방지용 인증 번호
1887
(왼쪽의 숫자를 입력해야 합니다.)