Changeset 250289 in webkit
- Timestamp:
- Sep 24, 2019 12:43:24 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r250285 r250289 768 768 runtime/CallData.h 769 769 runtime/CatchScope.h 770 runtime/CellSize.h 770 771 runtime/ClassInfo.h 771 772 runtime/CodeSpecializationKind.h -
trunk/Source/JavaScriptCore/ChangeLog
r250285 r250289 1 2019-09-24 Mark Lam <mark.lam@apple.com> 2 3 Refactor cellSize() out of VMInspector::verifyCellSize(). 4 https://bugs.webkit.org/show_bug.cgi?id=202132 5 6 Reviewed by Saam Barati. 7 8 * CMakeLists.txt: 9 * JavaScriptCore.xcodeproj/project.pbxproj: 10 * runtime/CellSize.h: Added. 11 (JSC::isDynamicallySizedType): 12 (JSC::cellSize): 13 * runtime/DirectArguments.h: 14 * runtime/JSBigInt.h: 15 * runtime/JSModuleNamespaceObject.h: 16 * runtime/JSType.h: 17 (JSC::isDynamicallySizedType): Deleted. 18 * tools/VMInspectorInlines.h: 19 (JSC::VMInspector::verifyCellSize): 20 1 21 2019-09-23 Mark Lam <mark.lam@apple.com> 2 22 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r250285 r250289 1912 1912 FEB51F6C1A97B688001F921C /* Regress141809.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEB51F6B1A97B688001F921C /* Regress141809.mm */; }; 1913 1913 FEB58C15187B8B160098EF0B /* ErrorHandlingScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FEB58C13187B8B160098EF0B /* ErrorHandlingScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1914 FEC160322339E9F900A04CB8 /* CellSize.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC160312339E9F900A04CB8 /* CellSize.h */; }; 1914 1915 FEC5797323105B5100BCA83F /* VMInspectorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC5797223105B4800BCA83F /* VMInspectorInlines.h */; }; 1915 1916 FEC5797623105F4E00BCA83F /* Integrity.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC5797523105F4300BCA83F /* Integrity.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5139 5140 FEB58C12187B8B160098EF0B /* ErrorHandlingScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorHandlingScope.cpp; sourceTree = "<group>"; }; 5140 5141 FEB58C13187B8B160098EF0B /* ErrorHandlingScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorHandlingScope.h; sourceTree = "<group>"; }; 5142 FEC160312339E9F900A04CB8 /* CellSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellSize.h; sourceTree = "<group>"; }; 5141 5143 FEC5797223105B4800BCA83F /* VMInspectorInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspectorInlines.h; sourceTree = "<group>"; }; 5142 5144 FEC5797423105F4200BCA83F /* Integrity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Integrity.cpp; sourceTree = "<group>"; }; … … 6950 6952 FE80C1981D775FB4008510C0 /* CatchScope.cpp */, 6951 6953 FE80C1961D775B27008510C0 /* CatchScope.h */, 6954 FEC160312339E9F900A04CB8 /* CellSize.h */, 6952 6955 E326C4961ECBEF5700A9A905 /* ClassInfo.cpp */, 6953 6956 BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */, … … 9030 9033 0F1C3DDA1BBCE09E00E523E4 /* CellState.h in Headers */, 9031 9034 BC6AAAE50E1F426500AD87D8 /* ClassInfo.h in Headers */, 9035 FEC160322339E9F900A04CB8 /* CellSize.h in Headers */, 9032 9036 0FE050261AA9095600D33B33 /* ClonedArguments.h in Headers */, 9033 9037 BC18C45E0E16F5CD00B34460 /* CLoopStack.h in Headers */, -
trunk/Source/JavaScriptCore/runtime/DirectArguments.h
r250285 r250289 186 186 MappedArguments m_mappedArguments; // If non-null, it means that length, callee, and caller are fully materialized properties. 187 187 188 friend class VMInspector;188 friend size_t cellSize(VM&, JSCell*); 189 189 }; 190 190 -
trunk/Source/JavaScriptCore/runtime/JSBigInt.h
r250285 r250289 251 251 bool m_sign { false }; 252 252 253 friend class VMInspector;253 friend size_t cellSize(VM&, JSCell*); 254 254 }; 255 255 -
trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h
r250285 r250289 105 105 WriteBarrier<AbstractModuleRecord> m_moduleRecord; 106 106 107 friend class VMInspector;107 friend size_t cellSize(VM&, JSCell*); 108 108 }; 109 109 -
trunk/Source/JavaScriptCore/runtime/JSType.h
r250285 r250289 141 141 } 142 142 143 inline constexpr bool isDynamicallySizedType(JSType type)144 {145 if (type == BigIntType146 || type == DirectArgumentsType147 || type == FinalObjectType148 || type == LexicalEnvironmentType149 || type == ModuleEnvironmentType150 || type == ModuleNamespaceObjectType)151 return true;152 return false;153 }154 155 143 } // namespace JSC 156 144 -
trunk/Source/JavaScriptCore/tools/VMInspectorInlines.h
r250285 r250289 26 26 #pragma once 27 27 28 #include "DirectArguments.h" 29 #include "JSBigInt.h" 30 #include "JSLexicalEnvironment.h" 31 #include "JSModuleEnvironment.h" 32 #include "JSModuleNamespaceObject.h" 28 #include "CellSize.h" 33 29 #include "VMInspector.h" 34 30 #include <wtf/Assertions.h> … … 52 48 AUDIT_VERIFY(action, verifier, cellType == structure->m_blob.type(), cell, cellType, structure->m_blob.type()); 53 49 54 if (isDynamicallySizedType(cellType)) { 55 size_t cellSize = 0; 56 switch (cellType) { 57 case BigIntType: { 58 auto* bigInt = jsCast<JSBigInt*>(cell); 59 cellSize = JSBigInt::allocationSize(bigInt->length()); 60 break; 61 } 62 case DirectArgumentsType: { 63 auto* args = jsCast<DirectArguments*>(cell); 64 cellSize = DirectArguments::allocationSize(args->m_minCapacity); 65 break; 66 } 67 case FinalObjectType: 68 cellSize = JSFinalObject::allocationSize(structure->inlineCapacity()); 69 break; 70 case LexicalEnvironmentType: { 71 auto* env = jsCast<JSLexicalEnvironment*>(cell); 72 cellSize = JSLexicalEnvironment::allocationSize(env->symbolTable()); 73 break; 74 } 75 case ModuleEnvironmentType: { 76 auto* env = jsCast<JSModuleEnvironment*>(cell); 77 cellSize = JSModuleEnvironment::allocationSize(env->symbolTable()); 78 break; 79 } 80 case ModuleNamespaceObjectType: { 81 auto* obj = jsCast<JSModuleNamespaceObject*>(cell); 82 cellSize = JSModuleNamespaceObject::allocationSize(obj->m_names.capacity()); 83 break; 84 } 85 default: 86 RELEASE_ASSERT_NOT_REACHED(); 87 } 88 AUDIT_VERIFY(action, verifier, cellSize <= allocatorCellSize, cell, cellType, cellSize, allocatorCellSize); 89 AUDIT_VERIFY(action, verifier, cellSize >= classInfo->staticClassSize, cell, cellType, cellSize, classInfo->staticClassSize); 90 } else 91 AUDIT_VERIFY(action, verifier, classInfo->staticClassSize <= allocatorCellSize, cell, cellType, classInfo->staticClassSize, allocatorCellSize); 50 size_t size = cellSize(vm, cell); 51 AUDIT_VERIFY(action, verifier, size <= allocatorCellSize, cell, cellType, size, allocatorCellSize, classInfo->staticClassSize); 52 if (isDynamicallySizedType(cellType)) 53 AUDIT_VERIFY(action, verifier, size >= classInfo->staticClassSize, cell, cellType, size, classInfo->staticClassSize); 92 54 93 55 return true;
Note: See TracChangeset
for help on using the changeset viewer.