Skip to content

Commit 71e8f8b

Browse files
targosV8 LUCI CQ
authored andcommitted
[codegen] Move definition of GetRegisterParameter to inline header
This fixes compilation of V8 in Node.js with Visual Studio 2019. Without this change, MSVC errors with C3779 (a function that returns 'auto' cannot be used before it is defined) on the `static constexpr auto registers()` method. Bug: v8:11420 Change-Id: Id545199e2cdc10c8560031fb5950ec1171e5d554 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2964095 Commit-Queue: Igor Sheludko <ishell@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#75173}
1 parent 8cb73e0 commit 71e8f8b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎src/codegen/interface-descriptors-inl.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ StaticCallInterfaceDescriptor<DerivedDescriptor>::GetStackParameterCount() {
180180
DerivedDescriptor::GetRegisterParameterCount();
181181
}
182182

183+
// static
184+
template <typename DerivedDescriptor>
185+
constexpr Register
186+
StaticCallInterfaceDescriptor<DerivedDescriptor>::GetRegisterParameter(int i) {
187+
return DerivedDescriptor::registers()[i];
188+
}
189+
183190
// static
184191
constexpr Register FastNewObjectDescriptor::TargetRegister() {
185192
return kJSFunctionRegister;

‎src/codegen/interface-descriptors.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,8 @@ class StaticCallInterfaceDescriptor : public CallInterfaceDescriptor {
469469
static constexpr inline int GetRegisterParameterCount();
470470
static constexpr inline int GetStackParameterCount();
471471
static constexpr inline Register* GetRegisterData();
472+
static constexpr inline Register GetRegisterParameter(int i);
472473

473-
static constexpr inline Register GetRegisterParameter(int i) {
474-
return DerivedDescriptor::registers()[i];
475-
}
476474
explicit StaticCallInterfaceDescriptor(CallDescriptors::Key key)
477475
: CallInterfaceDescriptor(key) {}
478476

0 commit comments

Comments
 (0)