[Webkit-unassigned] [Bug 39243] Auto-generate Canvas overloads in JSC

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 17 15:29:19 PDT 2010


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





--- Comment #2 from Darin Adler <darin at apple.com>  2010-05-17 15:29:19 PST ---
(From update of attachment 56277)
The code to check for overloads seems unnecessarily inefficient to me. I see expressions that repeat args.at(0) over and over again; this is inefficient since each instance will check the "0" against the number of arguments and the work to fetch the argument is also repeated. Also, in these expressions we have already checked the number of arguments explicitly so rechecking seems wrong. The generated code also checks isNull || isUndefined rather than using isUndefinedOrNull.

> -    if (args.size() <= 4)
> -        context->strokeRect(args.at(0).toFloat(exec), args.at(1).toFloat(exec),
> -                            args.at(2).toFloat(exec), args.at(3).toFloat(exec));
> -    else
> -        context->strokeRect(args.at(0).toFloat(exec), args.at(1).toFloat(exec),
> -                            args.at(2).toFloat(exec), args.at(3).toFloat(exec), args.at(4).toFloat(exec));

This allows 1, 2, 3, and 6 parameters. But the auto-generated code work for exactly 4 and exactly 5 arguments. Is this a change we want?

We should do these conversions one function at a time. It's hard for me to review all of these in one batch to see which ones have changes in behavior. I want to know that each conversion has test cases and is behaving correctly for those test 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