Changeset 47597 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Aug 20, 2009, 2:49:07 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Executable.cpp
r47519 r47597 86 86 OwnPtr<BytecodeGenerator> generator(new BytecodeGenerator(body(), globalObject->debugger(), scopeChain, &m_codeBlock->symbolTable(), m_codeBlock)); 87 87 generator->generate(); 88 m_numParameters = m_codeBlock->m_numParameters; 89 ASSERT(m_numParameters); 88 90 89 91 body()->destroyData(); … … 126 128 127 129 #endif 128 129 bool FunctionExecutable::isHostFunction() const130 {131 return m_codeBlock && m_codeBlock->codeType() == NativeCode;132 }133 130 134 131 void FunctionExecutable::markAggregate(MarkStack& markStack) … … 198 195 delete m_codeBlock; 199 196 m_codeBlock = 0; 197 m_numParameters = NUM_PARAMETERS_NOT_COMPILED; 200 198 #if ENABLE(JIT) 201 199 m_jitCode = JITCode(); … … 205 203 #if ENABLE(JIT) 206 204 FunctionExecutable::FunctionExecutable(ExecState* exec) 207 : m_codeBlock( new NativeCodeBlock(this))205 : m_codeBlock(0) 208 206 , m_name(Identifier(exec, "<native thunk>")) 209 207 { 210 208 m_jitCode = JITCode(JITCode::HostFunction(exec->globalData().jitStubs.ctiNativeCallThunk())); 209 m_numParameters = NUM_PARAMETERS_IS_HOST; 211 210 } 212 211 #endif -
trunk/JavaScriptCore/runtime/Executable.h
r47582 r47597 41 41 friend class JIT; 42 42 public: 43 enum Mode { 44 NoJITCode, 45 HasJITCode, 46 IsHost 47 }; 48 static const int NUM_PARAMETERS_IS_HOST = 0; 49 static const int NUM_PARAMETERS_NOT_COMPILED = -1; 50 43 51 virtual ~ExecutableBase() {} 44 52 45 53 ExecutableBase(const SourceCode& source) 46 54 : m_source(source) 55 , m_numParameters(NUM_PARAMETERS_NOT_COMPILED) 47 56 { 48 57 } … … 63 72 RefPtr<ScopeNode> m_node; 64 73 SourceCode m_source; 74 int m_numParameters; 65 75 66 76 private: … … 220 230 UString paramString() const { return body()->paramString(); } 221 231 222 bool isHostFunction() const ;232 bool isHostFunction() const { return m_numParameters == NUM_PARAMETERS_IS_HOST; } 223 233 bool isGenerated() const 224 234 { -
trunk/JavaScriptCore/runtime/JSFunction.cpp
r47412 r47597 90 90 // are based on a check for the this pointer value for this JSFunction - which will no longer be valid once 91 91 // this memory is freed and may be reused (potentially for another, different JSFunction). 92 if (!isHostFunction()) { 92 93 #if ENABLE(JIT_OPTIMIZE_CALL) 93 if (m_executable && m_executable->isGenerated())94 m_executable->generatedBytecode().unlinkCallers();94 if (m_executable && m_executable->isGenerated()) 95 m_executable->generatedBytecode().unlinkCallers(); 95 96 #endif 96 if (!isHostFunction())97 97 scopeChain().~ScopeChain(); // FIXME: Don't we need to do this in the interpreter too? 98 } 98 99 } 99 100
Note:
See TracChangeset
for help on using the changeset viewer.