Bug 87790 (MSVCX64SPINLOCK) - WTF TCSpinLock.h doesn't compile for x64 with Visual Studio
Summary: WTF TCSpinLock.h doesn't compile for x64 with Visual Studio
Status: RESOLVED WORKSFORME
Alias: MSVCX64SPINLOCK
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P4 Trivial
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-29 16:08 PDT by Alex Christensen
Modified: 2012-06-17 14:15 PDT (History)
4 users (show)

See Also:


Attachments
patch for Source/WTF/wtf/TCSpinLock.h (495 bytes, patch)
2012-05-30 08:40 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
patch (540 bytes, patch)
2012-05-30 08:45 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (1.10 KB, patch)
2012-06-05 09:34 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (1.13 KB, patch)
2012-06-14 08:49 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (1.14 KB, patch)
2012-06-14 09:11 PDT, Alex Christensen
bfulgham: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2012-05-29 16:08:59 PDT
The file Source/WTF/wtf/TCSpinLock.h contains assembly code with an __asm keyword that compiles with Visual Studio for x86, but not for x64.  Code that uses the intrinsic InterlockedExchange function has already been written below, but the #if incorrectly does not use it when MSVC is compiling for a 64 bit machine.  This can be fixed by changing line 37 from 

#if (CPU(X86) || CPU(X86_64) || CPU(PPC)) && (COMPILER(GCC) || COMPILER(MSVC))

 to 

#if (CPU(X86) || CPU(X86_64) || CPU(PPC)) && COMPILER(GCC) || CPU(X86) && COMPILER(MSVC)
Comment 1 Alex Christensen 2012-05-30 08:40:50 PDT
Created attachment 144829 [details]
patch for Source/WTF/wtf/TCSpinLock.h
Comment 2 Alex Christensen 2012-05-30 08:45:12 PDT
Created attachment 144833 [details]
patch
Comment 3 Patrick R. Gansterer 2012-05-30 09:18:29 PDT
Every patch needs a ChangeLog entry: See http://www.webkit.org/coding/contributing.html for more information about this.
Comment 4 Alex Christensen 2012-06-05 09:34:22 PDT
Created attachment 145821 [details]
Patch
Comment 5 Brent Fulgham 2012-06-13 09:15:15 PDT
Comment on attachment 145821 [details]
Patch

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

Thanks for looking into this!  I have a couple of minor requests, otherwise this looks great.

> Source/WTF/ChangeLog:8
> +        * wtf/TCSpinLock.h:

Please state here that you modified the test for MSVC suitability.

> Source/WTF/wtf/TCSpinLock.h:-37
> -#if (CPU(X86) || CPU(X86_64) || CPU(PPC)) && (COMPILER(GCC) || COMPILER(MSVC))

I don't care for the reformatting of these tests, since it loses the distinction between architecture and compiler.

I would prefer to see something along the lines of:
#if ((CPU(X86) || CPU(X86_64) || CPU(PPC)) && COMPILER(GCC)) || (CPU(X86) && COMPILER(MSVC))
Comment 6 Alex Christensen 2012-06-14 08:49:13 PDT
Created attachment 147592 [details]
Patch
Comment 7 WebKit Review Bot 2012-06-14 08:52:22 PDT
Attachment 147592 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/TC..." exit_code: 1
Source/WTF/ChangeLog:9:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Alex Christensen 2012-06-14 09:11:19 PDT
Created attachment 147595 [details]
Patch
Comment 9 Brent Fulgham 2012-06-14 09:18:29 PDT
Comment on attachment 147595 [details]
Patch

Looks great!  Thanks for helping out with 64-bit work :-)
Comment 10 WebKit Review Bot 2012-06-14 13:37:43 PDT
Comment on attachment 147595 [details]
Patch

Rejecting attachment 147595 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
, u'--reviewer', u'Brent Fulg..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Parsed 2 diffs from patch file(s).
patching file Source/WTF/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/WTF/wtf/TCSpinLock.h
Hunk #1 FAILED at 34.
1 out of 1 hunk FAILED -- saving rejects to file Source/WTF/wtf/TCSpinLock.h.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Brent Fulg..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12960357
Comment 11 Alex Christensen 2012-06-14 13:48:47 PDT
what does this mean?
Comment 12 Patrick R. Gansterer 2012-06-14 15:52:57 PDT
(In reply to comment #11)
> what does this mean?

That's usually a merge conflict. If you want you can rebase you patch and upload it again, or I can commit it manually for you.
Comment 13 Patrick R. Gansterer 2012-06-17 14:15:20 PDT
This isn't needed any more since r120356.