Changeset 261877 in webkit
- Timestamp:
- May 19, 2020 11:49:07 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r261857 r261877 1 2020-05-19 Mark Lam <mark.lam@apple.com> 2 3 Put PtrTagLookup data structures in Configs for freezing. 4 https://bugs.webkit.org/show_bug.cgi?id=212089 5 <rdar://problem/63401487> 6 7 Reviewed by Robin Morisset. 8 9 PtrTagLookup data structures were always meant to only be initialized once at 10 initialization time and never modified thereafter. This patch puts them in the 11 Configs for freezing to document and enforce this invariant. 12 13 * runtime/JSCConfig.h: 14 * runtime/JSCPtrTag.cpp: 15 (JSC::initializePtrTagLookup): 16 1 17 2020-05-19 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/JSCConfig.h
r258857 r261877 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #include "OptionsList.h" 29 29 #include <wtf/PageBlock.h> 30 #include <wtf/PtrTag.h> 30 31 #include <wtf/StdLibExtras.h> 31 32 … … 81 82 82 83 void (*shellTimeoutCheckCallback)(VM&); 84 85 WTF::PtrTagLookup ptrTagLookupRecord; 83 86 }; 84 87 char ensureSize[ConfigSizeToProtect]; -
trunk/Source/JavaScriptCore/runtime/JSCPtrTag.cpp
r251372 r261877 1 1 /* 2 * Copyright (C) 2018-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2018-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #include "config.h" 27 27 #include "JSCPtrTag.h" 28 29 #include "JSCConfig.h" 28 30 29 31 namespace JSC { … … 53 55 void initializePtrTagLookup() 54 56 { 55 static WTF::PtrTagLookup lookup = { tagForPtr, ptrTagName }; 57 WTF::PtrTagLookup& lookup = g_jscConfig.ptrTagLookupRecord; 58 lookup.initialize(tagForPtr, ptrTagName); 56 59 WTF::registerPtrTagLookup(&lookup); 57 60 } -
trunk/Source/WTF/ChangeLog
r261870 r261877 1 2020-05-19 Mark Lam <mark.lam@apple.com> 2 3 Put PtrTagLookup data structures in Configs for freezing. 4 https://bugs.webkit.org/show_bug.cgi?id=212089 5 <rdar://problem/63401487> 6 7 Reviewed by Robin Morisset. 8 9 * wtf/PtrTag.cpp: 10 (WTF::tagForPtr): 11 (WTF::ptrTagName): 12 (WTF::registerPtrTagLookup): 13 * wtf/PtrTag.h: 14 (WTF::PtrTagLookup::initialize): 15 * wtf/WTFConfig.h: 16 1 17 2020-05-19 Mark Lam <mark.lam@apple.com> 2 18 -
trunk/Source/WTF/wtf/PtrTag.cpp
r251372 r261877 1 1 /* 2 * Copyright (C) 2018-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2018-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #include <wtf/PtrTag.h> 28 28 29 #include <wtf/WTFConfig.h> 30 29 31 namespace WTF { 30 32 31 33 #if CPU(ARM64E) 32 34 33 static PtrTagLookup* s_ptrTagLookup = nullptr;34 35 35 static const char* tagForPtr(const void* ptr) 36 36 { 37 PtrTagLookup* lookup = s_ptrTagLookup;37 PtrTagLookup* lookup = g_wtfConfig.ptrTagLookupHead; 38 38 while (lookup) { 39 39 const char* tagName = lookup->tagForPtr(ptr); … … 57 57 static const char* ptrTagName(PtrTag tag) 58 58 { 59 PtrTagLookup* lookup = s_ptrTagLookup;59 PtrTagLookup* lookup = g_wtfConfig.ptrTagLookupHead; 60 60 while (lookup) { 61 61 const char* tagName = lookup->ptrTagName(tag); … … 75 75 void registerPtrTagLookup(PtrTagLookup* lookup) 76 76 { 77 lookup->next = s_ptrTagLookup;78 s_ptrTagLookup= lookup;77 lookup->next = g_wtfConfig.ptrTagLookupHead; 78 g_wtfConfig.ptrTagLookupHead = lookup; 79 79 } 80 80 -
trunk/Source/WTF/wtf/PtrTag.h
r261870 r261877 86 86 87 87 struct PtrTagLookup { 88 const char* (*tagForPtr)(const void*); 89 const char* (*ptrTagName)(PtrTag); 90 PtrTagLookup* next { nullptr }; 88 using TagForPtrFunc = const char* (*)(const void*); 89 using PtrTagNameFunc = const char* (*)(PtrTag); 90 91 void initialize(TagForPtrFunc tagForPtr, PtrTagNameFunc ptrTagName) 92 { 93 this->tagForPtr = tagForPtr; 94 this->ptrTagName = ptrTagName; 95 } 96 97 TagForPtrFunc tagForPtr; 98 PtrTagNameFunc ptrTagName; 99 PtrTagLookup* next; 91 100 }; 92 101 -
trunk/Source/WTF/wtf/WTFConfig.h
r261538 r261877 30 30 #include <wtf/ExportMacros.h> 31 31 #include <wtf/PageBlock.h> 32 #include <wtf/PtrTag.h> 32 33 #include <wtf/StdLibExtras.h> 33 34 #include <wtf/threads/Signals.h> … … 56 57 SignalHandlers signalHandlers; 57 58 #endif 59 PtrTagLookup* ptrTagLookupHead; 58 60 }; 59 61 char ensureSize[ConfigSizeToProtect];
Note: See TracChangeset
for help on using the changeset viewer.