Skip to content

Commit b5dbf97

Browse files
abmussetargos
authored andcommitted
deps: V8: cherry-pick ee2873a6303d
Original commit message: Fix GCC Build Move explicit specializations of Utf8::IsAsciiOneByteString to namespace scope C++ forbids explicit template specializations inside class scope. The specializations for IsAsciiOneByteString<uint8_t> and IsAsciiOneByteString<uint16_t> were defined inside class unibrow::Utf8, riggering "explicit specialization in non-namespace scope" compile errors. Fix type mismatch in EXPECT_EQ comparisons for std::pair values The tests failed because EXPECT_EQ was comparing pairs with mismatched template parameters — std::pair<int, unsigned int> vs. std::pair<unsigned int, unsigned char> — which have no valid operator==. I corrected the expected values to use the same unsigned types as the actual data, ensuring the pair comparison compiles cleanly. Fix build failure on GCC 12 by replacing std::format with ostringstream GCC 12's libstdc++ does not implement <format>, causing compile errors when using std::format. Replaced all std::format calls with equivalent Change-Id: I5c31f91065eccf6f4c14172902ffcd99863ebbb9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7138905 Commit-Queue: Clemens Backes <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#104280} Refs: v8/v8@ee2873a
1 parent 27a85c6 commit b5dbf97

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

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

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

deps/v8/src/strings/unicode.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,6 @@ class V8_EXPORT_PRIVATE Utf8 {
215215
template <typename Char>
216216
static size_t WriteLeadingAscii(const Char* src, char* dest, size_t size);
217217

218-
template <>
219-
size_t WriteLeadingAscii<uint8_t>(const uint8_t* src, char* dest,
220-
size_t size);
221-
222-
template <>
223-
size_t WriteLeadingAscii<uint16_t>(const uint16_t* src, char* dest,
224-
size_t size);
225-
226218
// Encode the given characters as Utf8 into the provided output buffer.
227219
struct EncodingResult {
228220
size_t bytes_written;
@@ -234,6 +226,14 @@ class V8_EXPORT_PRIVATE Utf8 {
234226
bool replace_invalid_utf8);
235227
};
236228

229+
template <>
230+
size_t unibrow::Utf8::WriteLeadingAscii<uint8_t>(const uint8_t* src, char* dest,
231+
size_t size);
232+
233+
template <>
234+
size_t unibrow::Utf8::WriteLeadingAscii<uint16_t>(const uint16_t* src,
235+
char* dest, size_t size);
236+
237237
#if V8_ENABLE_WEBASSEMBLY
238238
class V8_EXPORT_PRIVATE Wtf8 {
239239
public:

deps/v8/test/unittests/heap/heap-unittest.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,12 +1511,13 @@ TEST_F(HeapTest, ReportStatsAsCrashKeys) {
15111511
const size_t bytes = size.value();
15121512

15131513
if (bytes >= MB) {
1514-
return std::format("{:.2f}MB", static_cast<double>(bytes) / MB);
1514+
return absl::StrFormat("%.2fMB", static_cast<double>(bytes) / MB);
15151515
} else if (bytes >= KB) {
1516-
return std::format("{:.2f}KB", static_cast<double>(bytes) / KB);
1516+
return absl::StrFormat("%.2fKB", static_cast<double>(bytes) / KB);
15171517
} else {
1518-
return std::format("{}B", bytes);
1518+
return absl::StrFormat("%zuB", bytes);
15191519
}
1520+
15201521
};
15211522

15221523
const std::vector<std::pair<std::string, ByteSize>>

deps/v8/test/unittests/wasm/module-decoder-unittest.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,10 +2551,10 @@ TEST_F(WasmModuleVerifyTest, InstructionFrequencies) {
25512551
InstructionFrequencies& frequencies = result.value()->instruction_frequencies;
25522552
EXPECT_EQ(2U, frequencies.size());
25532553
EXPECT_EQ(2U, frequencies.at(0).size());
2554-
EXPECT_EQ(std::pair(5, 31U), frequencies.at(0)[0]);
2555-
EXPECT_EQ(std::pair(11, 31U), frequencies.at(0)[1]);
2554+
EXPECT_EQ((std::make_pair(uint32_t{5}, uint8_t{31})), frequencies.at(0)[0]);
2555+
EXPECT_EQ((std::make_pair(uint32_t{11}, uint8_t{31})), frequencies.at(0)[1]);
25562556
EXPECT_EQ(1U, frequencies.at(1).size());
2557-
EXPECT_EQ(std::pair(1, 32U), frequencies.at(1)[0]);
2557+
EXPECT_EQ((std::make_pair(uint32_t{1}, uint8_t{32})), frequencies.at(1)[0]);
25582558
}
25592559

25602560
TEST_F(WasmModuleVerifyTest, InstructionFrequenciesOutOfOrderFunctions) {
@@ -2649,7 +2649,7 @@ TEST_F(WasmModuleVerifyTest, InstructionFrequenciesHintLengthGreaterThanOne) {
26492649
InstructionFrequencies& frequencies = result.value()->instruction_frequencies;
26502650
EXPECT_EQ(1U, frequencies.size());
26512651
EXPECT_EQ(1U, frequencies.at(0).size());
2652-
EXPECT_EQ(std::pair(11, 31U), frequencies.at(0)[0]);
2652+
EXPECT_EQ((std::make_pair(uint32_t{11}, uint8_t{31})), frequencies.at(0)[0]);
26532653
}
26542654

26552655
TEST_F(WasmModuleVerifyTest, InstructionFrequenciesHintLengthZero) {

0 commit comments

Comments
 (0)