Changeset 80179 in webkit
- Timestamp:
- Mar 2, 2011 4:00:17 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r80166 r80179 1 2011-03-02 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Remove "register slot" concept from PropertySlot 6 https://bugs.webkit.org/show_bug.cgi?id=55621 7 8 PropertySlot had already stopped storing Register "slots" 9 so this patch is simply removing that api entirely. 10 This exposed a problem in the ProgramNode constructor for 11 BytecodeGenerator where it reads from the registerfile 12 before it has initialised it. 13 14 This bug wasn't a problem before as we were merely testing 15 for property existence rather than the actual value, and 16 used to work because setRegisterSlot didn't check that the 17 provided slot contained an initialised value. 18 19 To get around this issue we now use symbolTableHasProperty 20 to do the symbol table check without trying to read the 21 RegisterFile. 22 23 * JavaScriptCore.xcodeproj/project.pbxproj: 24 * bytecompiler/BytecodeGenerator.cpp: 25 (JSC::BytecodeGenerator::BytecodeGenerator): 26 * runtime/Arguments.cpp: 27 (JSC::Arguments::getOwnPropertySlot): 28 * runtime/JSActivation.cpp: 29 (JSC::JSActivation::symbolTableGet): 30 * runtime/JSGlobalObject.h: 31 (JSC::JSGlobalObject::symbolTableHasProperty): 32 * runtime/JSVariableObject.h: 33 (JSC::JSVariableObject::symbolTableGet): 34 * runtime/PropertySlot.h: 35 1 36 2011-03-02 Daniel Cheng <dcheng@chromium.org> 2 37 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r80052 r80179 2540 2540 buildConfigurationList = 149C277108902AFE008A9EFC /* Build configuration list for PBXProject "JavaScriptCore" */; 2541 2541 compatibilityVersion = "Xcode 3.1"; 2542 developmentRegion = English; 2542 2543 hasScannedForEncodings = 1; 2543 2544 knownRegions = ( -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r79904 r80179 271 271 Vector<RegisterID*, 32> newVars; 272 272 for (size_t i = 0; i < varStack.size(); ++i) { 273 if (!globalObject->hasProperty(exec, *varStack[i].first)) 274 newVars.append(addGlobalVar(*varStack[i].first, varStack[i].second & DeclarationStacks::IsConstant)); 273 if (globalObject->symbolTableHasProperty(*varStack[i].first) || globalObject->hasProperty(exec, *varStack[i].first)) 274 continue; 275 newVars.append(addGlobalVar(*varStack[i].first, varStack[i].second & DeclarationStacks::IsConstant)); 275 276 } 276 277 … … 287 288 } 288 289 for (size_t i = 0; i < varStack.size(); ++i) { 289 if (globalObject-> hasProperty(exec, *varStack[i].first))290 if (globalObject->symbolTableHasProperty(*varStack[i].first) || globalObject->hasProperty(exec, *varStack[i].first)) 290 291 continue; 291 292 int attributes = DontDelete; -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r79132 r80179 146 146 if (i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) { 147 147 if (i < d->numParameters) { 148 slot.set RegisterSlot(&d->registers[d->firstParameterIndex + i]);148 slot.setValue(d->registers[d->firstParameterIndex + i].jsValue()); 149 149 } else 150 150 slot.setValue(d->extraArguments[i - d->numParameters].jsValue()); … … 185 185 if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) { 186 186 if (i < d->numParameters) { 187 slot.set RegisterSlot(&d->registers[d->firstParameterIndex + i]);187 slot.setValue(d->registers[d->firstParameterIndex + i].jsValue()); 188 188 } else 189 189 slot.setValue(d->extraArguments[i - d->numParameters].jsValue()); -
trunk/Source/JavaScriptCore/runtime/JSActivation.cpp
r79240 r80179 76 76 if (!entry.isNull()) { 77 77 ASSERT(entry.getIndex() < static_cast<int>(d()->functionExecutable->capturedVariableCount())); 78 slot.set RegisterSlot(®isterAt(entry.getIndex()));78 slot.setValue(registerAt(entry.getIndex()).jsValue()); 79 79 return true; 80 80 } -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r79904 r80179 178 178 virtual void defineSetter(ExecState*, const Identifier& propertyName, JSObject* setterFunc, unsigned attributes); 179 179 180 // We use this in the code generator as we perform symbol table 181 // lookups prior to initializing the properties 182 bool symbolTableHasProperty(const Identifier& propertyName); 183 180 184 // The following accessors return pristine values, even if a script 181 185 // replaces the global object's associated property. … … 352 356 } 353 357 358 inline bool JSGlobalObject::symbolTableHasProperty(const Identifier& propertyName) 359 { 360 SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl()); 361 return !entry.isNull(); 362 } 363 354 364 inline JSValue Structure::prototypeForLookup(ExecState* exec) const 355 365 { -
trunk/Source/JavaScriptCore/runtime/JSVariableObject.h
r79132 r80179 106 106 SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl()); 107 107 if (!entry.isNull()) { 108 slot.set RegisterSlot(®isterAt(entry.getIndex()));108 slot.setValue(registerAt(entry.getIndex()).jsValue()); 109 109 return true; 110 110 } … … 116 116 SymbolTableEntry entry = symbolTable().inlineGet(propertyName.impl()); 117 117 if (!entry.isNull()) { 118 slot.set RegisterSlot(®isterAt(entry.getIndex()));118 slot.setValue(registerAt(entry.getIndex()).jsValue()); 119 119 slotIsWriteable = !entry.isReadOnly(); 120 120 return true; -
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r77269 r80179 124 124 } 125 125 126 void setRegisterSlot(Register* registerSlot)127 {128 ASSERT(registerSlot);129 clearBase();130 clearOffset();131 m_getValue = JSC_VALUE_MARKER;132 m_value = registerSlot->jsValue();133 }134 135 126 void setCustom(JSValue slotBase, GetValueFunc getValue) 136 127 {
Note: See TracChangeset
for help on using the changeset viewer.