https://chromiumcodereview.appspot.com/10825071/diff/1/src/hydrogen-instructions.cc File src/hydrogen-instructions.cc (right):
https://chromiumcodereview.appspot.com/10825071/diff/1/src/hydrogen-instructions.cc#newcode1151 src/hydrogen-instructions.cc:1151: if (change->value()->IsDiv() && I am a little bit uncomfortable that we apply this optimization to any d to i change, even those that are not truncating. Changes can be inserted optimistically and they deopt when they see a value not representable as integer. So it seems suspicious that such optimistic change can be removed by an opt. https://chromiumcodereview.appspot.com/10825071/diff/1/src/hydrogen-instructions.cc#newcode1159 src/hydrogen-instructions.cc:1159: if (div->UseCountIgnoringInputsRequiringNone() == 1) { I am not sure that your approach to simulates is correct. First of all simulate does need a resulting value e.g. it can be stored into a local, so after deopt local will see integer not double. Secondly, imagine that we have a simulate followed by a map check that ensures that we actually store into int32 array (and thus we convert to int32) -> if map check fails simulate we will deopt into an incorrect state with a value truncated to int32. (Pseudo)HIR to illustrate: d4 = Div d2, d3 Simulate push d4 i5 = Change d to i d4 CheckMaps t0 StoreFastKeyedExternalElement t0[i1] = i5 https://chromiumcodereview.appspot.com/10825071/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
