Changeset 153165 in webkit for trunk/Source/JavaScriptCore/dfg/DFGDriver.cpp
- Timestamp:
- Jul 24, 2013, 9:00:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGDriver.cpp
r153161 r153165 32 32 #if ENABLE(DFG_JIT) 33 33 34 #include "CodeBlock.h" 34 35 #include "DFGJITCode.h" 35 36 #include "DFGPlan.h" … … 39 40 #include "Operations.h" 40 41 #include "Options.h" 42 #include "SamplingTool.h" 41 43 42 44 namespace JSC { namespace DFG { … … 49 51 } 50 52 51 static boolcompile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, MacroAssemblerCodePtr* jitCodeWithArityCheck, unsigned osrEntryBytecodeIndex)53 static CompilationResult compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, MacroAssemblerCodePtr* jitCodeWithArityCheck, unsigned osrEntryBytecodeIndex) 52 54 { 53 55 SamplingRegion samplingRegion("DFG Compilation (Driver)"); … … 62 64 63 65 if (!Options::useDFGJIT()) 64 return false;66 return CompilationFailed; 65 67 66 68 if (!Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount())) 67 return false;69 return CompilationFailed; 68 70 69 71 if (logCompilationChanges()) … … 90 92 else 91 93 numVarsWithValues = 0; 92 Plan plan(compileMode, codeBlock, osrEntryBytecodeIndex, numVarsWithValues); 93 for (size_t i = 0; i < plan.mustHandleValues.size(); ++i) { 94 int operand = plan.mustHandleValues.operandForIndex(i); 94 RefPtr<Plan> plan = adoptRef( 95 new Plan(compileMode, codeBlock, osrEntryBytecodeIndex, numVarsWithValues)); 96 for (size_t i = 0; i < plan->mustHandleValues.size(); ++i) { 97 int operand = plan->mustHandleValues.operandForIndex(i); 95 98 if (operandIsArgument(operand) 96 99 && !operandToArgument(operand) … … 101 104 // but it has to be an actual value that can be grokked by subsequent DFG passes, 102 105 // so we sanitize it here by turning it into Undefined. 103 plan .mustHandleValues[i] = jsUndefined();106 plan->mustHandleValues[i] = jsUndefined(); 104 107 } else 105 plan .mustHandleValues[i] = exec->uncheckedR(operand).jsValue();108 plan->mustHandleValues[i] = exec->uncheckedR(operand).jsValue(); 106 109 } 107 110 108 plan.compileInThread(); 109 if (plan.finalize(jitCode, jitCodeWithArityCheck) != CompilationSuccessful) 110 return false; 111 return true; 111 plan->compileInThread(); 112 return plan->finalize(jitCode, jitCodeWithArityCheck); 112 113 } 113 114 114 booltryCompile(ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, unsigned bytecodeIndex)115 CompilationResult tryCompile(ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, unsigned bytecodeIndex) 115 116 { 116 117 return compile(CompileOther, exec, codeBlock, jitCode, 0, bytecodeIndex); 117 118 } 118 119 119 booltryCompileFunction(ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, unsigned bytecodeIndex)120 CompilationResult tryCompileFunction(ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, MacroAssemblerCodePtr& jitCodeWithArityCheck, unsigned bytecodeIndex) 120 121 { 121 122 return compile(CompileFunction, exec, codeBlock, jitCode, &jitCodeWithArityCheck, bytecodeIndex); 123 } 124 125 CompilationResult tryFinalizePlan(PassRefPtr<Plan> plan, RefPtr<JSC::JITCode>& jitCode, MacroAssemblerCodePtr* jitCodeWithArityCheck) 126 { 127 return plan->finalize(jitCode, jitCodeWithArityCheck); 122 128 } 123 129
Note:
See TracChangeset
for help on using the changeset viewer.