Changeset 256500 in webkit
- Timestamp:
- Feb 12, 2020 8:11:51 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r256498 r256500 1 2020-02-12 Mark Lam <mark.lam@apple.com> 2 3 Add options for debugging WASM code. 4 https://bugs.webkit.org/show_bug.cgi?id=207677 5 <rdar://problem/59411390> 6 7 Reviewed by Yusuke Suzuki. 8 9 Specifically ... 10 11 JSC_useBBQJIT - allows the BBQ JIT to be used if true 12 JSC_useOMGJIT - allows the OMG JIT to be used if true 13 JSC_useWasmLLIntPrologueOSR - allows prologue OSR from Wasm LLInt if true 14 JSC_useWasmLLIntLoopOSR - allows loop OSR from Wasm LLInt if true 15 JSC_useWasmLLIntEpilogueOSR - allows epilogue OSR from Wasm LLInt if true 16 JSC_wasmFunctionIndexRangeToCompile=N:M - wasm function index range to allow compilation on, e.g. 1:100 17 18 * JavaScriptCore.xcodeproj/project.pbxproj: 19 * runtime/Options.cpp: 20 (JSC::Options::ensureOptionsAreCoherent): 21 * runtime/OptionsList.h: 22 * wasm/WasmBBQPlan.cpp: 23 (JSC::Wasm::BBQPlan::BBQPlan): 24 * wasm/WasmOMGForOSREntryPlan.cpp: 25 (JSC::Wasm::OMGForOSREntryPlan::OMGForOSREntryPlan): 26 * wasm/WasmOMGPlan.cpp: 27 (JSC::Wasm::OMGPlan::OMGPlan): 28 * wasm/WasmOperations.cpp: 29 (JSC::Wasm::shouldJIT): 30 (JSC::Wasm::operationWasmTriggerOSREntryNow): 31 (JSC::Wasm::operationWasmTriggerTierUpNow): 32 * wasm/WasmSlowPaths.cpp: 33 (JSC::LLInt::shouldJIT): 34 (JSC::LLInt::WASM_SLOW_PATH_DECL): 35 1 36 2020-02-12 Yusuke Suzuki <ysuzuki@apple.com> 2 37 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r255687 r256500 5074 5074 F692A8870255597D01FF60F7 /* JSCJSValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCJSValue.cpp; sourceTree = "<group>"; tabWidth = 8; }; 5075 5075 F73926918DC64330AFCDF0D7 /* JSSourceCode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSourceCode.cpp; sourceTree = "<group>"; }; 5076 FE00262223F3AF33003A358F /* WebAssembly.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = WebAssembly.asm; path = llint/WebAssembly.asm; sourceTree = "<group>"; }; 5076 5077 FE086BC92123DEFA003F2929 /* EntryFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntryFrame.h; sourceTree = "<group>"; }; 5077 5078 FE0D4A041AB8DD0A002F54BF /* ExecutionTimeLimitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExecutionTimeLimitTest.cpp; path = API/tests/ExecutionTimeLimitTest.cpp; sourceTree = "<group>"; }; … … 5477 5478 86A054471556451B00445157 /* LowLevelInterpreter32_64.asm */, 5478 5479 86A054481556451B00445157 /* LowLevelInterpreter64.asm */, 5480 FE00262223F3AF33003A358F /* WebAssembly.asm */, 5479 5481 ); 5480 5482 name = llint; -
trunk/Source/JavaScriptCore/runtime/Options.cpp
r254735 r256500 950 950 dataLog("INCOHERENT OPTIONS: at least one of useLLInt or useJIT must be true\n"); 951 951 } 952 if (useWebAssembly() && !(useWasmLLInt() || useBBQJIT())) { 953 coherent = false; 954 dataLog("INCOHERENT OPTIONS: at least one of useWasmLLInt or useBBQJIT must be true\n"); 955 } 952 956 if (!coherent) 953 957 CRASH(); -
trunk/Source/JavaScriptCore/runtime/OptionsList.h
r255897 r256500 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 468 468 v(Bool, wasmBBQUsesAir, true, Normal, nullptr) \ 469 469 v(Bool, useWasmLLInt, true, Normal, nullptr) \ 470 v(Bool, useBBQJIT, true, Normal, "allows the BBQ JIT to be used if true") \ 471 v(Bool, useOMGJIT, true, Normal, "allows the OMG JIT to be used if true") \ 472 v(Bool, useWasmLLIntPrologueOSR, true, Normal, "allows prologue OSR from Wasm LLInt if true") \ 473 v(Bool, useWasmLLIntLoopOSR, true, Normal, "allows loop OSR from Wasm LLInt if true") \ 474 v(Bool, useWasmLLIntEpilogueOSR, true, Normal, "allows epilogue OSR from Wasm LLInt if true") \ 475 v(OptionRange, wasmFunctionIndexRangeToCompile, 0, Normal, "wasm function index range to allow compilation on, e.g. 1:100") \ 470 476 v(Bool, wasmLLIntTiersUpToBBQ, true, Normal, nullptr) \ 471 477 v(Size, webAssemblyBBQAirModeThreshold, isIOS() ? (10 * MB) : 0, Normal, "If 0, we always use BBQ Air. If Wasm module code size hits this threshold, we compile Wasm module with B3 BBQ mode.") \ -
trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
r253314 r256500 1 1 /* 2 * Copyright (C) 2016-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2016-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 59 59 , m_functionIndex(functionIndex) 60 60 { 61 ASSERT(Options::useBBQJIT()); 61 62 setMode(m_codeBlock->mode()); 63 dataLogLnIf(WasmBBQPlanInternal::verbose, "Starting BBQ plan for ", functionIndex); 62 64 } 63 65 -
trunk/Source/JavaScriptCore/wasm/WasmOMGForOSREntryPlan.cpp
r253314 r256500 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 62 62 , m_loopIndex(loopIndex) 63 63 { 64 ASSERT(Options::useOMGJIT()); 64 65 setMode(mode); 65 66 ASSERT(m_codeBlock->runnable()); -
trunk/Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
r253314 r256500 1 1 /* 2 * Copyright (C) 2017-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2017-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 60 60 , m_functionIndex(functionIndex) 61 61 { 62 ASSERT(Options::useOMGJIT()); 62 63 setMode(mode); 63 64 ASSERT(m_codeBlock->runnable()); -
trunk/Source/JavaScriptCore/wasm/WasmOperations.cpp
r254735 r256500 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 234 234 } 235 235 236 inline bool shouldJIT(unsigned functionIndex) 237 { 238 if (!VM::canUseJIT()) 239 return false; 240 if (!Options::useOMGJIT()) 241 return false; 242 if (!Options::wasmFunctionIndexRangeToCompile().isInRange(functionIndex)) 243 return false; 244 return true; 245 } 246 236 247 void JIT_OPERATION operationWasmTriggerOSREntryNow(Probe::Context& context) 237 248 { … … 254 265 BBQCallee& callee = static_cast<BBQCallee&>(codeBlock.wasmBBQCalleeFromFunctionIndexSpace(functionIndexInSpace)); 255 266 TierUpCount& tierUp = *callee.tierUpCount(); 267 268 if (!shouldJIT(functionIndex)) { 269 tierUp.deferIndefinitely(); 270 return returnWithoutOSREntry(); 271 } 272 256 273 dataLogLnIf(Options::verboseOSR(), "Consider OMGForOSREntryPlan for [", functionIndex, "] loopIndex#", loopIndex, " with executeCounter = ", tierUp, " ", RawPointer(callee.replacement())); 257 274 … … 427 444 BBQCallee& callee = static_cast<BBQCallee&>(codeBlock.wasmBBQCalleeFromFunctionIndexSpace(functionIndexInSpace)); 428 445 TierUpCount& tierUp = *callee.tierUpCount(); 446 447 if (!shouldJIT(functionIndex)) { 448 tierUp.deferIndefinitely(); 449 return; 450 } 451 429 452 dataLogLnIf(Options::verboseOSR(), "Consider OMGPlan for [", functionIndex, "] with executeCounter = ", tierUp, " ", RawPointer(callee.replacement())); 430 453 -
trunk/Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
r255040 r256500 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 81 81 : callFrame->r(virtualRegister)) 82 82 83 enum class RequiredWasmJIT { Any, OMG }; 84 85 inline bool shouldJIT(Wasm::FunctionCodeBlock* codeBlock, RequiredWasmJIT requiredJIT = RequiredWasmJIT::Any) 86 { 87 if (!VM::canUseJIT()) 88 return false; 89 if (requiredJIT == RequiredWasmJIT::OMG) { 90 if (!Options::useOMGJIT()) 91 return false; 92 } else { 93 if (Options::wasmLLIntTiersUpToBBQ() && !Options::useBBQJIT()) 94 return false; 95 if (!Options::wasmLLIntTiersUpToBBQ() && !Options::useOMGJIT()) 96 return false; 97 } 98 if (!Options::wasmFunctionIndexRangeToCompile().isInRange(codeBlock->functionIndex())) 99 return false; 100 return true; 101 } 102 83 103 inline bool jitCompileAndSetHeuristics(Wasm::LLIntCallee* callee, Wasm::FunctionCodeBlock* codeBlock, Wasm::Instance* instance) 84 104 { … … 136 156 Wasm::FunctionCodeBlock* codeBlock = CODE_BLOCK(); 137 157 138 dataLogLnIf(Options::verboseOSR(), *callee, ": Entered epilogue_osr with tierUpCounter = ", codeBlock->tierUpCounter()); 158 if (!shouldJIT(codeBlock)) { 159 codeBlock->tierUpCounter().deferIndefinitely(); 160 WASM_RETURN_TWO(nullptr, nullptr); 161 } 162 163 if (!Options::useWasmLLIntPrologueOSR()) 164 WASM_RETURN_TWO(nullptr, nullptr); 165 166 dataLogLnIf(Options::verboseOSR(), *callee, ": Entered prologue_osr with tierUpCounter = ", codeBlock->tierUpCounter()); 139 167 140 168 if (!jitCompileAndSetHeuristics(callee, codeBlock, instance)) 141 WASM_RETURN_TWO( 0, 0);169 WASM_RETURN_TWO(nullptr, nullptr); 142 170 143 171 WASM_RETURN_TWO(callee->replacement()->entrypoint().executableAddress(), 0); … … 146 174 WASM_SLOW_PATH_DECL(loop_osr) 147 175 { 148 if (!Options::useWebAssemblyOSR()) {149 slow_path_wasm_prologue_osr(callFrame, pc, instance);150 WASM_RETURN_TWO(0, 0);151 }152 153 176 Wasm::LLIntCallee* callee = static_cast<Wasm::LLIntCallee*>(callFrame->callee().asWasmCallee()); 154 177 Wasm::FunctionCodeBlock* codeBlock = CODE_BLOCK(); 155 178 Wasm::LLIntTierUpCounter& tierUpCounter = codeBlock->tierUpCounter(); 179 180 if (!Options::useWebAssemblyOSR() || !Options::useWasmLLIntLoopOSR() || !shouldJIT(codeBlock, RequiredWasmJIT::OMG)) { 181 slow_path_wasm_prologue_osr(callFrame, pc, instance); 182 WASM_RETURN_TWO(0, 0); 183 } 156 184 157 185 dataLogLnIf(Options::verboseOSR(), *callee, ": Entered loop_osr with tierUpCounter = ", codeBlock->tierUpCounter()); … … 221 249 Wasm::LLIntCallee* callee = static_cast<Wasm::LLIntCallee*>(callFrame->callee().asWasmCallee()); 222 250 Wasm::FunctionCodeBlock* codeBlock = CODE_BLOCK(); 251 252 if (!shouldJIT(codeBlock)) { 253 codeBlock->tierUpCounter().deferIndefinitely(); 254 WASM_END_IMPL(); 255 } 256 if (!Options::useWasmLLIntEpilogueOSR()) 257 WASM_END_IMPL(); 223 258 224 259 dataLogLnIf(Options::verboseOSR(), *callee, ": Entered epilogue_osr with tierUpCounter = ", codeBlock->tierUpCounter());
Note: See TracChangeset
for help on using the changeset viewer.