1. A method of optimizing software code, comprising: determining an expected value of a dynamic attribute that cannot be determined prior to runtime of an associated software code to be guaranteed to have the expected value at runtime; and generating an optimized version of the software code, including by optimizing the optimized version based on an assumption that the dynamic attribute will have the expected value.