RESOLVED FIXED227271
Run lazy properties initializers under a DeferTerminationForAWhile scope
https://bugs.webkit.org/show_bug.cgi?id=227271
Summary Run lazy properties initializers under a DeferTerminationForAWhile scope
Saam Barati
Reported 2021-06-22 14:49:04 PDT
...
Attachments
patch (2.76 KB, patch)
2021-06-22 15:07 PDT, Saam Barati
no flags
Saam Barati
Comment 1 2021-06-22 15:07:25 PDT
Mark Lam
Comment 2 2021-06-22 15:12:30 PDT
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)`.
Mark Lam
Comment 3 2021-06-22 15:32:37 PDT
(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.
Yusuke Suzuki
Comment 4 2021-06-22 16:49:00 PDT
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.
EWS
Comment 5 2021-06-23 08:20:22 PDT
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].
Radar WebKit Bug Importer
Comment 6 2021-06-23 08:21:48 PDT
Note You need to log in before you can comment on or make changes to this bug.