Skip to content

Commit

Permalink
deps: V8: backport 71e8f8bb3c26
Browse files Browse the repository at this point in the history
Original commit message:

    [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}

Refs: v8/v8@71e8f8b

Backport-PR-URL: #39470
PR-URL: #38990
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos authored and BethGriggs committed Jul 29, 2021
1 parent 53cc6c8 commit 794ad2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.8',
'v8_embedder_string': '-node.9',

##### V8 defaults for Node.js #####

Expand Down
7 changes: 7 additions & 0 deletions deps/v8/src/codegen/interface-descriptors-inl.h
Expand Up @@ -176,6 +176,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
5 changes: 1 addition & 4 deletions deps/v8/src/codegen/interface-descriptors.h
Expand Up @@ -457,10 +457,7 @@ 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) {
return DerivedDescriptor::registers()[i];
}
static constexpr inline Register GetRegisterParameter(int i);

explicit StaticCallInterfaceDescriptor(CallDescriptors::Key key)
: CallInterfaceDescriptor(key) {}
Expand Down

0 comments on commit 794ad2e

Please sign in to comment.