RESOLVED FIXED 215293
REGRESSION(r261159) PokerBros only shows black screen
https://bugs.webkit.org/show_bug.cgi?id=215293
Summary REGRESSION(r261159) PokerBros only shows black screen
Alex Christensen
Reported 2020-08-07 14:48:39 PDT
REGRESSION(r261159) PokerBros only shows black screen
Attachments
Patch (2.22 KB, patch)
2020-08-07 14:51 PDT, Alex Christensen
no flags
Patch (2.26 KB, patch)
2020-08-10 09:29 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2020-08-07 14:51:09 PDT
Keith Miller
Comment 2 2020-08-07 14:56:17 PDT
Comment on attachment 406216 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406216&action=review r=me with comment. > Source/JavaScriptCore/runtime/JSObject.cpp:519 > + static bool isPokerBros = CFEqual(CFBundleGetIdentifier(CFBundleGetMainBundle()), CFSTR("com.kpgame.PokerBros")) I forget the semantics of this? Is this only run once? I assume so but if not this is probably going to be a perf regression.
Alex Christensen
Comment 3 2020-08-07 14:58:46 PDT
Yes, function scoped static variables are initialized the first time the function is run. After that there is a read and a branch to check that it is initialized, then the stored value is returned. There are no atomic operations here, so this should be as little of a perf regression as possible.
Alex Christensen
Comment 4 2020-08-07 15:09:01 PDT
* because of the compile flags we use in WebKit, there are no atomic operations in this check. Normal C++ does have an atomic check for function scoped static variable initialization. http://trac.webkit.org/r265392
Radar WebKit Bug Importer
Comment 5 2020-08-07 15:09:32 PDT
Darin Adler
Comment 6 2020-08-07 16:23:23 PDT
Comment on attachment 406216 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406216&action=review >> Source/JavaScriptCore/runtime/JSObject.cpp:519 >> + static bool isPokerBros = CFEqual(CFBundleGetIdentifier(CFBundleGetMainBundle()), CFSTR("com.kpgame.PokerBros")) > > I forget the semantics of this? Is this only run once? I assume so but if not this is probably going to be a perf regression. Yes, static makes it only get run once.
WebKit Commit Bot
Comment 7 2020-08-09 21:47:44 PDT
Re-opened since this is blocked by bug 215316
Alex Christensen
Comment 8 2020-08-10 09:03:19 PDT
CFBundleGetIdentifier returns null in jsc, and probably some other non-bundle tools. I need to null check its return value, because passing null to CFEqual causes a crash. Will fix.
Alex Christensen
Comment 9 2020-08-10 09:29:00 PDT
Alex Christensen
Comment 10 2020-08-10 09:32:00 PDT
Simon Fraser (smfr)
Comment 11 2020-08-10 10:01:56 PDT
Comment on attachment 406300 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406300&action=review > Source/JavaScriptCore/runtime/JSObject.cpp:517 > +inline static bool isPokerBros() This name is a lie, because the function also checks the linked-on-or-after version. A better function name would be needsPokerBrosQuirk().
Darin Adler
Comment 12 2020-08-10 10:49:12 PDT
Comment on attachment 406300 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406300&action=review >> Source/JavaScriptCore/runtime/JSObject.cpp:517 >> +inline static bool isPokerBros() > > This name is a lie, because the function also checks the linked-on-or-after version. A better function name would be needsPokerBrosQuirk(). We should not write "inline" here. It’s not valuable to inline the one-time code into JSObject::toStringName, and in fact might be counterproductive.
Darin Adler
Comment 13 2020-08-10 10:51:05 PDT
Comment on attachment 406300 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406300&action=review > Source/JavaScriptCore/ChangeLog:10 > + The PokerBros app has some logic that was broken by the change in behavior of r261159. > + It caused the app do do nothing except show a black screen upon opening. > + Revert to the old behavior for this app until they update to iOS14. Normally we keep the quirks all in one place to help us remember to remove them over time. I worry that this one won’t be remembered.
Alex Christensen
Comment 14 2020-08-10 11:38:30 PDT
"inline" is just a suggestion, and might not even change the output of the compiler. __attribute__((always_inline)) forces the compiler to inline. I will remove the "inline" keyword, but I don't think that is necessary before this is copied to the branch. I'll also rename the function to needsPokerBrosQuirk later. We keep the quirks in the same place in WebCore, but this quirk is needed in JSC because it is in use of the JSC API in the app, not in web content. The JSC team keeps track of these quirks and removes them when they can.
Darin Adler
Comment 15 2020-08-10 11:41:13 PDT
(In reply to Alex Christensen from comment #14) > "inline" is just a suggestion Yes, fully aware of that. Just not necessarily a good suggestion in this case. > I don't think that is necessary before > this is copied to the branch. I agree. > We keep the quirks in the same place in WebCore, but this quirk is needed in > JSC because it is in use of the JSC API in the app, not in web content. The > JSC team keeps track of these quirks and removes them when they can. How do we keep track of them? Where are the others? I could imagine putting them all in one source file to keep track of them.
Alex Christensen
Comment 16 2020-08-10 11:44:31 PDT
(In reply to Darin Adler from comment #15) > How do we keep track of them? Where are the others? > > I could imagine putting them all in one source file to keep track of them. They are all in one source file because there is only one right now. Another one was removed in r234894
Note You need to log in before you can comment on or make changes to this bug.