Changeset 213302 in webkit
- Timestamp:
- Mar 2, 2017, 2:06:04 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r213299 r213302 1 2017-03-02 Mark Lam <mark.lam@apple.com> 2 3 Add Options::alwaysCheckTraps() and Options::usePollingTraps() options. 4 https://bugs.webkit.org/show_bug.cgi?id=169088 5 6 Reviewed by Keith Miller. 7 8 Options::alwaysCheckTraps() forces the op_check_traps bytecode to always be 9 generated. This is useful for testing purposes until we have signal based 10 traps, at which point, we will always emit the op_check_traps bytecode and remove 11 this option. 12 13 Options::usePollingTraps() enables the use of polling VM traps all the time. 14 This will be useful for benchmark comparisons, (between polling and non-polling 15 traps), as well as for forcing polling traps later for ports that don't support 16 signal based traps. 17 18 Note: signal based traps are not fully implemented yet. As a result, if the VM 19 watchdog is in use, we will force Options::usePollingTraps() to be true. 20 21 * bytecompiler/BytecodeGenerator.cpp: 22 (JSC::BytecodeGenerator::emitCheckTraps): 23 * dfg/DFGClobberize.h: 24 (JSC::DFG::clobberize): 25 * dfg/DFGSpeculativeJIT.cpp: 26 (JSC::DFG::SpeculativeJIT::compileCheckTraps): 27 * dfg/DFGSpeculativeJIT32_64.cpp: 28 (JSC::DFG::SpeculativeJIT::compile): 29 * dfg/DFGSpeculativeJIT64.cpp: 30 (JSC::DFG::SpeculativeJIT::compile): 31 * ftl/FTLLowerDFGToB3.cpp: 32 (JSC::FTL::DFG::LowerDFGToB3::compileNode): 33 (JSC::FTL::DFG::LowerDFGToB3::compileCheckTraps): 34 * runtime/Options.cpp: 35 (JSC::recomputeDependentOptions): 36 * runtime/Options.h: 37 1 38 2017-03-02 Keith Miller <keith_miller@apple.com> 2 39 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r213165 r213302 1275 1275 void BytecodeGenerator::emitCheckTraps() 1276 1276 { 1277 if ( vm()->watchdog() || vm()->needAsynchronousTerminationSupport())1277 if (Options::alwaysCheckTraps() || vm()->watchdog() || vm()->needAsynchronousTerminationSupport()) 1278 1278 emitOpcode(op_check_traps); 1279 1279 } -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r213107 r213302 435 435 return; 436 436 437 case CheckTraps: 438 if (Options::usePollingTraps()) { 439 read(InternalState); 440 write(InternalState); 441 } else 442 write(Watchpoint_fire); 443 return; 444 437 445 case InvalidationPoint: 438 446 write(SideState); … … 1412 1420 1413 1421 case CountExecution: 1414 case CheckTraps:1415 1422 read(InternalState); 1416 1423 write(InternalState); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r213107 r213302 1899 1899 void SpeculativeJIT::compileCheckTraps(Node*) 1900 1900 { 1901 ASSERT(Options::usePollingTraps()); 1901 1902 GPRTemporary unused(this); 1902 1903 GPRReg unusedGPR = unused.gpr(); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r213107 r213302 5545 5545 5546 5546 case CheckTraps: 5547 compileCheckTraps(node); 5547 if (Options::usePollingTraps()) 5548 compileCheckTraps(node); 5549 else 5550 noResult(node); // This is a no-op. 5548 5551 break; 5549 5552 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r213107 r213302 5329 5329 5330 5330 case CheckTraps: 5331 compileCheckTraps(node); 5331 if (Options::usePollingTraps()) 5332 compileCheckTraps(node); 5333 else 5334 noResult(node); // This is a no-op. 5332 5335 break; 5333 5336 -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r213233 r213302 1024 1024 break; 1025 1025 case CheckTraps: 1026 compileCheckTraps(); 1026 if (Options::usePollingTraps()) 1027 compileCheckTraps(); 1027 1028 break; 1028 1029 case CreateRest: … … 8987 8988 void compileCheckTraps() 8988 8989 { 8990 ASSERT(Options::usePollingTraps()); 8989 8991 LBasicBlock needTrapHandling = m_out.newBlock(); 8990 8992 LBasicBlock continuation = m_out.newBlock(); -
trunk/Source/JavaScriptCore/runtime/Options.h
r213209 r213302 407 407 \ 408 408 v(unsigned, watchdog, 0, Normal, "watchdog timeout (0 = Disabled, N = a timeout period of N milliseconds)") \ 409 v(bool, alwaysCheckTraps, false, Normal, "always emit op_check_traps bytecode") \ 410 v(bool, usePollingTraps, false, Normal, "use polling (instead of signalling) VM traps") \ 409 411 \ 410 412 v(bool, useICStats, false, Normal, nullptr) \ -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r213295 r213302 463 463 { 464 464 if (!m_watchdog) { 465 Options::usePollingTraps() = true; // Force polling traps on until we have support for signal based traps. 466 465 467 m_watchdog = adoptRef(new Watchdog(this)); 466 468 … … 974 976 } 975 977 978 void VM::setNeedAsynchronousTerminationSupport() 979 { 980 Options::usePollingTraps() = true; // Force polling traps on until we have support for signal based traps. 981 m_needAsynchronousTerminationSupport = true; 982 } 983 976 984 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/VM.h
r213295 r213302 681 681 682 682 bool needAsynchronousTerminationSupport() const { return m_needAsynchronousTerminationSupport; } 683 void setNeedAsynchronousTerminationSupport() { m_needAsynchronousTerminationSupport = true; }683 JS_EXPORT_PRIVATE void setNeedAsynchronousTerminationSupport(); 684 684 685 685 private:
Note:
See TracChangeset
for help on using the changeset viewer.