WebKit Bugzilla
Attachment 343430 Details for
Bug 186966
: [bmalloc][Linux] Remove static initializers for PerProcess<>::s_object
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186966-20180623193939.patch (text/plain), 2.28 KB, created by
Yusuke Suzuki
on 2018-06-23 03:39:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-06-23 03:39:40 PDT
Size:
2.28 KB
patch
obsolete
>Subversion Revision: 233123 >diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog >index 8b6caf2c57f800cd0f3572235b59b90a6b21e31b..ced6decf30aac9e6b2b66bb24d915a6294c7eaf0 100644 >--- a/Source/bmalloc/ChangeLog >+++ b/Source/bmalloc/ChangeLog >@@ -1,3 +1,29 @@ >+2018-06-23 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [bmalloc][Linux] Remove static initializers for PerProcess<>::s_object >+ https://bugs.webkit.org/show_bug.cgi?id=186966 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ chrome/tools/linux/dump-static-initializers.py can dump static initializers >+ in the binary and we found that PerProcess<>::s_object initialization is done >+ by static initializers in GCC + Linux environments. The example is the following. >+ >+ Scavenger.cpp (initializer offset 0x38c210 size 0x3e) >+ _GLOBAL__sub_I_Scavenger.cpp+0x1e >+ _GLOBAL__sub_I_Scavenger.cpp+0x2d >+ _GLOBAL__sub_I_Scavenger.cpp+0x3c >+ _GLOBAL__sub_I_Scavenger.cpp+0xf >+ guard variable for bmalloc::PerProcess<bmalloc::AllIsoHeaps>::s_object@@Base-0x3f0d8 >+ guard variable for bmalloc::PerProcess<bmalloc::Environment>::s_object@@Base-0x3f0e8 >+ guard variable for bmalloc::PerProcess<bmalloc::PerHeapKind<bmalloc::Heap> >::s_object@@Base-0x3c600 >+ guard variable for bmalloc::PerProcess<bmalloc::Scavenger>::s_object@@Base-0x38ce8 >+ >+ We can remove this by initializing `nullptr`, which leads to constexpr initialization. >+ After this change, Linux JSCOnly libJavaScriptCore.so has no static initializers. >+ >+ * bmalloc/PerProcess.h: >+ > 2018-06-09 Dan Bernstein <mitz@apple.com> > > [Xcode] Clean up and modernize some build setting definitions >diff --git a/Source/bmalloc/bmalloc/PerProcess.h b/Source/bmalloc/bmalloc/PerProcess.h >index 5a4d49f85711f35babe5997340e629f621635570..d263801578023c1e07052769526f474654e1f8a2 100644 >--- a/Source/bmalloc/bmalloc/PerProcess.h >+++ b/Source/bmalloc/bmalloc/PerProcess.h >@@ -123,9 +123,9 @@ class PerProcess { > }; > > template<typename T> >-std::atomic<T*> PerProcess<T>::s_object; >+std::atomic<T*> PerProcess<T>::s_object { nullptr }; > > template<typename T> >-PerProcessData* PerProcess<T>::s_data; >+PerProcessData* PerProcess<T>::s_data { nullptr }; > > } // namespace bmalloc
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186966
: 343430