Changeset 108444 in webkit for trunk/Source/JavaScriptCore/runtime/Executable.cpp
- Timestamp:
- Feb 21, 2012, 9:23:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r108358 r108444 30 30 #include "CodeBlock.h" 31 31 #include "DFGDriver.h" 32 #include "ExecutionHarness.h" 32 33 #include "JIT.h" 33 34 #include "JITDriver.h" … … 89 90 static void jettisonCodeBlock(JSGlobalData& globalData, OwnPtr<T>& codeBlock) 90 91 { 91 ASSERT( codeBlock->getJITType() != JITCode::BaselineJIT);92 ASSERT(JITCode::isOptimizingJIT(codeBlock->getJITType())); 92 93 ASSERT(codeBlock->alternative()); 93 94 OwnPtr<T> codeBlockToJettison = codeBlock.release(); … … 176 177 } 177 178 179 #if ENABLE(JIT) 180 void EvalExecutable::jitCompile(JSGlobalData& globalData) 181 { 182 bool result = jitCompileIfAppropriate(globalData, m_evalCodeBlock, m_jitCodeForCall, JITCode::bottomTierJIT()); 183 ASSERT_UNUSED(result, result); 184 } 185 #endif 186 187 inline const char* samplingDescription(JITCode::JITType jitType) 188 { 189 switch (jitType) { 190 case JITCode::InterpreterThunk: 191 return "Interpreter Compilation (TOTAL)"; 192 case JITCode::BaselineJIT: 193 return "Baseline Compilation (TOTAL)"; 194 case JITCode::DFGJIT: 195 return "DFG Compilation (TOTAL)"; 196 default: 197 ASSERT_NOT_REACHED(); 198 return 0; 199 } 200 } 201 178 202 JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType) 179 203 { 180 SamplingRegion samplingRegion( jitType == JITCode::BaselineJIT ? "Baseline Compilation (TOTAL)" : "DFG Compilation (TOTAL)");204 SamplingRegion samplingRegion(samplingDescription(jitType)); 181 205 182 206 #if !ENABLE(JIT) … … 219 243 220 244 #if ENABLE(JIT) 221 if (! jitCompileIfAppropriate(*globalData, m_evalCodeBlock, m_jitCodeForCall, jitType))245 if (!prepareForExecution(*globalData, m_evalCodeBlock, m_jitCodeForCall, jitType)) 222 246 return 0; 223 247 #endif … … 304 328 } 305 329 330 #if ENABLE(JIT) 331 void ProgramExecutable::jitCompile(JSGlobalData& globalData) 332 { 333 bool result = jitCompileIfAppropriate(globalData, m_programCodeBlock, m_jitCodeForCall, JITCode::bottomTierJIT()); 334 ASSERT_UNUSED(result, result); 335 } 336 #endif 337 306 338 JSObject* ProgramExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType) 307 339 { 308 SamplingRegion samplingRegion( jitType == JITCode::BaselineJIT ? "Baseline Compilation (TOTAL)" : "DFG Compilation (TOTAL)");340 SamplingRegion samplingRegion(samplingDescription(jitType)); 309 341 310 342 #if !ENABLE(JIT) … … 345 377 346 378 #if ENABLE(JIT) 347 if (! jitCompileIfAppropriate(*globalData, m_programCodeBlock, m_jitCodeForCall, jitType))379 if (!prepareForExecution(*globalData, m_programCodeBlock, m_jitCodeForCall, jitType)) 348 380 return 0; 349 381 #endif … … 421 453 result = static_cast<FunctionCodeBlock*>(result->alternative()); 422 454 ASSERT(result); 423 ASSERT( result->getJITType() == JITCode::BaselineJIT);455 ASSERT(JITCode::isBaselineCode(result->getJITType())); 424 456 return result; 425 457 } … … 446 478 return error; 447 479 } 480 481 #if ENABLE(JIT) 482 void FunctionExecutable::jitCompileForCall(JSGlobalData& globalData) 483 { 484 bool result = jitCompileFunctionIfAppropriate(globalData, m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, JITCode::bottomTierJIT()); 485 ASSERT_UNUSED(result, result); 486 } 487 488 void FunctionExecutable::jitCompileForConstruct(JSGlobalData& globalData) 489 { 490 bool result = jitCompileFunctionIfAppropriate(globalData, m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, JITCode::bottomTierJIT()); 491 ASSERT_UNUSED(result, result); 492 } 493 #endif 448 494 449 495 FunctionCodeBlock* FunctionExecutable::codeBlockWithBytecodeFor(CodeSpecializationKind kind) … … 491 537 JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType) 492 538 { 493 SamplingRegion samplingRegion( jitType == JITCode::BaselineJIT ? "Baseline Compilation (TOTAL)" : "DFG Compilation (TOTAL)");539 SamplingRegion samplingRegion(samplingDescription(jitType)); 494 540 495 541 #if !ENABLE(JIT) … … 513 559 514 560 #if ENABLE(JIT) 515 if (! jitCompileFunctionIfAppropriate(exec->globalData(), m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, jitType))561 if (!prepareFunctionForExecution(exec->globalData(), m_codeBlockForCall, m_jitCodeForCall, m_jitCodeForCallWithArityCheck, m_symbolTable, jitType, CodeForCall)) 516 562 return 0; 517 563 #endif … … 533 579 JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, ScopeChainNode* scopeChainNode, JITCode::JITType jitType) 534 580 { 535 SamplingRegion samplingRegion( jitType == JITCode::BaselineJIT ? "Baseline Compilation (TOTAL)" : "DFG Compilation (TOTAL)");581 SamplingRegion samplingRegion(samplingDescription(jitType)); 536 582 537 583 #if !ENABLE(JIT) … … 555 601 556 602 #if ENABLE(JIT) 557 if (! jitCompileFunctionIfAppropriate(exec->globalData(), m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, jitType))603 if (!prepareFunctionForExecution(exec->globalData(), m_codeBlockForConstruct, m_jitCodeForConstruct, m_jitCodeForConstructWithArityCheck, m_symbolTable, jitType, CodeForConstruct)) 558 604 return 0; 559 605 #endif
Note:
See TracChangeset
for help on using the changeset viewer.