Title: [90477] trunk/Source/_javascript_Core
- Revision
- 90477
- Author
- [email protected]
- Date
- 2011-07-06 11:58:47 -0700 (Wed, 06 Jul 2011)
Log Message
2011-07-06 Dmitriy Vyukov <[email protected]>
Reviewed by David Levin.
Allow substitution of dynamic annotations and prevent identical code folding by the linker.
https://bugs.webkit.org/show_bug.cgi?id=62443
* wtf/DynamicAnnotations.cpp:
(WTFAnnotateBenignRaceSized):
(WTFAnnotateHappensBefore):
(WTFAnnotateHappensAfter):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (90476 => 90477)
--- trunk/Source/_javascript_Core/ChangeLog 2011-07-06 18:58:06 UTC (rev 90476)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-07-06 18:58:47 UTC (rev 90477)
@@ -1,3 +1,15 @@
+2011-07-06 Dmitriy Vyukov <[email protected]>
+
+ Reviewed by David Levin.
+
+ Allow substitution of dynamic annotations and prevent identical code folding by the linker.
+ https://bugs.webkit.org/show_bug.cgi?id=62443
+
+ * wtf/DynamicAnnotations.cpp:
+ (WTFAnnotateBenignRaceSized):
+ (WTFAnnotateHappensBefore):
+ (WTFAnnotateHappensAfter):
+
2011-07-06 Zoltan Herczeg <[email protected]>
Calls on 32 bit machines are failed after r90423
Modified: trunk/Source/_javascript_Core/wtf/DynamicAnnotations.cpp (90476 => 90477)
--- trunk/Source/_javascript_Core/wtf/DynamicAnnotations.cpp 2011-07-06 18:58:06 UTC (rev 90476)
+++ trunk/Source/_javascript_Core/wtf/DynamicAnnotations.cpp 2011-07-06 18:58:47 UTC (rev 90477)
@@ -28,8 +28,34 @@
#include "DynamicAnnotations.h"
-#if USE(DYNAMIC_ANNOTATIONS)
-void WTFAnnotateBenignRaceSized(const char*, int, const volatile void*, long, const char*) { }
-void WTFAnnotateHappensBefore(const char*, int, const volatile void*) { }
-void WTFAnnotateHappensAfter(const char*, int, const volatile void*) { }
-#endif // USE(DYNAMIC_ANNOTATIONS)
+#if USE(DYNAMIC_ANNOTATIONS) && !USE(DYNAMIC_ANNOTATIONS_NOIMPL)
+
+// Identical code folding(-Wl,--icf=all) countermeasures.
+// This makes all Annotate* functions different, which prevents the linker from
+// folding them.
+#ifdef __COUNTER__
+#define DYNAMIC_ANNOTATIONS_IMPL \
+ volatile short lineno = (__LINE__ << 8) + __COUNTER__; \
+ (void)lineno;
+#else
+#define DYNAMIC_ANNOTATIONS_IMPL \
+ volatile short lineno = (__LINE__ << 8); \
+ (void)lineno;
+#endif
+
+void WTFAnnotateBenignRaceSized(const char*, int, const volatile void*, long, const char*)
+{
+ DYNAMIC_ANNOTATIONS_IMPL
+}
+
+void WTFAnnotateHappensBefore(const char*, int, const volatile void*)
+{
+ DYNAMIC_ANNOTATIONS_IMPL
+}
+
+void WTFAnnotateHappensAfter(const char*, int, const volatile void*)
+{
+ DYNAMIC_ANNOTATIONS_IMPL
+}
+
+#endif // USE(DYNAMIC_ANNOTATIONS) && !USE(DYNAMIC_ANNOTATIONS_NOIMPL)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes