Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 367620c

Browse filesBrowse files
refackMylesBorins
authored andcommitted
deps: V8: use ATOMIC_VAR_INIT instead of std::atomic_init
`std::atomic_init<size_t>` is not implemented on all platforms. Backport-PR-URL: #30109 PR-URL: #27375 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 78b1b5c commit 367620c
Copy full SHA for 367620c

File tree

Expand file treeCollapse file tree

2 files changed

+12
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-11
lines changed
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.5',
41+
'v8_embedder_string': '-node.6',
4242

4343
##### V8 defaults for Node.js #####
4444

Collapse file

‎deps/v8/src/wasm/module-compiler.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/wasm/module-compiler.cc
+11-10Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ class CompilationUnitQueues {
152152
for (int task_id = 0; task_id < max_tasks; ++task_id) {
153153
queues_[task_id].next_steal_task_id = next_task_id(task_id);
154154
}
155-
for (auto& atomic_counter : num_units_) {
156-
std::atomic_init(&atomic_counter, size_t{0});
157-
}
158155
}
159156

160157
base::Optional<WasmCompilationUnit> GetNextUnit(
@@ -257,14 +254,15 @@ class CompilationUnitQueues {
257254
};
258255

259256
struct BigUnitsQueue {
260-
BigUnitsQueue() {
261-
for (auto& atomic : has_units) std::atomic_init(&atomic, false);
262-
}
257+
BigUnitsQueue() = default;
263258

264259
base::Mutex mutex;
265260

266261
// Can be read concurrently to check whether any elements are in the queue.
267-
std::atomic<bool> has_units[kNumTiers];
262+
std::atomic_bool has_units[kNumTiers] = {
263+
ATOMIC_VAR_INIT(false),
264+
ATOMIC_VAR_INIT(false)
265+
};
268266

269267
// Protected by {mutex}:
270268
std::priority_queue<BigUnit> units[kNumTiers];
@@ -273,8 +271,11 @@ class CompilationUnitQueues {
273271
std::vector<Queue> queues_;
274272
BigUnitsQueue big_units_queue_;
275273

276-
std::atomic<size_t> num_units_[kNumTiers];
277-
std::atomic<int> next_queue_to_add{0};
274+
std::atomic_size_t num_units_[kNumTiers] = {
275+
ATOMIC_VAR_INIT(0),
276+
ATOMIC_VAR_INIT(0)
277+
};
278+
std::atomic_int next_queue_to_add{0};
278279

279280
int next_task_id(int task_id) const {
280281
int next = task_id + 1;
@@ -481,7 +482,7 @@ class CompilationStateImpl {
481482

482483
// Compilation error, atomically updated. This flag can be updated and read
483484
// using relaxed semantics.
484-
std::atomic<bool> compile_failed_{false};
485+
std::atomic_bool compile_failed_{false};
485486

486487
const int max_background_tasks_ = 0;
487488

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.