From 7b55fc099f6b701a91a377a979c19510b4d96b59 Mon Sep 17 00:00:00 2001 From: Seth Brenith Date: Wed, 12 Jan 2022 13:39:59 -0800 Subject: [PATCH] [arm64] Implement jscvt feature check for Windows Change-Id: I7cf964294304c380fb285eebf1e65b0f84dec1a7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3384233 Reviewed-by: Toon Verwaest Commit-Queue: Seth Brenith Cr-Commit-Position: refs/heads/main@{#78603} --- src/base/cpu.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/base/cpu.cc b/src/base/cpu.cc index 4ee3ba5f7d..3d29fdd50f 100644 --- a/src/base/cpu.cc +++ b/src/base/cpu.cc @@ -50,6 +50,8 @@ #include "src/base/logging.h" #include "src/base/platform/wrappers.h" #if V8_OS_WIN +#include + #include "src/base/win32-headers.h" #endif @@ -762,6 +764,13 @@ CPU::CPU() // user-space. has_non_stop_time_stamp_counter_ = true; + // Defined in winnt.h, but in a newer version of the Windows SDK than the one + // that V8 requires, so we must copy the value here. + constexpr int PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44; + + has_jscvt_ = + IsProcessorFeaturePresent(PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE); + #elif V8_OS_LINUX // Try to extract the list of CPU features from ELF hwcaps. uint32_t hwcaps = ReadELFHWCaps();