Bug 126543 - FTL should ascribe range meta-data when loading array.length
Summary: FTL should ascribe range meta-data when loading array.length
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 112840
  Show dependency treegraph
 
Reported: 2014-01-06 15:41 PST by Filip Pizlo
Modified: 2014-01-30 13:30 PST (History)
9 users (show)

See Also:


Attachments
the patch (19.42 KB, patch)
2014-01-19 17:20 PST, Filip Pizlo
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2014-01-06 15:41:01 PST
This will allow some interesting optimizations on the LLVM side.
Comment 1 Filip Pizlo 2014-01-19 17:20:46 PST
Created attachment 221604 [details]
the patch
Comment 2 Filip Pizlo 2014-01-19 17:22:34 PST
Landed in branch in http://trac.webkit.org/changeset/162299
Comment 3 Geoffrey Garen 2014-01-19 17:59:37 PST
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"?
Comment 4 Filip Pizlo 2014-01-19 18:12:23 PST
(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.