Changeset 31173 in webkit for trunk/JavaScriptCore/kjs/ExecState.cpp
- Timestamp:
- Mar 20, 2008, 2:34:47 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/ExecState.cpp
r31172 r31173 30 30 #include "internal.h" 31 31 #include "scope_chain_mark.h" 32 #include "ExecStateInlines.h" 32 33 33 34 namespace KJS { … … 110 111 } 111 112 112 inline ExecState::ExecState(JSGlobalObject* globalObject, JSObject* thisObject,113 FunctionBodyNode* functionBodyNode, ExecState* callingExec,114 FunctionImp* func, const List& args)115 : m_globalObject(globalObject)116 , m_exception(0)117 , m_propertyNames(callingExec->m_propertyNames)118 , m_emptyList(callingExec->m_emptyList)119 , m_callingExec(callingExec)120 , m_scopeNode(functionBodyNode)121 , m_function(func)122 , m_arguments(&args)123 , m_scopeChain(func->scope())124 , m_inlineScopeChainNode(0, 0)125 , m_thisValue(thisObject)126 , m_iterationDepth(0)127 , m_switchDepth(0)128 , m_codeType(FunctionCode)129 {130 ASSERT(m_scopeNode);131 132 ActivationImp* activation = globalObject->pushActivation(this);133 m_activation = activation;134 m_localStorage = &activation->localStorage();135 m_variableObject = activation;136 if (functionBodyNode->usesEval() || functionBodyNode->needsClosure())137 m_scopeChain.push(activation);138 else {139 m_inlineScopeChainNode.object = activation;140 // The ScopeChain will ref this node itself, so we don't need to worry about141 // anything trying to delete our scopenode142 m_scopeChain.push(&m_inlineScopeChainNode);143 }144 }145 146 inline ExecState::~ExecState()147 {148 }149 150 113 JSGlobalObject* ExecState::lexicalGlobalObject() const 151 114 { … … 188 151 m_globalObject->activeExecStates().removeLast(); 189 152 } 190 191 FunctionExecState::FunctionExecState(JSGlobalObject* globalObject, JSObject* thisObject, 192 FunctionBodyNode* functionBodyNode, ExecState* callingExec, 193 FunctionImp* func, const List& args) 194 : ExecState(globalObject, thisObject, functionBodyNode, callingExec, func, args) 195 { 196 m_globalObject->activeExecStates().append(this); 197 } 198 199 FunctionExecState::~FunctionExecState() 200 { 201 ASSERT(m_globalObject->activeExecStates().last() == this); 202 m_globalObject->activeExecStates().removeLast(); 203 204 if (m_activation->needsPop()) 205 m_globalObject->popActivation(); 206 } 207 153 208 154 } // namespace KJS
Note:
See TracChangeset
for help on using the changeset viewer.