Skip to content

Commit 716d2d9

Browse files
author
Mark Lam
committed
Fix JITOperationList::addPointers() to support JIT_OPERATION_VALIDATION_ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=237504 <rdar://problem/89770507> Reviewed by Saam Barati. According to tagJSCCodePtrImpl(), we will only use an operation's validation entry if Options::useJITCage(). Make JITOperationList::addPointers() conform to this. * assembler/JITOperationList.cpp: (JSC::JITOperationList::addPointers): Canonical link: https://commits.webkit.org/248104@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 8833bf3 commit 716d2d9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Source/JavaScriptCore/ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2022-03-05 Mark Lam <mark.lam@apple.com>
2+
3+
Fix JITOperationList::addPointers() to support JIT_OPERATION_VALIDATION_ASSERT_ENABLED.
4+
https://bugs.webkit.org/show_bug.cgi?id=237504
5+
<rdar://problem/89770507>
6+
7+
Reviewed by Saam Barati.
8+
9+
According to tagJSCCodePtrImpl(), we will only use an operation's validation entry
10+
if Options::useJITCage(). Make JITOperationList::addPointers() conform to this.
11+
12+
* assembler/JITOperationList.cpp:
13+
(JSC::JITOperationList::addPointers):
14+
115
2022-03-05 Mark Lam <mark.lam@apple.com>
216

317
Optimize VMTraps::maybeNeedHandling().

Source/JavaScriptCore/assembler/JITOperationList.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ SUPPRESS_ASAN ALWAYS_INLINE void JITOperationList::addPointers(const JITOperatio
6666
return;
6767
}
6868
#endif
69-
if constexpr (ASSERT_ENABLED) {
69+
if constexpr (JIT_OPERATION_VALIDATION_ASSERT_ENABLED) {
7070
for (const auto* current = begin; current != end; ++current) {
7171
void* operation = removeCodePtrTag(current->operation);
7272
if (operation) {
73-
void* validator = removeCodePtrTag(current->operationWithValidation);
73+
void* validator = removeCodePtrTag(Options::useJITCage() ? current->operationWithValidation : current->operation);
7474
validator = WTF::tagNativeCodePtrImpl<OperationPtrTag>(validator);
7575
map.add(operation, validator);
7676
JSC_REGISTER_INVERSE_JIT_CAGED_POINTER_FOR_DEBUG(validator, operation);

0 commit comments

Comments
 (0)