Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update V8 to 7.8 #29493

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: V8: use ATOMIC_VAR_INIT instead of std::atomic_init
`std::atomic_init<size_t>` is not implemented on all platforms.

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>
  • Loading branch information
refack authored and ryzokuken committed Sep 8, 2019
commit b1450a381dab74871dc610d6a36dbf27fc1e5d06
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

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

##### V8 defaults for Node.js #####

Expand Down
21 changes: 11 additions & 10 deletions deps/v8/src/wasm/module-compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ class CompilationUnitQueues {
for (int task_id = 0; task_id < max_tasks; ++task_id) {
queues_[task_id].next_steal_task_id = next_task_id(task_id);
}
for (auto& atomic_counter : num_units_) {
std::atomic_init(&atomic_counter, size_t{0});
}
}

base::Optional<WasmCompilationUnit> GetNextUnit(
Expand Down Expand Up @@ -257,14 +254,15 @@ class CompilationUnitQueues {
};

struct BigUnitsQueue {
BigUnitsQueue() {
for (auto& atomic : has_units) std::atomic_init(&atomic, false);
}
BigUnitsQueue() = default;

base::Mutex mutex;

// Can be read concurrently to check whether any elements are in the queue.
std::atomic<bool> has_units[kNumTiers];
std::atomic_bool has_units[kNumTiers] = {
ATOMIC_VAR_INIT(false),
ATOMIC_VAR_INIT(false)
};

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

std::atomic<size_t> num_units_[kNumTiers];
std::atomic<int> next_queue_to_add{0};
std::atomic_size_t num_units_[kNumTiers] = {
ATOMIC_VAR_INIT(0),
ATOMIC_VAR_INIT(0)
};
std::atomic_int next_queue_to_add{0};

int next_task_id(int task_id) const {
int next = task_id + 1;
Expand Down Expand Up @@ -481,7 +482,7 @@ class CompilationStateImpl {

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

const int max_background_tasks_ = 0;

Expand Down