Changeset 90477 in webkit


Ignore:
Timestamp:
Jul 6, 2011 11:58:47 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-07-06 Dmitriy Vyukov <dvyukov@google.com>

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):
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r90443 r90477  
     12011-07-06  Dmitriy Vyukov  <dvyukov@google.com>
     2
     3        Reviewed by David Levin.
     4
     5        Allow substitution of dynamic annotations and prevent identical code folding by the linker.
     6        https://bugs.webkit.org/show_bug.cgi?id=62443
     7
     8        * wtf/DynamicAnnotations.cpp:
     9        (WTFAnnotateBenignRaceSized):
     10        (WTFAnnotateHappensBefore):
     11        (WTFAnnotateHappensAfter):
     12
    1132011-07-06  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
    214
  • trunk/Source/JavaScriptCore/wtf/DynamicAnnotations.cpp

    r89566 r90477  
    2929#include "DynamicAnnotations.h"
    3030
    31 #if USE(DYNAMIC_ANNOTATIONS)
    32 void WTFAnnotateBenignRaceSized(const char*, int, const volatile void*, long, const char*) { }
    33 void WTFAnnotateHappensBefore(const char*, int, const volatile void*) { }
    34 void WTFAnnotateHappensAfter(const char*, int, const volatile void*) { }
    35 #endif // USE(DYNAMIC_ANNOTATIONS)
     31#if USE(DYNAMIC_ANNOTATIONS) && !USE(DYNAMIC_ANNOTATIONS_NOIMPL)
     32
     33// Identical code folding(-Wl,--icf=all) countermeasures.
     34// This makes all Annotate* functions different, which prevents the linker from
     35// folding them.
     36#ifdef __COUNTER__
     37#define DYNAMIC_ANNOTATIONS_IMPL \
     38    volatile short lineno = (__LINE__ << 8) + __COUNTER__; \
     39    (void)lineno;
     40#else
     41#define DYNAMIC_ANNOTATIONS_IMPL \
     42    volatile short lineno = (__LINE__ << 8); \
     43    (void)lineno;
     44#endif
     45
     46void WTFAnnotateBenignRaceSized(const char*, int, const volatile void*, long, const char*)
     47{
     48    DYNAMIC_ANNOTATIONS_IMPL
     49}
     50
     51void WTFAnnotateHappensBefore(const char*, int, const volatile void*)
     52{
     53    DYNAMIC_ANNOTATIONS_IMPL
     54}
     55
     56void WTFAnnotateHappensAfter(const char*, int, const volatile void*)
     57{
     58    DYNAMIC_ANNOTATIONS_IMPL
     59}
     60
     61#endif // USE(DYNAMIC_ANNOTATIONS) && !USE(DYNAMIC_ANNOTATIONS_NOIMPL)
Note: See TracChangeset for help on using the changeset viewer.