Changeset 80277 in webkit for trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
- Timestamp:
- Mar 3, 2011, 1:24:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r80179 r80277 41 41 42 42 JSActivation::JSActivation(CallFrame* callFrame, NonNullPassRefPtr<FunctionExecutable> functionExecutable) 43 : Base(callFrame->globalData().activationStructure, new JSActivationData(functionExecutable, callFrame->registers())) 43 : Base(callFrame->globalData().activationStructure, functionExecutable->symbolTable(), callFrame->registers()) 44 , m_functionExecutable(functionExecutable) 44 45 { 45 46 ASSERT(inherits(&s_info)); 47 48 // We have to manually ref and deref the symbol table as JSVariableObjectData 49 // doesn't know about SharedSymbolTable 50 static_cast<SharedSymbolTable*>(m_symbolTable)->ref(); 46 51 } 47 52 48 53 JSActivation::~JSActivation() 49 54 { 50 delete d();55 static_cast<SharedSymbolTable*>(m_symbolTable)->deref(); 51 56 } 52 57 … … 56 61 57 62 // No need to mark our registers if they're still in the RegisterFile. 58 Register* registerArray = d()->registerArray.get();63 Register* registerArray = m_registerArray.get(); 59 64 if (!registerArray) 60 65 return; 61 66 62 size_t numParametersMinusThis = d()->functionExecutable->parameterCount();67 size_t numParametersMinusThis = m_functionExecutable->parameterCount(); 63 68 64 69 size_t count = numParametersMinusThis; 65 70 markStack.deprecatedAppendValues(registerArray, count); 66 71 67 size_t numVars = d()->functionExecutable->capturedVariableCount();72 size_t numVars = m_functionExecutable->capturedVariableCount(); 68 73 69 74 // Skip the call frame, which sits between the parameters and vars. … … 75 80 SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl()); 76 81 if (!entry.isNull()) { 77 ASSERT(entry.getIndex() < static_cast<int>( d()->functionExecutable->capturedVariableCount()));82 ASSERT(entry.getIndex() < static_cast<int>(m_functionExecutable->capturedVariableCount())); 78 83 slot.setValue(registerAt(entry.getIndex()).jsValue()); 79 84 return true; … … 91 96 if (entry.isReadOnly()) 92 97 return true; 93 ASSERT(entry.getIndex() < static_cast<int>( d()->functionExecutable->capturedVariableCount()));98 ASSERT(entry.getIndex() < static_cast<int>(m_functionExecutable->capturedVariableCount())); 94 99 registerAt(entry.getIndex()) = value; 95 100 return true; … … 100 105 SymbolTable::const_iterator end = symbolTable().end(); 101 106 for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) { 102 ASSERT(it->second.getIndex() < static_cast<int>( d()->functionExecutable->capturedVariableCount()));107 ASSERT(it->second.getIndex() < static_cast<int>(m_functionExecutable->capturedVariableCount())); 103 108 if (!(it->second.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties)) 104 109 propertyNames.add(Identifier(exec, it->first.get())); … … 117 122 SymbolTableEntry& entry = iter->second; 118 123 ASSERT(!entry.isNull()); 119 if (entry.getIndex() >= static_cast<int>( d()->functionExecutable->capturedVariableCount()))124 if (entry.getIndex() >= static_cast<int>(m_functionExecutable->capturedVariableCount())) 120 125 return false; 121 126 entry.setAttributes(attributes); … … 196 201 bool JSActivation::isDynamicScope(bool& requiresDynamicChecks) const 197 202 { 198 requiresDynamicChecks = d()->functionExecutable->usesEval();203 requiresDynamicChecks = m_functionExecutable->usesEval(); 199 204 return false; 200 205 } … … 203 208 { 204 209 JSActivation* activation = asActivation(slotBase); 205 CallFrame* callFrame = CallFrame::create(activation-> d()->registers);206 int argumentsRegister = activation-> d()->functionExecutable->generatedBytecode().argumentsRegister();210 CallFrame* callFrame = CallFrame::create(activation->m_registers); 211 int argumentsRegister = activation->m_functionExecutable->generatedBytecode().argumentsRegister(); 207 212 if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue()) 208 213 return arguments;
Note:
See TracChangeset
for help on using the changeset viewer.