RESOLVED FIXED 159321
Update JSC_functionOverrides to handle the new SourceCode strings that have params.
https://bugs.webkit.org/show_bug.cgi?id=159321
Summary Update JSC_functionOverrides to handle the new SourceCode strings that have p...
Mark Lam
Reported 2016-06-30 16:01:30 PDT
And add tests so that this won't fail silently and bit rot anymore. Patch coming.
Attachments
proposed patch. (18.70 KB, patch)
2016-06-30 16:07 PDT, Mark Lam
no flags
proposed patch 2: fixed EWS complaint. (18.72 KB, patch)
2016-06-30 17:58 PDT, Mark Lam
ggaren: review+
Mark Lam
Comment 1 2016-06-30 16:07:06 PDT
Created attachment 282487 [details] proposed patch.
Mark Lam
Comment 2 2016-06-30 17:58:35 PDT
Created attachment 282498 [details] proposed patch 2: fixed EWS complaint.
Geoffrey Garen
Comment 3 2016-07-01 09:24:57 PDT
Comment on attachment 282498 [details] proposed patch 2: fixed EWS complaint. View in context: https://bugs.webkit.org/attachment.cgi?id=282498&action=review > Source/JavaScriptCore/tools/FunctionOverrides.cpp:153 > + String sourceString = origCode.view().toString(); > + size_t sourceBodyStart = sourceString.find('{'); > + if (sourceBodyStart == notFound) > + return false; > + String sourceBodyString = sourceString.substring(sourceBodyStart); > + > + auto it = overrides.m_entries.find(sourceBodyString); This is OK -- but I think it might be better to allow the author to override parameter declaration too.
Mark Lam
Comment 4 2016-07-01 09:32:11 PDT
(In reply to comment #3) > Comment on attachment 282498 [details] > proposed patch 2: fixed EWS complaint. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=282498&action=review > > > Source/JavaScriptCore/tools/FunctionOverrides.cpp:153 > > + String sourceString = origCode.view().toString(); > > + size_t sourceBodyStart = sourceString.find('{'); > > + if (sourceBodyStart == notFound) > > + return false; > > + String sourceBodyString = sourceString.substring(sourceBodyStart); > > + > > + auto it = overrides.m_entries.find(sourceBodyString); > > This is OK -- but I think it might be better to allow the author to override > parameter declaration too. I'll leave overriding parameters to another patch. As far as I can tell, the uses of overriding parameters are: 1. Ability to use different argument names for better readability (especially if we're replacing an obfuscated function). 2. Ability to force stack arity adjustments. I think (2) is the more meaningful reason for overriding parameters, but the need for that is probably rare. I filed https://bugs.webkit.org/show_bug.cgi?id=159355 to track this for future work.
Mark Lam
Comment 5 2016-07-01 09:39:32 PDT
Thanks for the review. Landed in r202737: <http://trac.webkit.org/r202737>.
Note You need to log in before you can comment on or make changes to this bug.