Changeset 274882 in webkit
- Timestamp:
- Mar 23, 2021 11:04:34 AM (16 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/freeze-global-object.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSGlobalObject.cpp (modified) (2 diffs)
-
Source/JavaScriptCore/runtime/JSSymbolTableObject.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/SymbolTable.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r274813 r274882 1 2021-03-23 Robin Morisset <rmorisset@apple.com> 2 3 Object.freeze(this) at the global scope can lose a reference to a WatchpointSet 4 https://bugs.webkit.org/show_bug.cgi?id=223608 5 6 Reviewed by Yusuke Suzuki. 7 8 * stress/freeze-global-object.js: Added. 9 (foo): 10 1 11 2021-03-22 Saam Barati <sbarati@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r274817 r274882 1 2021-03-23 Robin Morisset <rmorisset@apple.com> 2 3 Object.freeze(this) at the global scope can lose a reference to a WatchpointSet 4 https://bugs.webkit.org/show_bug.cgi?id=223608 5 6 Reviewed by Yusuke Suzuki. 7 8 When freezing the global object, we should make a proper copy of symbol table entries, to keep any outstanding reference to the WatchpointSet. 9 We cannot use pack(), because it does not support FatEntries. 10 11 * runtime/JSGlobalObject.cpp: 12 (JSC::JSGlobalObject::defineOwnProperty): 13 * runtime/JSSymbolTableObject.h: 14 (JSC::symbolTableGet): 15 * runtime/SymbolTable.h: 16 (JSC::SymbolTableEntry::setReadOnly): 17 1 18 2021-03-22 Yusuke Suzuki <ysuzuki@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r274406 r274882 1485 1485 JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object); 1486 1486 1487 SymbolTableEntry ::Fastentry;1487 SymbolTableEntry entry; 1488 1488 PropertyDescriptor currentDescriptor; 1489 1489 if (symbolTableGet(thisObject, propertyName, entry, currentDescriptor)) { … … 1503 1503 } 1504 1504 if (descriptor.writablePresent() && !descriptor.writable() && !entry.isReadOnly()) { 1505 thisObject->symbolTable()->set(propertyName.uid(), SymbolTableEntry(entry.varOffset(), entry.getAttributes() | PropertyAttribute::ReadOnly)); 1505 entry.setReadOnly(); 1506 thisObject->symbolTable()->set(propertyName.uid(), entry); 1506 1507 thisObject->varReadOnlyWatchpoint()->fireAll(vm, "GlobalVar was redefined as ReadOnly"); 1507 1508 } -
trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h
r274406 r274882 100 100 template<typename SymbolTableObjectType> 101 101 inline bool symbolTableGet( 102 SymbolTableObjectType* object, PropertyName propertyName, SymbolTableEntry ::Fast& entry, PropertyDescriptor& descriptor)102 SymbolTableObjectType* object, PropertyName propertyName, SymbolTableEntry& entry, PropertyDescriptor& descriptor) 103 103 { 104 104 SymbolTable& symbolTable = *object->symbolTable(); -
trunk/Source/JavaScriptCore/runtime/SymbolTable.h
r274406 r274882 265 265 } 266 266 267 void setReadOnly() 268 { 269 bits() |= ReadOnlyFlag; 270 } 271 267 272 bool isReadOnly() const 268 273 {
Note: See TracChangeset
for help on using the changeset viewer.