This will allow some interesting optimizations on the LLVM side.
Created attachment 221604 [details] the patch
Landed in branch in http://trac.webkit.org/changeset/162299
Comment on attachment 221604 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=221604&action=review r=me > Source/JavaScriptCore/ftl/FTLCommonValues.cpp:65 > + , nonNegativeInt32(constInt(int32, 0, SignExtend), constInt(int32, 1ll << 31, SignExtend)) Why the "ll" after the "1"?
(In reply to comment #3) > (From update of attachment 221604 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=221604&action=review > > r=me > > > Source/JavaScriptCore/ftl/FTLCommonValues.cpp:65 > > + , nonNegativeInt32(constInt(int32, 0, SignExtend), constInt(int32, 1ll << 31, SignExtend)) > > Why the "ll" after the "1"? constInt() takes a long long, so I figured that I'd avoid all ambiguity in the implicit integer casting by just starting out with 1 being a long long. Also, "1" is a 32-bit int and 2^31 isn't a valid 32-bit int value. So, 1 << 31 is subject to some overflow rules, and I don't feel like figuring out what exactly they are. It's one of those things that feels like it might fall under undefined behavior and I don't like having to think about that.