Changeset 90437 in webkit
- Timestamp:
- Jul 5, 2011 11:35:44 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r90426 r90437 1 2011-07-05 Filip Pizlo <fpizlo@apple.com> 2 3 DFG JIT virtual call implementation is inefficient. 4 https://bugs.webkit.org/show_bug.cgi?id=63974 5 6 Reviewed by Gavin Barraclough. 7 8 * dfg/DFGOperations.cpp: 9 * runtime/Executable.h: 10 (JSC::ExecutableBase::generatedJITCodeForCallWithArityCheck): 11 (JSC::ExecutableBase::generatedJITCodeForConstructWithArityCheck): 12 (JSC::ExecutableBase::generatedJITCodeWithArityCheckFor): 13 (JSC::ExecutableBase::hasJITCodeForCall): 14 (JSC::ExecutableBase::hasJITCodeForConstruct): 15 (JSC::ExecutableBase::hasJITCodeFor): 16 * runtime/JSFunction.h: 17 (JSC::JSFunction::scopeUnchecked): 18 1 19 2011-07-05 Oliver Hunt <oliver@apple.com> 2 20 -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r90423 r90437 489 489 JSValue calleeAsValue = execCallee->calleeAsValue(); 490 490 JSCell* calleeAsFunctionCell = getJSFunction(*globalData, calleeAsValue); 491 if ( !calleeAsFunctionCell)491 if (UNLIKELY(!calleeAsFunctionCell)) 492 492 return handleHostCall(execCallee, calleeAsValue); 493 493 494 494 JSFunction* function = asFunction(calleeAsFunctionCell); 495 495 ExecutableBase* executable = function->executable(); 496 if (executable->isHostFunction()) 497 return executable->generatedJITCodeForCall().addressForCall().executableAddress(); 498 499 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 500 JSObject* error = functionExecutable->compileForCall(exec, function->scope()); 501 if (error) { 502 exec->globalData().exception = error; 503 return 0; 504 } 505 execCallee->setScopeChain(function->scope()); 506 return functionExecutable->generatedJITCodeForCallWithArityCheck().executableAddress(); 496 if (UNLIKELY(!executable->hasJITCodeForCall())) { 497 FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable); 498 JSObject* error = functionExecutable->compileForCall(exec, function->scope()); 499 if (error) { 500 exec->globalData().exception = error; 501 return 0; 502 } 503 } 504 execCallee->setScopeChain(function->scopeUnchecked()); 505 return executable->generatedJITCodeForCallWithArityCheck().executableAddress(); 507 506 } 508 507 -
trunk/Source/JavaScriptCore/runtime/Executable.h
r90414 r90437 103 103 } 104 104 105 MacroAssemblerCodePtr generatedJITCodeForCallWithArityCheck() 106 { 107 ASSERT(m_jitCodeForCall); 108 ASSERT(m_jitCodeForCallWithArityCheck); 109 return m_jitCodeForCallWithArityCheck; 110 } 111 112 MacroAssemblerCodePtr generatedJITCodeForConstructWithArityCheck() 113 { 114 ASSERT(m_jitCodeForConstruct); 115 ASSERT(m_jitCodeForConstructWithArityCheck); 116 return m_jitCodeForConstructWithArityCheck; 117 } 118 119 MacroAssemblerCodePtr generatedJITCodeWithArityCheckFor(CodeSpecializationKind kind) 120 { 121 if (kind == CodeForCall) 122 return generatedJITCodeForCallWithArityCheck(); 123 ASSERT(kind == CodeForConstruct); 124 return generatedJITCodeForConstructWithArityCheck(); 125 } 126 127 bool hasJITCodeForCall() const 128 { 129 return m_numParametersForCall >= 0; 130 } 131 132 bool hasJITCodeForConstruct() const 133 { 134 return m_numParametersForConstruct >= 0; 135 } 136 137 bool hasJITCodeFor(CodeSpecializationKind kind) const 138 { 139 if (kind == CodeForCall) 140 return hasJITCodeForCall(); 141 ASSERT(kind == CodeForConstruct); 142 return hasJITCodeForConstruct(); 143 } 144 105 145 void clearExecutableCode() 106 146 { … … 456 496 Identifier m_name; 457 497 SharedSymbolTable* m_symbolTable; 458 459 #if ENABLE(JIT)460 public:461 MacroAssemblerCodePtr generatedJITCodeForCallWithArityCheck()462 {463 ASSERT(m_jitCodeForCall);464 ASSERT(m_jitCodeForCallWithArityCheck);465 return m_jitCodeForCallWithArityCheck;466 }467 468 MacroAssemblerCodePtr generatedJITCodeForConstructWithArityCheck()469 {470 ASSERT(m_jitCodeForConstruct);471 ASSERT(m_jitCodeForConstructWithArityCheck);472 return m_jitCodeForConstructWithArityCheck;473 }474 475 MacroAssemblerCodePtr generatedJITCodeWithArityCheckFor(CodeSpecializationKind kind)476 {477 if (kind == CodeForCall)478 return generatedJITCodeForCallWithArityCheck();479 ASSERT(kind == CodeForConstruct);480 return generatedJITCodeForConstructWithArityCheck();481 }482 #endif483 498 }; 484 499 -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r90423 r90437 64 64 return m_scopeChain.get(); 65 65 } 66 // This method may be called for host functins, in which case it 67 // will return an arbitrary value. This should only be used for 68 // optimized paths in which the return value does not matter for 69 // host functions, and checking whether the function is a host 70 // function is deemed too expensive. 71 ScopeChainNode* scopeUnchecked() 72 { 73 return m_scopeChain.get(); 74 } 66 75 void setScope(JSGlobalData& globalData, ScopeChainNode* scopeChain) 67 76 {
Note: See TracChangeset
for help on using the changeset viewer.