Skip to content

Commit

Permalink
[codegen] Move definition of GetRegisterParameter to inline header
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
targos authored and V8 LUCI CQ committed Jun 16, 2021
1 parent 8cb73e0 commit 71e8f8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/codegen/interface-descriptors-inl.h
Expand Up @@ -180,6 +180,13 @@ StaticCallInterfaceDescriptor<DerivedDescriptor>::GetStackParameterCount() {
DerivedDescriptor::GetRegisterParameterCount();
}

// static
template <typename DerivedDescriptor>
constexpr Register
StaticCallInterfaceDescriptor<DerivedDescriptor>::GetRegisterParameter(int i) {
return DerivedDescriptor::registers()[i];
}

// static
constexpr Register FastNewObjectDescriptor::TargetRegister() {
return kJSFunctionRegister;
Expand Down
4 changes: 1 addition & 3 deletions src/codegen/interface-descriptors.h
Expand Up @@ -469,10 +469,8 @@ class StaticCallInterfaceDescriptor : public CallInterfaceDescriptor {
static constexpr inline int GetRegisterParameterCount();
static constexpr inline int GetStackParameterCount();
static constexpr inline Register* GetRegisterData();
static constexpr inline Register GetRegisterParameter(int i);

static constexpr inline Register GetRegisterParameter(int i) {
return DerivedDescriptor::registers()[i];
}
explicit StaticCallInterfaceDescriptor(CallDescriptors::Key key)
: CallInterfaceDescriptor(key) {}

Expand Down

0 comments on commit 71e8f8b

Please sign in to comment.