Title: [233134] trunk/Source/bmalloc
- Revision
- 233134
- Author
- [email protected]
- Date
- 2018-06-24 12:01:22 -0700 (Sun, 24 Jun 2018)
Log Message
[bmalloc][Linux] Remove static initializers for PerProcess<>::s_object
https://bugs.webkit.org/show_bug.cgi?id=186966
Reviewed by Anders Carlsson.
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:
Modified Paths
Diff
Modified: trunk/Source/bmalloc/ChangeLog (233133 => 233134)
--- trunk/Source/bmalloc/ChangeLog 2018-06-24 16:59:55 UTC (rev 233133)
+++ trunk/Source/bmalloc/ChangeLog 2018-06-24 19:01:22 UTC (rev 233134)
@@ -1,3 +1,29 @@
+2018-06-24 Yusuke Suzuki <[email protected]>
+
+ [bmalloc][Linux] Remove static initializers for PerProcess<>::s_object
+ https://bugs.webkit.org/show_bug.cgi?id=186966
+
+ Reviewed by Anders Carlsson.
+
+ 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 <[email protected]>
[Xcode] Clean up and modernize some build setting definitions
Modified: trunk/Source/bmalloc/bmalloc/PerProcess.h (233133 => 233134)
--- trunk/Source/bmalloc/bmalloc/PerProcess.h 2018-06-24 16:59:55 UTC (rev 233133)
+++ trunk/Source/bmalloc/bmalloc/PerProcess.h 2018-06-24 19:01:22 UTC (rev 233134)
@@ -123,9 +123,9 @@
};
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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes