Skip to content

Commit 151d0a4

Browse files
abmusseV8 LUCI CQ
authored andcommitted
Fix gcc build
For json-parser.h: ``` ../../src/json/json-parser.h:298:13: error: explicit specialization in non-namespace scope 'class v8::internal::JsonParser<Char>' 298 | template <> | ^ ../../src/json/json-parser.h:299:18: error: template-id 'IsNextToken<v8::internal::JsonToken::EOS>' in declaration of primary template 299 | V8_INLINE bool IsNextToken<JsonToken::EOS>() { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` For wasm-objects.cc: ``` ../../src/wasm/wasm-objects.cc:2522:45: error: no matching function for call to 'v8::internal::WasmDispatchTable::SetForNonWrapper<v8::internal::WasmDispatchTable>( v8::internal::WasmDispatchTable&, int&, v8::internal::Tagged<v8::internal:: Union<v8::internal::Smi, v8::internal::WasmTrustedInstanceData> >&, v8::internal::WasmCodePointer&, v8::internal::wasm::CanonicalTypeIndex&, v8::internal::WasmDispatchTable::NewOrExistingEntry&)' ``` ``` error: no matching function for call to 'v8::internal::WasmDispatchTable:: SetForWrapper<v8::internal::WasmDispatchTable>(v8::internal::WasmDispatchTable&, int&, v8::internal::Tagged<v8::internal::WasmImportData>&, std::shared_ptr<v8:: internal::wasm::WasmImportWrapperHandle>&, v8::internal::wasm:: CanonicalTypeIndex&, v8::internal::WasmDispatchTable::NewOrExistingEntry&)' ``` For the fix fully qualify calls to SetForWrapper and SetForNonWrapper with ::v8::internal:: to avoid accidental lookup of class member names. This resolves template resolution errors caused by unqualified calls inside WasmDispatchTable and WasmDispatchTableForImports member functions. Change-Id: I687935a05dc754db686deaa0f93079d350aae07e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7107891 Reviewed-by: Patrick Thier <[email protected]> Reviewed-by: Manos Koukoutos <[email protected]> Commit-Queue: Milad Farazmand <[email protected]> Cr-Commit-Position: refs/heads/main@{#103547}
1 parent b265bdf commit 151d0a4

2 files changed

Lines changed: 20 additions & 29 deletions

File tree

src/json/json-parser.h

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,24 +283,15 @@ class JsonParser final {
283283
}
284284

285285
template <JsonToken token>
286-
V8_INLINE bool IsNextToken();
287-
288-
template <JsonToken token>
289-
requires JsonTokenIsCharacter<token>
290286
V8_INLINE bool IsNextToken() {
291-
constexpr Char expected_char = JsonTokenToCharacter(token);
292-
if (V8_LIKELY(expected_char == CurrentCharacter())) {
293-
return true;
287+
if constexpr (token == JsonToken::EOS) {
288+
return is_at_end();
289+
} else if constexpr (JsonTokenIsCharacter<token>) {
290+
constexpr Char expected_char = JsonTokenToCharacter(token);
291+
return V8_LIKELY(expected_char == CurrentCharacter());
292+
} else {
293+
return false;
294294
}
295-
return false;
296-
}
297-
298-
template <>
299-
V8_INLINE bool IsNextToken<JsonToken::EOS>() {
300-
if (V8_LIKELY(is_at_end())) {
301-
return true;
302-
}
303-
return false;
304295
}
305296

306297
template <JsonToken token>

src/wasm/wasm-objects.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,12 +2520,12 @@ void WasmDispatchTable::SetForNonWrapper(
25202520
uint32_t function_index,
25212521
#endif // V8_ENABLE_DRUMBRAKE
25222522
WasmDispatchTable::NewOrExistingEntry new_or_existing) {
2523-
return SetForNonWrapper<WasmDispatchTable>(*this, index, implicit_arg,
2524-
call_target, sig_id,
2523+
return ::v8::internal::SetForNonWrapper<WasmDispatchTable>(
2524+
*this, index, implicit_arg, call_target, sig_id,
25252525
#if V8_ENABLE_DRUMBRAKE
2526-
function_index,
2526+
function_index,
25272527
#endif
2528-
new_or_existing);
2528+
new_or_existing);
25292529
}
25302530

25312531
void WasmDispatchTableForImports::SetForNonWrapper(
@@ -2535,7 +2535,7 @@ void WasmDispatchTableForImports::SetForNonWrapper(
25352535
uint32_t function_index,
25362536
#endif // V8_ENABLE_DRUMBRAKE
25372537
WasmDispatchTable::NewOrExistingEntry new_or_existing) {
2538-
return SetForNonWrapper<WasmDispatchTableForImports>(
2538+
return ::v8::internal::SetForNonWrapper<WasmDispatchTableForImports>(
25392539
*this, index, implicit_arg, call_target, sig_id,
25402540
#if V8_ENABLE_DRUMBRAKE
25412541
function_index,
@@ -2597,12 +2597,12 @@ void WasmDispatchTable::SetForWrapper(
25972597
uint32_t function_index,
25982598
#endif // V8_ENABLE_DRUMBRAKE
25992599
WasmDispatchTable::NewOrExistingEntry new_or_existing) {
2600-
return SetForWrapper<WasmDispatchTable>(*this, index, implicit_arg,
2601-
wrapper_handle, sig_id,
2600+
return ::v8::internal::SetForWrapper<WasmDispatchTable>(
2601+
*this, index, implicit_arg, wrapper_handle, sig_id,
26022602
#if V8_ENABLE_DRUMBRAKE
2603-
function_index,
2603+
function_index,
26042604
#endif // V8_ENABLE_DRUMBRAKE
2605-
new_or_existing);
2605+
new_or_existing);
26062606
}
26072607

26082608
void WasmDispatchTableForImports::SetForWrapper(
@@ -2613,12 +2613,12 @@ void WasmDispatchTableForImports::SetForWrapper(
26132613
uint32_t function_index,
26142614
#endif // V8_ENABLE_DRUMBRAKE
26152615
WasmDispatchTable::NewOrExistingEntry new_or_existing) {
2616-
return SetForWrapper<WasmDispatchTableForImports>(*this, index, implicit_arg,
2617-
wrapper_handle, sig_id,
2616+
return ::v8::internal::SetForWrapper<WasmDispatchTableForImports>(
2617+
*this, index, implicit_arg, wrapper_handle, sig_id,
26182618
#if V8_ENABLE_DRUMBRAKE
2619-
function_index,
2619+
function_index,
26202620
#endif // V8_ENABLE_DRUMBRAKE
2621-
new_or_existing);
2621+
new_or_existing);
26222622
}
26232623

26242624
template <AnyWasmDispatchTable DispatchTable>

0 commit comments

Comments
 (0)