Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Issue 1228063005: Fix runtime-atomics for Win 10 SDK and remove volatile (Closed)

Created:
5 years, 5 months ago by brucedawson
Modified:
5 years, 2 months ago
Reviewers:
Jarin, mauroleggieri
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix runtime-atomics for Win 10 SDK and remove volatile For unclear and probably accidental reasons the Windows 10 SDK renamed some _Interlocked* functions to _InlineInterlocked. This leads to these errors: runtime-atomics.cc(159): error C3861: '_InterlockedExchange64': identifier not found runtime-atomics.cc(159): error C3861: '_InterlockedExchangeAdd64': identifier not found runtime-atomics.cc(159): error C3861: '_InterlockedAnd64': identifier not found runtime-atomics.cc(159): error C3861: '_InterlockedOr64': identifier not found runtime-atomics.cc(159): error C3861: '_InterlockedXor64': identifier not found Fixing this requires either adding defines to map these five _Interlocked* functions to _InlineInterlocked*, or else changing to using the non-underscore versions. It appears that using the non-underscore versions is preferable so I went that way. This also requires adding three new defines because there is a huge lack of consistency, probably due to these macros being defined sometimes in <intrin.h> and sometimes in <winnt.h> All five of the renamed 64-bit functions were manually checked to ensure that the change to the non-underscore versions would make no differences - the inline functions that they map to were identical. Other functions were spot-checked. Also, the 'volatile' qualifiers were removed. Volatile has no no useful meaning for multi-threaded programming. It only exists in the Interlocked* prototypes to *allow* volatile variables to be passed. Since this is a bad habit to encourage there is no reason for us to permit it, and we can still call the Microsoft functions (T* converts to volatile T*, just not vice-versa). The updated code builds with the Windows 8.1 SDK and with the Windows 10 SDK. R=jarin@chromium.org LOG=Y BUG=440500, 491424 Committed: https://crrev.com/b2ed25304e203bbd22d6b09db575980f6aecf30a Cr-Commit-Position: refs/heads/master@{#29687}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -47 lines) Patch
M src/runtime/runtime-atomics.cc View 2 chunks +52 lines, -47 lines 0 comments Download

Messages

Total messages: 10 (1 generated)
brucedawson
5 years, 5 months ago (2015-07-15 00:52:20 UTC) #1
Jarin
lgtm. While I agree that volatile has no useful meaning for multi-threading, it does prevents ...
5 years, 5 months ago (2015-07-15 07:11:20 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1228063005/1
5 years, 5 months ago (2015-07-15 16:45:33 UTC) #4
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 5 months ago (2015-07-15 16:47:43 UTC) #5
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/b2ed25304e203bbd22d6b09db575980f6aecf30a Cr-Commit-Position: refs/heads/master@{#29687}
5 years, 5 months ago (2015-07-15 16:48:04 UTC) #6
mauroleggieri
Hi Bruce, Thanks for the update. Yesterday I had the issue and today I saw ...
5 years, 5 months ago (2015-07-16 02:39:00 UTC) #7
mauroleggieri
Typo, extra closing parenthesis in '#elif defined(_M_X64))' line.
5 years, 5 months ago (2015-07-16 11:08:26 UTC) #8
brucedawson
What is the use-case for building V8 with the v120_xp toolset? Is that something that ...
5 years, 5 months ago (2015-07-17 00:52:10 UTC) #9
mauroleggieri
5 years, 2 months ago (2015-10-01 23:22:20 UTC) #10
Message was sent while issue was closed.
On 2015/07/17 00:52:10, brucedawson wrote:
> What is the use-case for building V8 with the v120_xp toolset? Is that
something
> that we need to support?
> 
> When I wrote my fix I was unaware of how to detect which Windows SDK was being
> used. I have since learned how. You need to #include <ntverp.h> and then test
> VER_PRODUCTBUILD, as shown here:
> 
>
https://codereview.chromium.org/1233393002/diff/1/device/bluetooth/bluetooth_...
> 
> FWIW.

Hi Bruce,

Sorry for the late response. Although many people is moving to newer OSes
(mainly Windows 10), XP is still used in some places and I think it is minor fix
that can be applied.

Regards,
Mauro.

Powered by Google App Engine
This is Rietveld 408576698