hw4-session

hw4-session - HW4 Finding Redundant Null Checks and Extra...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
HW4: Finding Redundant Null Checks and Extra Credit CS 243, Winter 2010-2011 CS243: Joeq Framework 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Null Checks Implicit in Java bytecode Explicit in Quads There can be many redundant ones ‹#› 2
Background image of page 2
Reasons for Redundant Null Checks A common design pattern to reduce the compiler complexity: each pass has one clearly defined goal and does exactly that, not more. Example: copy propagation can generate dead code, but it delegates the cleanup to dead code elimination. Joeq has a simple pass for null check insertion and relies on the following redundant elimination passes. ‹#› 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example 1 MOVE T1 String, T0 String 2 NULL_CHECK T-1 <g>, T1 String 3 MOVE T2 String, T1 String 4 NULL_CHECK T-1 <g>, T0 String 5 NULL_CHECK T-1 <g>, T1 String 6 NULL_CHECK T-1 <g>, T2 String ‹#› 4
Background image of page 4
Goal Print out quad ids of redundant null checks This is an analysis, not a transformation. i.e., You don’t need to remove the redundant null checks ‹#› 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Inside optimize.tar.gz FindRedundantNullChecks.java: you need to fill out
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 03/12/2012.

Page1 / 13

hw4-session - HW4 Finding Redundant Null Checks and Extra...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online