Skip to content

Commit

Permalink
deps: V8: cherry-pick 7b3a27b7ae65
Browse files Browse the repository at this point in the history
Original commit message:

    fix: correct calling convention for Windows on Arm

    Corrects a "Check failed: kFPParamRegisterCount == kParamRegisterCount"
    message when compiling v8_snapshot for Windows on Arm.

    Unlike x64, Windows on Arm's calling convention does not alternate
    between integer and float registers.

    Bug: chromium:1052746
    Change-Id: I4c9cdafcd6e43742b94613f85b2983761cc0891a
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440717
    Commit-Queue: Maya Lekova <mslekova@chromium.org>
    Reviewed-by: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: Maya Lekova <mslekova@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70257}

Refs: v8/v8@7b3a27b

PR-URL: nodejs#35700
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
  • Loading branch information
targos committed Nov 19, 2020
1 parent e262dab commit 6218c1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
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.12',
'v8_embedder_string': '-node.13',

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

Expand Down
9 changes: 5 additions & 4 deletions deps/v8/src/compiler/c-linkage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace {
#endif
} // namespace

#ifdef V8_TARGET_OS_WIN
#if defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
// As defined in
// https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019#parameter-passing,
// Windows calling convention doesn't differentiate between GP and FP params
Expand Down Expand Up @@ -176,11 +176,12 @@ void BuildParameterLocations(const MachineSignature* msig,
}
}
}
#else // V8_TARGET_OS_WIN
#else // defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)
// As defined in https://www.agner.org/optimize/calling_conventions.pdf,
// Section 7, Linux and Mac place parameters in consecutive registers,
// differentiating between GP and FP params. That's why we maintain two
// separate counters here.
// separate counters here. This also applies to Arm systems following
// the AAPCS and Windows on Arm.
void BuildParameterLocations(const MachineSignature* msig,
size_t kFPParamRegisterCount,
size_t kParamRegisterCount,
Expand Down Expand Up @@ -216,7 +217,7 @@ void BuildParameterLocations(const MachineSignature* msig,
}
}
}
#endif // V8_TARGET_OS_WIN
#endif // defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_X64)

// General code uses the above configuration data.
CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
Expand Down

0 comments on commit 6218c1c

Please sign in to comment.