Changeset 47641 in webkit for trunk/JavaScriptCore/runtime/JSFunction.cpp
- Timestamp:
- Aug 21, 2009, 2:54:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSFunction.cpp
r47597 r47641 46 46 const ClassInfo JSFunction::info = { "Function", &InternalFunction::info, 0, 0 }; 47 47 48 inline bool JSFunction::isHostFunction() const49 {50 return m_executable && m_executable->isHostFunction();51 }52 53 48 bool JSFunction::isHostFunctionNonInline() const 54 49 { … … 58 53 JSFunction::JSFunction(PassRefPtr<Structure> structure) 59 54 : Base(structure) 60 { 61 clearScopeChain(); 55 #if ENABLE(JIT) 56 , m_executable(adoptRef(new VPtrHackExecutable())) 57 #endif 58 { 62 59 } 63 60 … … 65 62 : Base(&exec->globalData(), structure, name) 66 63 #if ENABLE(JIT) 67 , m_executable( FunctionExecutable::createNativeThunk(exec))64 , m_executable(adoptRef(new NativeExecutable(exec))) 68 65 #endif 69 66 { … … 92 89 if (!isHostFunction()) { 93 90 #if ENABLE(JIT_OPTIMIZE_CALL) 94 if (m_executable && m_executable->isGenerated()) 95 m_executable->generatedBytecode().unlinkCallers(); 91 ASSERT(m_executable); 92 if (jsExecutable()->isGenerated()) 93 jsExecutable()->generatedBytecode().unlinkCallers(); 96 94 #endif 97 95 scopeChain().~ScopeChain(); // FIXME: Don't we need to do this in the interpreter too? … … 102 100 { 103 101 Base::markChildren(markStack); 104 m_executable->markAggregate(markStack);105 if (!isHostFunction())102 if (!isHostFunction()) { 103 jsExecutable()->markAggregate(markStack); 106 104 scopeChain().markAggregate(markStack); 105 } 107 106 } 108 107 … … 113 112 return CallTypeHost; 114 113 } 115 callData.js.functionExecutable = m_executable.get();114 callData.js.functionExecutable = jsExecutable(); 116 115 callData.js.scopeChain = scopeChain().node(); 117 116 return CallTypeJS; … … 121 120 { 122 121 ASSERT(!isHostFunction()); 123 return exec->interpreter()->execute( m_executable.get(), exec, this, thisValue.toThisObject(exec), args, scopeChain().node(), exec->exceptionSlot());122 return exec->interpreter()->execute(jsExecutable(), exec, this, thisValue.toThisObject(exec), args, scopeChain().node(), exec->exceptionSlot()); 124 123 } 125 124 … … 142 141 JSFunction* thisObj = asFunction(slot.slotBase()); 143 142 ASSERT(!thisObj->isHostFunction()); 144 return jsNumber(exec, thisObj-> m_executable->parameterCount());143 return jsNumber(exec, thisObj->jsExecutable()->parameterCount()); 145 144 } 146 145 … … 206 205 if (isHostFunction()) 207 206 return ConstructTypeNone; 208 constructData.js.functionExecutable = m_executable.get();207 constructData.js.functionExecutable = jsExecutable(); 209 208 constructData.js.scopeChain = scopeChain().node(); 210 209 return ConstructTypeJS; … … 222 221 JSObject* thisObj = new (exec) JSObject(structure); 223 222 224 JSValue result = exec->interpreter()->execute( m_executable.get(), exec, this, thisObj, args, scopeChain().node(), exec->exceptionSlot());223 JSValue result = exec->interpreter()->execute(jsExecutable(), exec, this, thisObj, args, scopeChain().node(), exec->exceptionSlot()); 225 224 if (exec->hadException() || !result.isObject()) 226 225 return thisObj;
Note:
See TracChangeset
for help on using the changeset viewer.