Changeset 281544 in webkit
- Timestamp:
- Aug 24, 2021 8:47:18 PM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r281541 r281544 1 2021-08-24 Mark Lam <mark.lam@apple.com> 2 3 Refactor ENABLE(JIT_OPERATION_VALIDATION) code to emit no code when disabled. 4 https://bugs.webkit.org/show_bug.cgi?id=229482 5 rdar://82318317 6 7 Reviewed by Yusuke Suzuki. 8 9 * assembler/JITOperationList.cpp: 10 (JSC::addPointers): 11 (JSC::JITOperationList::populatePointersInJavaScriptCore): 12 (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): 13 (JSC::JITOperationList::populatePointersInEmbedder): 14 * assembler/JITOperationList.h: 15 (JSC::JITOperationList::map const): 16 (JSC::JITOperationList::assertIsJITOperation): 17 (JSC::JITOperationList::initialize): 18 (JSC::JITOperationList::populatePointersInJavaScriptCore): 19 (JSC::JITOperationList::populatePointersInJavaScriptCoreForLLInt): 20 * runtime/JSCPtrTag.h: 21 (JSC::tagJSCCodePtrImpl): 22 (JSC::untagJSCCodePtrImpl): 23 1 24 2021-08-24 Mark Lam <mark.lam@apple.com> 2 25 -
trunk/Source/JavaScriptCore/assembler/JITOperationList.cpp
r270764 r281544 1 1 /* 2 * Copyright (C) 2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 37 37 namespace JSC { 38 38 39 #if ENABLE(JIT_OPERATION_VALIDATION) 40 39 41 LazyNeverDestroyed<JITOperationList> jitOperationList; 40 42 41 #if ENABLE(JIT_OPERATION_VALIDATION)42 43 extern const uintptr_t startOfJITOperationsInJSC __asm("section$start$__DATA_CONST$__jsc_ops"); 43 44 extern const uintptr_t endOfJITOperationsInJSC __asm("section$end$__DATA_CONST$__jsc_ops"); 44 #endif45 45 46 46 void JITOperationList::initialize() … … 49 49 } 50 50 51 #if ENABLE(JIT_OPERATION_VALIDATION)52 51 static SUPPRESS_ASAN ALWAYS_INLINE void addPointers(HashMap<void*, void*>& map, const uintptr_t* beginOperations, const uintptr_t* endOperations) 53 52 { … … 66 65 } 67 66 } 68 #endif69 67 70 68 void JITOperationList::populatePointersInJavaScriptCore() 71 69 { 72 #if ENABLE(JIT_OPERATION_VALIDATION)73 70 static std::once_flag onceKey; 74 71 std::call_once(onceKey, [] { … … 76 73 addPointers(jitOperationList->m_validatedOperations, &startOfJITOperationsInJSC, &endOfJITOperationsInJSC); 77 74 }); 78 #endif79 75 } 80 76 81 77 void JITOperationList::populatePointersInJavaScriptCoreForLLInt() 82 78 { 83 #if ENABLE(JIT_OPERATION_VALIDATION)84 79 static std::once_flag onceKey; 85 80 std::call_once(onceKey, [] { … … 125 120 #undef LLINT_RETURN_LOCATION 126 121 }); 127 #endif128 122 } 129 123 … … 133 127 UNUSED_PARAM(beginOperations); 134 128 UNUSED_PARAM(endOperations); 135 #if ENABLE(JIT_OPERATION_VALIDATION)136 129 if (Options::useJIT()) 137 130 addPointers(jitOperationList->m_validatedOperations, beginOperations, endOperations); 138 #endif139 131 } 140 132 133 #endif // ENABLE(JIT_OPERATION_VALIDATION) 134 141 135 } // namespace JSC -
trunk/Source/JavaScriptCore/assembler/JITOperationList.h
r270764 r281544 1 1 /* 2 * Copyright (C) 2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 namespace JSC { 34 34 35 #if ENABLE(JIT_OPERATION_VALIDATION) 36 35 37 class JITOperationList { 36 38 public: … … 40 42 void* map(void* pointer) const 41 43 { 42 #if ENABLE(JIT_OPERATION_VALIDATION)43 44 return m_validatedOperations.get(removeCodePtrTag(pointer)); 44 #else45 return pointer;46 #endif47 45 } 48 46 … … 55 53 { 56 54 UNUSED_PARAM(function); 57 #if ENABLE(JIT_OPERATION_VALIDATION)58 55 ASSERT(!Options::useJIT() || JITOperationList::instance().map(bitwise_cast<void*>(function))); 59 #endif60 56 } 61 57 … … 71 67 } 72 68 69 #else // not ENABLE(JIT_OPERATION_VALIDATION) 70 71 class JITOperationList { 72 public: 73 static void initialize() { } 74 75 static void populatePointersInJavaScriptCore() { } 76 static void populatePointersInJavaScriptCoreForLLInt() { } 77 78 template<typename T> static void assertIsJITOperation(T) { } 79 }; 80 81 #endif // ENABLE(JIT_OPERATION_VALIDATION) 82 73 83 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSCPtrTag.h
r271594 r281544 128 128 if constexpr (calleeType == PtrTagCalleeType::Native) { 129 129 static_assert(tag == OperationPtrTag); 130 JITOperationList:: instance().assertIsJITOperation(ptr);130 JITOperationList::assertIsJITOperation(ptr); 131 131 #if ENABLE(JIT_CAGE) 132 132 if (Options::useJITCage()) … … 146 146 if constexpr (calleeType == PtrTagCalleeType::Native) { 147 147 static_assert(tag == OperationPtrTag); 148 JITOperationList:: instance().assertIsJITOperation(ptr);148 JITOperationList::assertIsJITOperation(ptr); 149 149 #if ENABLE(JIT_CAGE) 150 150 if (Options::useJITCage()) { -
trunk/Source/WebCore/ChangeLog
r281543 r281544 1 2021-08-24 Mark Lam <mark.lam@apple.com> 2 3 Refactor ENABLE(JIT_OPERATION_VALIDATION) code to emit no code when disabled. 4 https://bugs.webkit.org/show_bug.cgi?id=229482 5 rdar://82318317 6 7 Reviewed by Yusuke Suzuki. 8 9 * bindings/js/WebCoreJITOperations.cpp: 10 (WebCore::populateJITOperations): 11 * bindings/js/WebCoreJITOperations.h: 12 (WebCore::populateJITOperations): 13 * testing/js/WebCoreTestSupport.cpp: 14 (WebCoreTestSupport::populateJITOperations): 15 * testing/js/WebCoreTestSupport.h: 16 (WebCoreTestSupport::populateJITOperations): 17 1 18 2021-08-24 Jean-Yves Avenard <jya@apple.com> 2 19 -
trunk/Source/WebCore/bindings/js/WebCoreJITOperations.cpp
r270764 r281544 1 1 /* 2 * Copyright (C) 2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 extern const uintptr_t startOfJITOperationsInWebCore __asm("section$start$__DATA_CONST$__jsc_ops"); 35 35 extern const uintptr_t endOfJITOperationsInWebCore __asm("section$end$__DATA_CONST$__jsc_ops"); 36 #endif37 36 38 37 void populateJITOperations() 39 38 { 40 #if ENABLE(JIT_OPERATION_VALIDATION)41 39 static std::once_flag onceKey; 42 40 std::call_once(onceKey, [] { 43 41 JSC::JITOperationList::populatePointersInEmbedder(&startOfJITOperationsInWebCore, &endOfJITOperationsInWebCore); 44 42 }); 45 #endif46 43 } 44 #endif // ENABLE(JIT_OPERATION_VALIDATION) 47 45 48 46 } -
trunk/Source/WebCore/bindings/js/WebCoreJITOperations.h
r267938 r281544 1 1 /* 2 * Copyright (C) 2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 namespace WebCore { 29 29 30 #if ENABLE(JIT_OPERATION_VALIDATION) 30 31 WEBCORE_EXPORT void populateJITOperations(); 32 #else 33 inline void populateJITOperations() { } 34 #endif 31 35 32 36 } -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp
r280758 r281544 1 1 /* 2 2 * Copyright (C) 2011, 2015 Google Inc. All rights reserved. 3 * Copyright (C) 2016-202 0Apple Inc. All rights reserved.3 * Copyright (C) 2016-2021 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 246 246 extern const uintptr_t startOfJITOperationsInWebCoreTestSupport __asm("section$start$__DATA_CONST$__jsc_ops"); 247 247 extern const uintptr_t endOfJITOperationsInWebCoreTestSupport __asm("section$end$__DATA_CONST$__jsc_ops"); 248 #endif249 248 250 249 void populateJITOperations() 251 250 { 252 #if ENABLE(JIT_OPERATION_VALIDATION)253 251 static std::once_flag onceKey; 254 252 std::call_once(onceKey, [] { 255 253 JSC::JITOperationList::populatePointersInEmbedder(&startOfJITOperationsInWebCoreTestSupport, &endOfJITOperationsInWebCoreTestSupport); 256 254 }); 257 #endif 258 } 259 260 } 255 } 256 #endif // ENABLE(JIT_OPERATION_VALIDATION) 257 258 } -
trunk/Source/WebCore/testing/js/WebCoreTestSupport.h
r268316 r281544 1 1 /* 2 2 * Copyright (C) 2011, 2015 Google Inc. All rights reserved. 3 * Copyright (C) 2016-20 18Apple Inc. All rights reserved.3 * Copyright (C) 2016-2021 Apple Inc. All rights reserved. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 68 68 void setAdditionalSupportedImageTypesForTesting(const WTF::String&) TEST_SUPPORT_EXPORT; 69 69 70 #if ENABLE(JIT_OPERATION_VALIDATION) 70 71 void populateJITOperations() TEST_SUPPORT_EXPORT; 72 #else 73 inline void populateJITOperations() { } 74 #endif 71 75 72 76 } // namespace WebCoreTestSupport
Note: See TracChangeset
for help on using the changeset viewer.