| Summary: | Run lazy properties initializers under a DeferTerminationForAWhile scope | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> | ||||
| Component: | JavaScriptCore | Assignee: | Saam Barati <saam> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, msaboff, tzagallo, webkit-bug-importer, ysuzuki | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Saam Barati
2021-06-22 14:49:04 PDT
Created attachment 431999 [details]
patch
Comment on attachment 431999 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=431999&action=review r=me with fix. > Source/JavaScriptCore/runtime/LazyPropertyInlines.h:52 > + static const FuncType theFunc = &callFunc<Func>; > m_pointer = lazyTag | bitwise_cast<uintptr_t>(&theFunc); This looks wrong. Note use of `bitwise_cast<uintptr_t>(&theFunc)`. (In reply to Mark Lam from comment #2) > Comment on attachment 431999 [details] > > Source/JavaScriptCore/runtime/LazyPropertyInlines.h:52 > > + static const FuncType theFunc = &callFunc<Func>; > > m_pointer = lazyTag | bitwise_cast<uintptr_t>(&theFunc); > > This looks wrong. Note use of `bitwise_cast<uintptr_t>(&theFunc)`. I was wrong. The `&` in `bitwise_cast<uintptr_t>(&theFunc)` is deliberate and needed. Saam's addition of `&` before `callFunc<Func>` doesn't matter (at least in C). I'm not sure about C++. If it builds, it is good. Comment on attachment 431999 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=431999&action=review >>> Source/JavaScriptCore/runtime/LazyPropertyInlines.h:52 >>> m_pointer = lazyTag | bitwise_cast<uintptr_t>(&theFunc); >> >> This looks wrong. Note use of `bitwise_cast<uintptr_t>(&theFunc)`. > > I was wrong. The `&` in `bitwise_cast<uintptr_t>(&theFunc)` is deliberate and needed. Saam's addition of `&` before `callFunc<Func>` doesn't matter (at least in C). I'm not sure about C++. If it builds, it is good. Either adding & or not does not matter here. `callFunc<Func>` is function-type. But it is implicitly decayed to function-pointer-type when assigning it to theFunc. So, `&` in `static const FuncType theFunc = &callFunc<Func>;` does not matter. The same thing will happen. Committed r279167 (239064@main): <https://commits.webkit.org/239064@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431999 [details]. |