Skip to content

Commit 9684278

Browse files
miladfarcatargos
authored andcommitted
deps: V8: cherry-pick d58ce5ad2ee2
Original commit message: Fix builds with no `__builtin_bswap64` support Currently getting `'kBitsPerByte' was not declared in this scope`. Change-Id: Ied391ac9e859f0f3548d88fd1cc57f490d99e39a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7310534 Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Milad Farazmand <[email protected]> Cr-Commit-Position: refs/heads/main@{#104481} Refs: v8/v8@d58ce5a
1 parent 773bf57 commit 9684278

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

common.gypi

Lines 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.13',
41+
'v8_embedder_string': '-node.14',
4242

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

deps/v8/src/base/bits.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,15 +504,13 @@ inline constexpr uint64_t ByteReverse64(uint64_t value) {
504504
#if V8_HAS_BUILTIN_BSWAP64
505505
return __builtin_bswap64(value);
506506
#else
507-
size_t bits_of_v = sizeof(value) * kBitsPerByte;
508-
return value << (bits_of_v - 8) |
509-
((value << (bits_of_v - 24)) & 0x00FF000000000000) |
510-
((value << (bits_of_v - 40)) & 0x0000FF0000000000) |
511-
((value << (bits_of_v - 56)) & 0x000000FF00000000) |
512-
((value >> (bits_of_v - 56)) & 0x00000000FF000000) |
513-
((value >> (bits_of_v - 40)) & 0x0000000000FF0000) |
514-
((value >> (bits_of_v - 24)) & 0x000000000000FF00) |
515-
((value >> (bits_of_v - 8)) & 0x00000000000000FF);
507+
return value << 56 | ((value << 40) & 0x00FF000000000000) |
508+
((value << 24) & 0x0000FF0000000000) |
509+
((value << 8) & 0x000000FF00000000) |
510+
((value >> 8) & 0x00000000FF000000) |
511+
((value >> 24) & 0x0000000000FF0000) |
512+
((value >> 40) & 0x000000000000FF00) |
513+
((value >> 56) & 0x00000000000000FF);
516514
#endif
517515
}
518516

0 commit comments

Comments
 (0)