Bug 114934 - Memory barrier support should also ensure that we always do a compiler fence
Summary: Memory barrier support should also ensure that we always do a compiler fence
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-21 22:51 PDT by Filip Pizlo
Modified: 2013-04-22 19:14 PDT (History)
11 users (show)

See Also:


Attachments
the patch (4.56 KB, patch)
2013-04-21 22:56 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
fix windows (4.85 KB, patch)
2013-04-21 23:08 PDT, Filip Pizlo
buildbot: commit-queue-
Details | Formatted Diff | Diff
the patch (5.19 KB, patch)
2013-04-22 08:24 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (5.17 KB, patch)
2013-04-22 08:47 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (5.17 KB, patch)
2013-04-22 08:48 PDT, Filip Pizlo
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2013-04-21 22:51:05 PDT
To prevent the compiler from doing its own reorderings
Comment 1 Filip Pizlo 2013-04-21 22:56:22 PDT
Created attachment 198992 [details]
the patch
Comment 2 WebKit Commit Bot 2013-04-21 22:58:42 PDT
Attachment 198992 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Atomics.h']" exit_code: 1
Source/WTF/wtf/Atomics.h:213:  armV7_dmb is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:219:  armV7_dmb_st is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:233:  x86_mfence is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Filip Pizlo 2013-04-21 23:00:04 PDT
(In reply to comment #2)
> Attachment 198992 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Atomics.h']" exit_code: 1
> Source/WTF/wtf/Atomics.h:213:  armV7_dmb is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
> Source/WTF/wtf/Atomics.h:219:  armV7_dmb_st is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
> Source/WTF/wtf/Atomics.h:233:  x86_mfence is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
> Total errors found: 3 in 2 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.

This style is intentional.  It would be weird to call "armV7_dmb" something like "dmb" instead, since that would probably be both confusing and would lead to too much namespace pollution.  It would also be weird to call it "armV7DMB", since then it's less clear that we're referring to the well-known "dmb" instruction on ARM.  Likewise for "armV7_dmb_st" and "x86_mfence".
Comment 4 Filip Pizlo 2013-04-21 23:08:39 PDT
Created attachment 198994 [details]
fix windows

_ReadWriteBarrier() is the Windows intrinsic for doing the equivalent of asm volatile("" ::: "memory").
Comment 5 WebKit Commit Bot 2013-04-21 23:11:51 PDT
Attachment 198994 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Atomics.h']" exit_code: 1
Source/WTF/wtf/Atomics.h:218:  armV7_dmb is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:224:  armV7_dmb_st is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:238:  x86_mfence is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Build Bot 2013-04-21 23:42:05 PDT
Comment on attachment 198994 [details]
fix windows

Attachment 198994 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/16272
Comment 7 Filip Pizlo 2013-04-22 08:24:33 PDT
Created attachment 199034 [details]
the patch

Fix Windows again.
Comment 8 WebKit Commit Bot 2013-04-22 08:27:12 PDT
Attachment 199034 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Atomics.h']" exit_code: 1
Source/WTF/wtf/Atomics.h:218:  armV7_dmb is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:224:  armV7_dmb_st is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:238:  x86_mfence is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Darin Adler 2013-04-22 08:39:20 PDT
Comment on attachment 199034 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=199034&action=review

> Source/WTF/ChangeLog:27
> +        (WTF):

WTF indeed. Please remove bogus lines like this or get someone to fix the script that generates them.
Comment 10 Filip Pizlo 2013-04-22 08:47:58 PDT
Created attachment 199035 [details]
the patch

Fix ChangeLog (removed the bogus WTF line).
Comment 11 Filip Pizlo 2013-04-22 08:48:50 PDT
Created attachment 199036 [details]
the patch

Fixed ChangeLog again - s/marged/marked
Comment 12 WebKit Commit Bot 2013-04-22 08:50:36 PDT
Attachment 199036 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Atomics.h']" exit_code: 1
Source/WTF/wtf/Atomics.h:218:  armV7_dmb is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:224:  armV7_dmb_st is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Source/WTF/wtf/Atomics.h:238:  x86_mfence is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Filip Pizlo 2013-04-22 09:31:56 PDT
Landed in http://trac.webkit.org/changeset/148888
Comment 14 Jessie Berlin 2013-04-22 19:14:08 PDT
(In reply to comment #13)
> Landed in http://trac.webkit.org/changeset/148888

This broke the Windows build:

http://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/65945/steps/compile-webkit/logs/stdio

7>Linking...
7>   Creating library C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\lib\JavaScriptCore.lib and object C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\lib\JavaScriptCore.exp
7>WeakSet.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>WTF.lib(MetaAllocator.obj) : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>GCThreadSharedData.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>MarkedAllocator.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>MarkedSpace.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>MarkStack.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>BlockAllocator.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>ConservativeRoots.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>CopiedSpace.obj : error LNK2019: unresolved external symbol __ReadWriteBarrier referenced in function "private: void __thiscall JSC::CopiedBlock::zeroFillWilderness(void)" (?zeroFillWilderness@CopiedBlock@JSC@@AAEXXZ)
7>CopyVisitor.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>JSLock.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>JSObject.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>ProfilerDatabase.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>SourceProvider.obj : error LNK2001: unresolved external symbol __ReadWriteBarrier
7>C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\bin\JavaScriptCore.dll : fatal error LNK1120: 1 unresolved externals
7>Project : warning PRJ0018 : The following environment variables were not found:
7>$(ENABLE_UNDO_MANAGER)
7>Build log was saved at "file://C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\obj\JavaScriptCore\BuildLog.htm"
7>JavaScriptCore - 15 error(s), 0 warning(s)