[Webkit-unassigned] [Bug 122263] DFG: ConstProp the pattern ValueToInt32(Bool(x)) -> Int32(x)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 3 07:54:29 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=122263





--- Comment #6 from Filip Pizlo <fpizlo at apple.com>  2013-10-03 07:53:24 PST ---
(From update of attachment 213234)
View in context: https://bugs.webkit.org/attachment.cgi?id=213234&action=review

>> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:297
>> +                setConstant(node, JSValue(child.asBoolean()));
> 
> Is the goal here to convert the Boolean to a number?  If so, does JSValue(bool) accomplish this?  My guesses that if it does, it's sort of by luck and we'd want to call jsNumber() directly.

Ugh, yeah we don't have a JSValue(bool) overload. So this works - but I think it would be better to use jsNumber() here and in the case above. We've been considering getting rid of the JSValue(number) overloads because you can get quite confused in corner cases.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list