Changeset 231118 in webkit for trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp
- Timestamp:
- Apr 27, 2018, 5:01:14 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp
r230040 r231118 31 31 #include "ProbeContext.h" 32 32 #include <wtf/InlineASM.h> 33 34 #if OS(LINUX) 35 #include <asm/hwcap.h> 36 #include <sys/auxv.h> 37 #endif 33 38 34 39 namespace JSC { … … 527 532 #endif // ENABLE(MASM_PROBE) 528 533 534 void MacroAssemblerARM64::collectCPUFeatures() 535 { 536 static std::once_flag onceKey; 537 std::call_once(onceKey, [] { 538 #if OS(LINUX) 539 // A register for describing ARM64 CPU features are only accessible in kernel mode. 540 // Thus, some kernel support is necessary to collect CPU features. In Linux, the 541 // kernel passes CPU feature flags in AT_HWCAP auxiliary vector which is passed 542 // when the process starts. While this may pose a bit conservative information 543 // (for example, the Linux kernel may add a flag for a feature after the feature 544 // is shipped and implemented in some CPUs. In that case, even if the CPU has 545 // that feature, the kernel does not tell it to users.), it is a stable approach. 546 // https://www.kernel.org/doc/Documentation/arm64/elf_hwcaps.txt 547 unsigned long hwcaps = getauxval(AT_HWCAP); 548 549 #if !defined(HWCAP_JSCVT) 550 #define HWCAP_JSCVT (1 << 13) 551 #endif 552 553 s_jscvtCheckState = (hwcaps & HWCAP_JSCVT) ? CPUIDCheckState::Set : CPUIDCheckState::Clear; 554 #else 555 s_jscvtCheckState = CPUIDCheckState::Clear; 556 #endif 557 }); 558 } 559 560 MacroAssemblerARM64::CPUIDCheckState MacroAssemblerARM64::s_jscvtCheckState = CPUIDCheckState::NotChecked; 561 529 562 } // namespace JSC 530 563
Note:
See TracChangeset
for help on using the changeset viewer.