Bug 146867 - AI folding of IsObjectOrNull is broken for non-object types that may be null
Summary: AI folding of IsObjectOrNull is broken for non-object types that may be null
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:
 
Reported: 2015-07-10 19:24 PDT by Filip Pizlo
Modified: 2015-07-10 20:03 PDT (History)
13 users (show)

See Also:


Attachments
the patch (4.06 KB, patch)
2015-07-10 19:26 PDT, Filip Pizlo
rniwa: 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 2015-07-10 19:24:22 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2015-07-10 19:26:27 PDT
Created attachment 256638 [details]
the patch
Comment 2 WebKit Commit Bot 2015-07-10 19:29:32 PDT
Attachment 256638 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1044:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1053:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Ryosuke Niwa 2015-07-10 19:51:13 PDT
Comment on attachment 256638 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=256638&action=review

> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1056
> +            if (!(child.m_type & ((SpecObject - SpecFunction) | SpecOther))) {

Can we define a local variable immediately before this line to reduce the number of parentheses involved?
e.g.
SpeculatedType nonFunctionObject = ((SpecObject - SpecFunction) | SpecOther);
Comment 4 Ryosuke Niwa 2015-07-10 19:53:24 PDT
or maybe an inline helper function somewhere?
Comment 5 Filip Pizlo 2015-07-10 19:59:52 PDT
(In reply to comment #3)
> Comment on attachment 256638 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=256638&action=review
> 
> > Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1056
> > +            if (!(child.m_type & ((SpecObject - SpecFunction) | SpecOther))) {
> 
> Can we define a local variable immediately before this line to reduce the
> number of parentheses involved?
> e.g.
> SpeculatedType nonFunctionObject = ((SpecObject - SpecFunction) | SpecOther);

Well, we could, but nonFunctionObject would be the wrong name for this.  It's really nonFunctionObjectOrUndefinedOrNull.  At that point, the variable name is more complicated than the set expression!
Comment 6 Filip Pizlo 2015-07-10 20:00:07 PDT
(In reply to comment #4)
> or maybe an inline helper function somewhere?

https://bugs.webkit.org/show_bug.cgi?id=146870
Comment 7 Filip Pizlo 2015-07-10 20:03:09 PDT
Landed in http://trac.webkit.org/changeset/186702