Changeset 164734 in webkit
- Timestamp:
- Feb 26, 2014 12:13:22 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r164732 r164734 1 2014-02-26 Mark Lam <mark.lam@apple.com> 2 3 Compilation policy management belongs in operationOptimize(), not the DFG Driver. 4 <https://webkit.org/b/129355> 5 6 Reviewed by Filip Pizlo. 7 8 By compilation policy, I mean the rules for determining whether to 9 compile, when to compile, when to attempt compilation again, etc. The 10 few of these policy decisions that were previously being made in the 11 DFG driver are now moved to operationOptimize() where we keep the rest 12 of the policy logic. Decisions that are based on the capabilities 13 supported by the DFG are moved to DFG capabiliityLevel(). 14 15 I've run the following benchmarks: 16 1. the collection of jsc benchmarks on the jsc executable vs. its 17 baseline. 18 2. Octane 2.0 in browser without the WebInspector. 19 3. Octane 2.0 in browser with the WebInspector open and a breakpoint 20 set somewhere where it won't break. 21 22 In all of these, the results came out to be a wash as expected. 23 24 * dfg/DFGCapabilities.cpp: 25 (JSC::DFG::isSupported): 26 (JSC::DFG::mightCompileEval): 27 (JSC::DFG::mightCompileProgram): 28 (JSC::DFG::mightCompileFunctionForCall): 29 (JSC::DFG::mightCompileFunctionForConstruct): 30 (JSC::DFG::mightInlineFunctionForCall): 31 (JSC::DFG::mightInlineFunctionForClosureCall): 32 (JSC::DFG::mightInlineFunctionForConstruct): 33 * dfg/DFGCapabilities.h: 34 * dfg/DFGDriver.cpp: 35 (JSC::DFG::compileImpl): 36 * jit/JITOperations.cpp: 37 1 38 2014-02-26 Michael Saboff <msaboff@apple.com> 2 39 -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
r164229 r164734 33 33 #include "Interpreter.h" 34 34 #include "JSCInlines.h" 35 #include "Options.h" 35 36 36 37 namespace JSC { namespace DFG { 37 38 39 bool isSupported(CodeBlock* codeBlock) 40 { 41 return Options::useDFGJIT() 42 && MacroAssembler::supportsFloatingPoint() 43 && Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount()); 44 } 45 38 46 bool mightCompileEval(CodeBlock* codeBlock) 39 47 { 40 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 48 return isSupported(codeBlock) 49 && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 41 50 } 42 51 bool mightCompileProgram(CodeBlock* codeBlock) 43 52 { 44 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 53 return isSupported(codeBlock) 54 && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 45 55 } 46 56 bool mightCompileFunctionForCall(CodeBlock* codeBlock) 47 57 { 48 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 58 return isSupported(codeBlock) 59 && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 49 60 } 50 61 bool mightCompileFunctionForConstruct(CodeBlock* codeBlock) 51 62 { 52 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 63 return isSupported(codeBlock) 64 && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount(); 53 65 } 54 66 55 67 bool mightInlineFunctionForCall(CodeBlock* codeBlock) 56 68 { 57 return codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount() 69 return isSupported(codeBlock) 70 && codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount() 58 71 && !codeBlock->ownerExecutable()->needsActivation() 59 72 && codeBlock->ownerExecutable()->isInliningCandidate(); … … 61 74 bool mightInlineFunctionForClosureCall(CodeBlock* codeBlock) 62 75 { 63 return codeBlock->instructionCount() <= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount() 76 return isSupported(codeBlock) 77 && codeBlock->instructionCount() <= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount() 64 78 && !codeBlock->ownerExecutable()->needsActivation() 65 79 && codeBlock->ownerExecutable()->isInliningCandidate(); … … 67 81 bool mightInlineFunctionForConstruct(CodeBlock* codeBlock) 68 82 { 69 return codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount() 83 return isSupported(codeBlock) 84 && codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount() 70 85 && !codeBlock->ownerExecutable()->needsActivation() 71 86 && codeBlock->ownerExecutable()->isInliningCandidate(); -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h
r164558 r164734 40 40 // Fast check functions; if they return true it is still necessary to 41 41 // check opcodes. 42 bool isSupported(CodeBlock*); 42 43 bool mightCompileEval(CodeBlock*); 43 44 bool mightCompileProgram(CodeBlock*); -
trunk/Source/JavaScriptCore/dfg/DFGDriver.cpp
r164207 r164734 35 35 #include "DFGThunks.h" 36 36 #include "DFGWorklist.h" 37 #include "Debugger.h"38 37 #include "JITCode.h" 39 38 #include "JSCInlines.h" … … 70 69 ASSERT(!profiledDFGCodeBlock || profiledDFGCodeBlock->jitType() == JITCode::DFGJIT); 71 70 72 if (!Options::useDFGJIT() || !MacroAssembler::supportsFloatingPoint())73 return CompilationFailed;74 75 if (!Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount()))76 return CompilationFailed;77 78 if (vm.enabledProfiler())79 return CompilationInvalidated;80 81 Debugger* debugger = codeBlock->globalObject()->debugger();82 if (debugger && (debugger->isStepping() || codeBlock->baselineAlternative()->hasDebuggerRequests()))83 return CompilationInvalidated;84 85 71 if (logCompilationChanges(mode)) 86 72 dataLog("DFG(Driver) compiling ", *codeBlock, " with ", mode, ", number of instructions = ", codeBlock->instructionCount(), "\n"); -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r164630 r164734 36 36 #include "DFGThunks.h" 37 37 #include "DFGWorklist.h" 38 #include "Debugger.h" 38 39 #include "Error.h" 39 40 #include "ErrorHandlingScope.h" … … 1008 1009 1009 1010 #if ENABLE(DFG_JIT) 1011 static void updateAllPredictionsAndOptimizeAfterWarmUp(CodeBlock* codeBlock) 1012 { 1013 codeBlock->updateAllPredictions(); 1014 codeBlock->optimizeAfterWarmUp(); 1015 } 1016 1010 1017 SlowPathReturnType JIT_OPERATION operationOptimize(ExecState* exec, int32_t bytecodeIndex) 1011 1018 { … … 1061 1068 } 1062 1069 1070 if (vm.enabledProfiler()) { 1071 updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock); 1072 return encodeResult(0, 0); 1073 } 1074 1075 Debugger* debugger = codeBlock->globalObject()->debugger(); 1076 if (debugger && (debugger->isStepping() || codeBlock->baselineAlternative()->hasDebuggerRequests())) { 1077 updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock); 1078 return encodeResult(0, 0); 1079 } 1080 1063 1081 if (codeBlock->m_shouldAlwaysBeInlined) { 1064 codeBlock->updateAllPredictions(); 1065 codeBlock->optimizeAfterWarmUp(); 1082 updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock); 1066 1083 if (Options::verboseOSR()) 1067 1084 dataLog("Choosing not to optimize ", *codeBlock, " yet, because m_shouldAlwaysBeInlined == true.\n");
Note: See TracChangeset
for help on using the changeset viewer.