Changeset 220579 in webkit
- Timestamp:
- Aug 10, 2017 10:31:32 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r220556 r220579 1 2017-08-10 Mark Lam <mark.lam@apple.com> 2 3 Make the MASM_PROBE mechanism mandatory for DFG and FTL builds. 4 https://bugs.webkit.org/show_bug.cgi?id=175446 5 <rdar://problem/33836545> 6 7 Reviewed by Saam Barati. 8 9 * assembler/AbstractMacroAssembler.h: 10 * assembler/MacroAssembler.cpp: 11 (JSC::MacroAssembler::probe): 12 * assembler/MacroAssembler.h: 13 * assembler/MacroAssemblerARM.cpp: 14 (JSC::MacroAssembler::probe): 15 * assembler/MacroAssemblerARM.h: 16 (JSC::MacroAssemblerARM::trustedImm32FromPtr): 17 * assembler/MacroAssemblerARM64.cpp: 18 (JSC::MacroAssembler::probe): 19 * assembler/MacroAssemblerARMv7.cpp: 20 (JSC::MacroAssembler::probe): 21 * assembler/MacroAssemblerARMv7.h: 22 (JSC::MacroAssemblerARMv7::trustedImm32FromPtr): 23 * assembler/MacroAssemblerPrinter.cpp: 24 * assembler/MacroAssemblerPrinter.h: 25 * assembler/MacroAssemblerX86Common.cpp: 26 * assembler/testmasm.cpp: 27 (JSC::isSpecialGPR): 28 (JSC::testProbeModifiesProgramCounter): 29 (JSC::run): 30 * b3/B3LowerToAir.cpp: 31 (JSC::B3::Air::LowerToAir::print): 32 * b3/air/AirPrintSpecial.cpp: 33 * b3/air/AirPrintSpecial.h: 34 1 35 2017-08-10 Mark Lam <mark.lam@apple.com> 2 36 -
trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
r219740 r220579 44 44 #if ENABLE(ASSEMBLER) 45 45 46 #if ENABLE(MASM_PROBE)47 46 struct ProbeContext; 48 47 typedef void (*ProbeFunction)(struct ProbeContext*); 49 #endif50 48 51 49 class AllowMacroScratchRegisterUsage; -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.cpp
r215592 r220579 35 35 const double MacroAssembler::twoToThe32 = (double)0x100000000ull; 36 36 37 #if ENABLE(MASM_PROBE)38 37 static void stdFunctionCallback(ProbeContext* context) 39 38 { … … 46 45 probe(stdFunctionCallback, new std::function<void(ProbeContext*)>(func)); 47 46 } 48 #endif // ENABLE(MASM_PROBE)49 47 50 48 } // namespace JSC -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.h
r219790 r220579 1825 1825 } 1826 1826 1827 #if ENABLE(MASM_PROBE)1828 1827 struct CPUState; 1829 1828 … … 1849 1848 1850 1849 JS_EXPORT_PRIVATE void probe(std::function<void(ProbeContext*)>); 1851 #endif // ENABLE(MASM_PROBE)1852 1850 1853 1851 // Let's you print from your JIT generated code. 1854 // This only works if ENABLE(MASM_PROBE). Otherwise, print() is a no-op.1855 1852 // See comments in MacroAssemblerPrinter.h for examples of how to use this. 1856 1853 template<typename... Arguments> … … 1859 1856 void print(Printer::PrintRecordList*); 1860 1857 }; 1861 1862 #if ENABLE(MASM_PROBE)1863 1858 1864 1859 struct MacroAssembler::CPUState { … … 1964 1959 void*& sp() { return cpu.sp(); } 1965 1960 }; 1966 #endif // ENABLE(MASM_PROBE)1967 1961 1968 1962 } // namespace JSC -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp
r219885 r220579 97 97 #endif // CPU(ARMV5_OR_LOWER) 98 98 99 #if ENABLE(MASM_PROBE)100 101 99 extern "C" void ctiMasmProbeTrampoline(); 102 100 … … 383 381 384 382 } 385 #endif // ENABLE(MASM_PROBE)386 383 387 384 } // namespace JSC -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
r219437 r220579 1587 1587 } 1588 1588 1589 #if ENABLE(MASM_PROBE)1590 1589 inline TrustedImm32 trustedImm32FromPtr(void* ptr) 1591 1590 { … … 1602 1601 return TrustedImm32(TrustedImmPtr(reinterpret_cast<void*>(function))); 1603 1602 } 1604 #endif1605 1603 1606 1604 private: -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp
r219951 r220579 32 32 33 33 namespace JSC { 34 35 #if ENABLE(MASM_PROBE)36 34 37 35 extern "C" void ctiMasmProbeTrampoline(); … … 552 550 add64(TrustedImm32(sizeof(OutgoingProbeRecord)), sp); 553 551 } 554 #endif // ENABLE(MASM_PROBE)555 552 556 553 } // namespace JSC -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp
r219885 r220579 32 32 33 33 namespace JSC { 34 35 #if ENABLE(MASM_PROBE)36 34 37 35 extern "C" void ctiMasmProbeTrampoline(); … … 360 358 m_assembler.blx(RegisterID::ip); 361 359 } 362 #endif // ENABLE(MASM_PROBE)363 360 364 361 } // namespace JSC -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
r219437 r220579 2108 2108 } 2109 2109 2110 #if ENABLE(MASM_PROBE)2111 2110 inline TrustedImm32 trustedImm32FromPtr(void* ptr) 2112 2111 { … … 2123 2122 return TrustedImm32(TrustedImmPtr(reinterpret_cast<void*>(function))); 2124 2123 } 2125 #endif2126 2124 2127 2125 private: -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerPrinter.cpp
r219790 r220579 27 27 #include "MacroAssemblerPrinter.h" 28 28 29 #if ENABLE(MASM_PROBE)30 31 29 #include "MacroAssembler.h" 30 #include <inttypes.h> 32 31 33 32 namespace JSC { … … 54 53 55 54 #if USE(JSVALUE32_64) 56 #define INTPTR_HEX_VALUE_FORMAT "0x%08 lx"55 #define INTPTR_HEX_VALUE_FORMAT "0x%08" PRIxPTR 57 56 #else 58 #define INTPTR_HEX_VALUE_FORMAT "0x%016 lx"57 #define INTPTR_HEX_VALUE_FORMAT "0x%016" PRIxPTR 59 58 #endif 60 59 61 60 for (auto id = MacroAssembler::firstRegister(); id <= MacroAssembler::lastRegister(); id = nextID(id)) { 62 61 intptr_t value = static_cast<intptr_t>(cpu.gpr(id)); 63 INDENT, out.printf(" %6s: " INTPTR_HEX_VALUE_FORMAT " % ld\n", cpu.gprName(id), value, value);62 INDENT, out.printf(" %6s: " INTPTR_HEX_VALUE_FORMAT " %" PRIdPTR "\n", cpu.gprName(id), value, value); 64 63 } 65 64 for (auto id = MacroAssembler::firstSPRegister(); id <= MacroAssembler::lastSPRegister(); id = nextID(id)) { 66 65 intptr_t value = static_cast<intptr_t>(cpu.spr(id)); 67 INDENT, out.printf(" %6s: " INTPTR_HEX_VALUE_FORMAT " % ld\n", cpu.sprName(id), value, value);66 INDENT, out.printf(" %6s: " INTPTR_HEX_VALUE_FORMAT " %" PRIdPTR "\n", cpu.sprName(id), value, value); 68 67 } 69 68 #undef INTPTR_HEX_VALUE_FORMAT … … 72 71 uint64_t u = bitwise_cast<uint64_t>(cpu.fpr(id)); 73 72 double d = cpu.fpr(id); 74 INDENT, out.printf(" %6s: 0x%016 llx%.13g\n", cpu.fprName(id), u, d);73 INDENT, out.printf(" %6s: 0x%016" PRIx64 " %.13g\n", cpu.fprName(id), u, d); 75 74 } 76 75 … … 100 99 const char* name = CPUState::fprName(regID); 101 100 double value = context.probeContext.fpr(regID); 102 out.printf("%s:<0x%016 llx%.13g>", name, bitwise_cast<uint64_t>(value), value);101 out.printf("%s:<0x%016" PRIx64 " %.13g>", name, bitwise_cast<uint64_t>(value), value); 103 102 } 104 103 … … 147 146 if (memory.numBytes == sizeof(int64_t)) { 148 147 auto p = reinterpret_cast<int64_t*>(ptr); 149 out.printf("%p:<0x%016 llx %lld>", p, *p, *p);148 out.printf("%p:<0x%016" PRIx64 " %" PRId64 ">", p, *p, *p); 150 149 return; 151 150 } … … 184 183 } // namespace JSC 185 184 186 #endif // ENABLE(MASM_PROBE) -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerPrinter.h
r215642 r220579 33 33 #if ENABLE(ASSEMBLER) 34 34 35 #if ENABLE(MASM_PROBE)36 37 35 // What is MacroAssembler::print()? 38 36 // =============================== … … 241 239 } 242 240 243 #else // ENABLE(MASM_PROBE)244 245 template<typename... Arguments>246 inline void MacroAssembler::print(Arguments&&...) { }247 248 inline void MacroAssembler::print(Printer::PrintRecordList*) { }249 250 #endif // ENABLE(MASM_PROBE)251 252 241 #endif // ENABLE(ASSEMBLER) 253 242 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp
r219885 r220579 33 33 namespace JSC { 34 34 35 #if ENABLE(MASM_PROBE)36 37 35 extern "C" void ctiMasmProbeTrampoline(); 38 36 … … 524 522 525 523 #endif // COMPILER(GCC_OR_CLANG) 524 525 #if OS(WINDOWS) 526 extern "C" NO_RETURN_DUE_TO_ASSERT void ctiMasmProbeTrampoline() 527 { 528 RELEASE_ASSERT_NOT_REACHED(); 529 } 530 #endif // OS(WINDOWS) 526 531 527 532 // What code is emitted for the probe? … … 576 581 } 577 582 578 #endif // ENABLE(MASM_PROBE)579 580 583 #if CPU(X86) && !OS(MAC_OS_X) 581 584 MacroAssemblerX86Common::SSE2CheckState MacroAssemblerX86Common::s_sse2CheckState = NotCheckedSSE2; -
trunk/Source/JavaScriptCore/assembler/testmasm.cpp
r220308 r220579 86 86 CHECK(bitwise_cast<uint64_t>(a) == bitwise_cast<uint64_t>(a)) 87 87 88 #if ENABLE(MASM_PROBE)89 88 bool isPC(MacroAssembler::RegisterID id) 90 89 { … … 117 116 return false; 118 117 } 119 #endif // ENABLE(MASM_PROBE)120 118 121 119 MacroAssemblerCodeRef compile(Generator&& generate) … … 150 148 } 151 149 152 #if ENABLE(MASM_PROBE)153 150 void testProbeReadsArgumentRegisters() 154 151 { … … 494 491 CHECK(continuationWasReached); 495 492 } 496 #endif // ENABLE(MASM_PROBE)497 493 498 494 #define RUN(test) do { \ … … 520 516 RUN(testSimple()); 521 517 522 #if ENABLE(MASM_PROBE)523 518 RUN(testProbeReadsArgumentRegisters()); 524 519 RUN(testProbeWritesArgumentRegisters()); … … 527 522 RUN(testProbeModifiesStackPointerToNBytesBelowSP()); 528 523 RUN(testProbeModifiesProgramCounter()); 529 #endif530 524 531 525 if (tasks.isEmpty()) -
trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r219899 r220579 1150 1150 } 1151 1151 1152 #if ENABLE(MASM_PROBE)1153 1152 template<typename... Arguments> 1154 1153 void print(Arguments&&... arguments) … … 1167 1166 append(WTFMove(inst)); 1168 1167 } 1169 #else1170 template<typename... Arguments>1171 void print(Arguments&&...) { }1172 #endif // ENABLE(MASM_PROBE)1173 1168 1174 1169 template<typename... Arguments> -
trunk/Source/JavaScriptCore/b3/air/AirPrintSpecial.cpp
r216306 r220579 28 28 29 29 #if ENABLE(B3_JIT) 30 #if ENABLE(MASM_PROBE)31 30 32 31 #include "MacroAssemblerPrinter.h" … … 126 125 } // namespace JSC 127 126 128 #endif // ENABLE(MASM_PROBE)129 127 #endif // ENABLE(B3_JIT) -
trunk/Source/JavaScriptCore/b3/air/AirPrintSpecial.h
r216306 r220579 27 27 28 28 #if ENABLE(B3_JIT) 29 #if ENABLE(MASM_PROBE)30 29 31 30 #include "AirInst.h" … … 130 129 } } } // namespace JSC::B3::Air 131 130 132 #endif // ENABLE(MASM_PROBE)133 131 #endif // ENABLE(B3_JIT) -
trunk/Source/WTF/ChangeLog
r220574 r220579 1 2017-08-10 Mark Lam <mark.lam@apple.com> 2 3 Make the MASM_PROBE mechanism mandatory for DFG and FTL builds. 4 https://bugs.webkit.org/show_bug.cgi?id=175446 5 <rdar://problem/33836545> 6 7 Reviewed by Saam Barati. 8 9 This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645. 10 One consequence of this is that the DFG will now be disabled for the MIPS and 11 Windows ports. See: 12 https://bugs.webkit.org/show_bug.cgi?id=175447 13 https://bugs.webkit.org/show_bug.cgi?id=175449 14 15 Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled. It was 16 never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway. This 17 is a mis-configuration error that is now fixed. 18 19 * wtf/Platform.h: 20 1 21 2017-08-10 Brady Eidson <beidson@apple.com> 2 22 -
trunk/Source/WTF/wtf/Platform.h
r219994 r220579 771 771 #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT) 772 772 /* Enable the DFG JIT on X86 and X86_64. */ 773 #if (CPU(X86) || CPU(X86_64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS( WINDOWS) || OS(HURD))773 #if (CPU(X86) || CPU(X86_64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD)) 774 774 #define ENABLE_DFG_JIT 1 775 775 #endif … … 778 778 #define ENABLE_DFG_JIT 1 779 779 #endif 780 /* Enable the DFG JIT on ARM and MIPS. */781 #if CPU(ARM_TRADITIONAL) || CPU(MIPS)780 /* Enable the DFG JIT on ARM. */ 781 #if CPU(ARM_TRADITIONAL) 782 782 #define ENABLE_DFG_JIT 1 783 783 #endif 784 /* FIXME: MIPS cannot enable the DFG until it has support for MacroAssembler::probe(). 785 https://bugs.webkit.org/show_bug.cgi?id=175447 786 */ 787 /* FIXME: Windows cannot enable the DFG until it has support for MacroAssembler::probe(). 788 https://bugs.webkit.org/show_bug.cgi?id=175449 789 */ 784 790 #endif 785 791 … … 800 806 #endif 801 807 802 /* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */803 #if ENABLE(FTL_JIT) || ENABLE(WEBASSEMBLY)804 #define ENABLE_B3_JIT 1805 #endif806 807 808 /* If the baseline jit is not available, then disable upper tiers as well: */ 808 809 #if !ENABLE(JIT) 809 810 #undef ENABLE_DFG_JIT 810 811 #undef ENABLE_FTL_JIT 811 #undef ENABLE_B3_JIT812 812 #define ENABLE_DFG_JIT 0 813 813 #define ENABLE_FTL_JIT 0 814 #define ENABLE_B3_JIT 0 814 #endif 815 816 /* If the DFG jit is not available, then disable upper tiers as well: */ 817 #if !ENABLE(DFG_JIT) 818 #undef ENABLE_FTL_JIT 819 #define ENABLE_FTL_JIT 0 820 #endif 821 822 /* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */ 823 #if ENABLE(FTL_JIT) || ENABLE(WEBASSEMBLY) 824 #define ENABLE_B3_JIT 1 815 825 #endif 816 826 … … 949 959 #endif 950 960 951 /* Enable the following if you want to use the MacroAssembler::probe() facility952 to do JIT debugging. */953 #if (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS))) && ENABLE(JIT) && OS(DARWIN)954 #define ENABLE_MASM_PROBE 1955 #else956 #define ENABLE_MASM_PROBE 0957 #endif958 959 961 #ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION 960 962 #ifdef NDEBUG … … 965 967 #endif 966 968 967 #if ENABLE( JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86) || CPU(X86_64) || CPU(ARM64))969 #if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86) || CPU(X86_64) || CPU(ARM64)) 968 970 #define ENABLE_SIGNAL_BASED_VM_TRAPS 1 969 971 #endif
Note: See TracChangeset
for help on using the changeset viewer.