[webkit-changes] [294789] trunk/Source/WebCore/svg

2022-05-24 Thread simon . fraser
Title: [294789] trunk/Source/WebCore/svg








Revision 294789
Author simon.fra...@apple.com
Date 2022-05-24 22:57:54 -0700 (Tue, 24 May 2022)


Log Message
Simplify SVGPropertyOwnerRegistry slightly
https://bugs.webkit.org/show_bug.cgi?id=240839

Reviewed by Yusuke Suzuki.

SVGPropertyOwnerRegistry::findAccessor() had to loop through the hash table entries
because it wanted the behavior of QualifiedName::matches(), which is different from
QualifiedName::operator==. However, we can achieve this by using hash traits, and
the appropriate traits already exist in the form of SVGAttributeHashTranslator.

* Source/WebCore/svg/SVGElementInlines.h:
(WebCore::SVGAttributeHashTranslator::hash): Deleted.
(WebCore::SVGAttributeHashTranslator::equal): Deleted.
* Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGAttributeHashTranslator::hash):
(WebCore::SVGAttributeHashTranslator::equal):
(WebCore::SVGPropertyOwnerRegistry::attributeNameToAccessorMap):
(WebCore::SVGPropertyOwnerRegistry::findAccessor):

Canonical link: https://commits.webkit.org/250948@main

Modified Paths

trunk/Source/WebCore/svg/SVGElementInlines.h
trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h




Diff

Modified: trunk/Source/WebCore/svg/SVGElementInlines.h (294788 => 294789)

--- trunk/Source/WebCore/svg/SVGElementInlines.h	2022-05-25 04:43:31 UTC (rev 294788)
+++ trunk/Source/WebCore/svg/SVGElementInlines.h	2022-05-25 05:57:54 UTC (rev 294789)
@@ -41,18 +41,6 @@
 invalidateStyle();
 }
 
-struct SVGAttributeHashTranslator {
-static unsigned hash(const QualifiedName& key)
-{
-if (key.hasPrefix()) {
-QualifiedNameComponents components = { nullAtom().impl(), key.localName().impl(), key.namespaceURI().impl() };
-return computeHash(components);
-}
-return DefaultHash::hash(key);
-}
-static bool equal(const QualifiedName& a, const QualifiedName& b) { return a.matches(b); }
-};
-
 inline bool Element::hasTagName(const SVGQualifiedName& tagName) const
 {
 return ContainerNode::hasTagName(tagName);


Modified: trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h (294788 => 294789)

--- trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h	2022-05-25 04:43:31 UTC (rev 294788)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h	2022-05-25 05:57:54 UTC (rev 294789)
@@ -35,6 +35,21 @@
 
 class SVGAttributeAnimator;
 
+struct SVGAttributeHashTranslator {
+static unsigned hash(const QualifiedName& key)
+{
+if (key.hasPrefix()) {
+QualifiedNameComponents components = { nullAtom().impl(), key.localName().impl(), key.namespaceURI().impl() };
+return computeHash(components);
+}
+return DefaultHash::hash(key);
+}
+static bool equal(const QualifiedName& a, const QualifiedName& b) { return a.matches(b); }
+
+static constexpr bool safeToCompareToEmptyOrDeleted = false;
+static constexpr bool hasHashInValue = true;
+};
+
 template
 class SVGPropertyOwnerRegistry : public SVGPropertyRegistry {
 public:
@@ -300,9 +315,11 @@
 
 private:
 // Singleton map for every OwnerType.
-static HashMap*>& attributeNameToAccessorMap()
+using QualifiedNameAccessorHashMap = HashMap*, SVGAttributeHashTranslator>;
+
+static QualifiedNameAccessorHashMap& attributeNameToAccessorMap()
 {
-static NeverDestroyed*>> attributeNameToAccessorMap;
+static NeverDestroyed attributeNameToAccessorMap;
 return attributeNameToAccessorMap;
 }
 
@@ -331,12 +348,7 @@
 
 static const SVGMemberAccessor* findAccessor(const QualifiedName& attributeName)
 {
-// Here we need to loop through the entries in the map and use matches() to compare them with attributeName.
-// m_map.contains() uses QualifiedName::operator==() which compares the impl pointers only while matches()
-// compares the contents if the impl pointers differ.
-auto it = std::find_if(attributeNameToAccessorMap().begin(), attributeNameToAccessorMap().end(), [](const auto& entry) -> bool {
-return entry.key.matches(attributeName);
-});
+auto it = attributeNameToAccessorMap().find(attributeName);
 return it != attributeNameToAccessorMap().end() ? it->value : nullptr;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294788] trunk/Source

2022-05-24 Thread mark . lam
Title: [294788] trunk/Source








Revision 294788
Author mark@apple.com
Date 2022-05-24 21:43:31 -0700 (Tue, 24 May 2022)


Log Message
Use dladdr to get labels instead of stashing them in the JITOperationAnnotation.
https://bugs.webkit.org/show_bug.cgi?id=240895

Reviewed by Saam Barati.

We no longer need to stash these label strings in the JITOperationAnnotations.

This change also fixes an ASAN crasher.  As such, we can re-enable
ENABLE(JIT_OPERATION_DISASSEMBLY) even when ASAN_ENABLED.

* Source/_javascript_Core/assembler/JITOperationList.cpp:
(JSC::JITOperationList::addDisassemblyLabels):
* Source/_javascript_Core/assembler/JITOperationValidation.h:
* Source/WTF/wtf/PlatformCallingConventions.h:
* Source/WTF/wtf/PlatformEnable.h:

Canonical link: https://commits.webkit.org/250947@main

Modified Paths

trunk/Source/_javascript_Core/assembler/JITOperationList.cpp
trunk/Source/_javascript_Core/assembler/JITOperationValidation.h
trunk/Source/WTF/wtf/PlatformCallingConventions.h
trunk/Source/WTF/wtf/PlatformEnable.h




Diff

Modified: trunk/Source/_javascript_Core/assembler/JITOperationList.cpp (294787 => 294788)

--- trunk/Source/_javascript_Core/assembler/JITOperationList.cpp	2022-05-25 04:03:14 UTC (rev 294787)
+++ trunk/Source/_javascript_Core/assembler/JITOperationList.cpp	2022-05-25 04:43:31 UTC (rev 294788)
@@ -33,6 +33,11 @@
 #include "Opcode.h"
 #include "Options.h"
 
+#if HAVE(DLADDR)
+#include 
+#include 
+#endif
+
 namespace JSC {
 
 #if ENABLE(JIT_OPERATION_VALIDATION) || ENABLE(JIT_OPERATION_DISASSEMBLY)
@@ -114,28 +119,26 @@
 LLINT_DECLARE_ROUTINE_VALIDATE(normal_osr_exit_trampoline);
 LLINT_DECLARE_ROUTINE_VALIDATE(fuzzer_return_early_from_loop_hint);
 
-#if ENABLE(JIT_OPERATION_VALIDATION) && ENABLE(JIT_OPERATION_DISASSEMBLY)
-#define LLINT_OP_EXTRAS(validateLabel, nameStr) bitwise_cast(validateLabel), nameStr
-#elif ENABLE(JIT_OPERATION_VALIDATION)
-#define LLINT_OP_EXTRAS(validateLabel, nameStr) bitwise_cast(validateLabel)
+#if ENABLE(JIT_OPERATION_VALIDATION)
+#define LLINT_OP_EXTRAS(validateLabel) bitwise_cast(validateLabel)
 #else // ENABLE(JIT_OPERATION_DISASSEMBLY)
-#define LLINT_OP_EXTRAS(validateLabel, nameStr) nameStr
+#define LLINT_OP_EXTRAS(validateLabel)
 #endif
 
 #define LLINT_ROUTINE(functionName) { \
 bitwise_cast(LLInt::getCodeFunctionPtr(functionName)), \
-LLINT_OP_EXTRAS(LLINT_ROUTINE_VALIDATE(functionName), #functionName) \
+LLINT_OP_EXTRAS(LLINT_ROUTINE_VALIDATE(functionName)) \
 },
 
 #define LLINT_OP(name) { \
 bitwise_cast(LLInt::getCodeFunctionPtr(name)), \
-LLINT_OP_EXTRAS(LLINT_RETURN_VALIDATE(name), #name) \
+LLINT_OP_EXTRAS(LLINT_RETURN_VALIDATE(name)) \
 }, { \
 bitwise_cast(LLInt::getWide16CodeFunctionPtr(name)), \
-LLINT_OP_EXTRAS(LLINT_RETURN_WIDE16_VALIDATE(name), #name " [wide16]") \
+LLINT_OP_EXTRAS(LLINT_RETURN_WIDE16_VALIDATE(name)) \
 }, { \
 bitwise_cast(LLInt::getWide32CodeFunctionPtr(name)), \
-LLINT_OP_EXTRAS(LLINT_RETURN_WIDE32_VALIDATE(name), #name " [wide32]") \
+LLINT_OP_EXTRAS(LLINT_RETURN_WIDE32_VALIDATE(name)) \
 },
 
 #define LLINT_RETURN_LOCATION(name, ...) \
@@ -231,7 +234,9 @@
 #else
 auto* operation = current->operation;
 #endif
-registerLabel(removeCodePtrTag(operation), current->name);
+Dl_info info;
+if (dladdr(operation, ) && info.dli_sname)
+registerLabel(removeCodePtrTag(operation), info.dli_sname);
 }
 }
 


Modified: trunk/Source/_javascript_Core/assembler/JITOperationValidation.h (294787 => 294788)

--- trunk/Source/_javascript_Core/assembler/JITOperationValidation.h	2022-05-25 04:03:14 UTC (rev 294787)
+++ trunk/Source/_javascript_Core/assembler/JITOperationValidation.h	2022-05-25 04:43:31 UTC (rev 294788)
@@ -52,9 +52,6 @@
 #if ENABLE(JIT_OPERATION_VALIDATION)
 void* operationWithValidation;
 #endif
-#if ENABLE(JIT_OPERATION_DISASSEMBLY)
-const char* name;
-#endif
 };
 
 #if ENABLE(JIT_OPERATION_VALIDATION)


Modified: trunk/Source/WTF/wtf/PlatformCallingConventions.h (294787 => 294788)

--- trunk/Source/WTF/wtf/PlatformCallingConventions.h	2022-05-25 04:03:14 UTC (rev 294787)
+++ trunk/Source/WTF/wtf/PlatformCallingConventions.h	2022-05-25 04:43:31 UTC (rev 294788)
@@ -86,16 +86,14 @@
 
 #if ENABLE(JIT_OPERATION_VALIDATION) || ENABLE(JIT_OPERATION_DISASSEMBLY)
 
-#if ENABLE(JIT_OPERATION_VALIDATION) && ENABLE(JIT_OPERATION_DISASSEMBLY)
-#define JSC_ANNOTATE_JIT_OPERATION_EXTRAS(validateFunction, name) (void*)validateFunction, name
-#elif ENABLE(JIT_OPERATION_VALIDATION)
-#define JSC_ANNOTATE_JIT_OPERATION_EXTRAS(validateFunction, name) (void*)validateFunction
-#else // ENABLE(JIT_OPERATION_DISASSEMBLY)
-#define JSC_ANNOTATE_JIT_OPERATION_EXTRAS(validateFunction, name) name
+#if ENABLE(JIT_OPERATION_VALIDATION)
+#define JSC_ANNOTATE_JIT_OPERATION_EXTRAS(validateFunction) (void*)validateFunction
+#else
+#define 

[webkit-changes] [294787] trunk/Source/JavaScriptCore/offlineasm

2022-05-24 Thread mark . lam
Title: [294787] trunk/Source/_javascript_Core/offlineasm








Revision 294787
Author mark@apple.com
Date 2022-05-24 21:03:14 -0700 (Tue, 24 May 2022)


Log Message
Use `jsc_llint` as a LLInt local label prefix instead of `_offlineasm`.
https://bugs.webkit.org/show_bug.cgi?id=240885

Reviewed by Geoffrey Garen.

Code generated by the offlineasm is tightly coupled with JSC anyway.  Might as well
make the local labels more informative about where the code came from in crash traces.

So, instead of this:

_javascript_Core`vmEntryToJavaScript:
0x1028b5d90 <+0 >:   pacibsp
0x1028b5d94 <+4 >:   stpx29, x30, [sp, #-0x10]!
0x1028b5d98 <+8 >:   movx29, sp
0x1028b5d9c <+12 >:  subsp, x29, #0xb0
0x1028b5da0 <+16 >:  movx13, #0xc800
0x1028b5da4 <+20 >:  addx17, x1, x13
0x1028b5da8 <+24 >:  ldrw4, [x17]
0x1028b5dac <+28 >:  cbnz   w4, 0x1028b5f34   ; _offlineasm_doVMEntry__checkVMEntryPermission
0x1028b5db0 <+32 >:  strx1, [sp]
0x1028b5db4 <+36 >:  movx17, #0x9e78
...
0x1028b5de8 <+88 >:  subx3, sp, x4
0x1028b5dec <+92 >:  cmpsp, x3
0x1028b5df0 <+96 >:  b.ls   0x1028b5ef4   ; _offlineasm_doVMEntry__throwStackOverflow
0x1028b5df4 <+100 >: movx17, #0xca00
0x1028b5df8 <+104 >: addx13, x1, x17
0x1028b5dfc <+108 >: ldrx17, [x13]
0x1028b5e00 <+112 >: cmpx3, x17
0x1028b5e04 <+116 >: b.lo   0x1028b5ef4   ; _offlineasm_doVMEntry__throwStackOverflow

_javascript_Core`_offlineasm_doVMEntry__stackHeightOK:
0x1028b5e08 <+0 >:   movsp, x3
0x1028b5e0c <+4 >:   movx3, #0x4

_javascript_Core`_offlineasm_doVMEntry__copyHeaderLoop:
0x1028b5e10 <+0 >:   subw3, w3, #0x1
0x1028b5e14 <+4 >:   addx17, x2, x3, lsl #3
0x1028b5e18 <+8 >:   ldrx5, [x17]

We now get this:

_javascript_Core`vmEntryToJavaScript:
0x1028cdd90 <+0>:   pacibsp
0x1028cdd94 <+4>:   stpx29, x30, [sp, #-0x10]!
0x1028cdd98 <+8>:   movx29, sp
0x1028cdd9c <+12>:  subsp, x29, #0xb0
0x1028cdda0 <+16>:  movx13, #0xc800
0x1028cdda4 <+20>:  addx17, x1, x13
0x1028cdda8 <+24>:  ldrw4, [x17]
0x1028cddac <+28>:  cbnz   w4, 0x1028cdf34   ; jsc_llint_doVMEntry__checkVMEntryPermission
0x1028cddb0 <+32>:  strx1, [sp]
0x1028cddb4 <+36>:  movx17, #0x9e78
...
0x1028cdde8 <+88>:  subx3, sp, x4
0x1028cddec <+92>:  cmpsp, x3
0x1028cddf0 <+96>:  b.ls   0x1028cdef4   ; jsc_llint_doVMEntry__throwStackOverflow
0x1028cddf4 <+100>: movx17, #0xca00
0x1028cddf8 <+104>: addx13, x1, x17
0x1028cddfc <+108>: ldrx17, [x13]
0x1028cde00 <+112>: cmpx3, x17
0x1028cde04 <+116>: b.lo   0x1028cdef4   ; jsc_llint_doVMEntry__throwStackOverflow

_javascript_Core`jsc_llint_doVMEntry__stackHeightOK:
0x1028cde08 <+0>:   movsp, x3
0x1028cde0c <+4>:   movx3, #0x4

_javascript_Core`jsc_llint_doVMEntry__copyHeaderLoop:
0x1028cde10 <+0>:   subw3, w3, #0x1
0x1028cde14 <+4>:   addx17, x2, x3, lsl #3
0x1028cde18 <+8>:   ldrx5, [x17]

* Source/_javascript_Core/offlineasm/arm.rb:
* Source/_javascript_Core/offlineasm/arm64.rb:
* Source/_javascript_Core/offlineasm/backends.rb:
* Source/_javascript_Core/offlineasm/config.rb:

Canonical link: https://commits.webkit.org/250946@main

Modified Paths

trunk/Source/_javascript_Core/offlineasm/arm.rb
trunk/Source/_javascript_Core/offlineasm/arm64.rb
trunk/Source/_javascript_Core/offlineasm/backends.rb
trunk/Source/_javascript_Core/offlineasm/config.rb




Diff

Modified: trunk/Source/_javascript_Core/offlineasm/arm.rb (294786 => 294787)

--- trunk/Source/_javascript_Core/offlineasm/arm.rb	2022-05-25 03:30:54 UTC (rev 294786)
+++ trunk/Source/_javascript_Core/offlineasm/arm.rb	2022-05-25 04:03:14 UTC (rev 294787)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2020 Apple Inc. All rights reserved.
+# Copyright (C) 2011-2022 Apple Inc. All rights reserved.
 # Copyright (C) 2013 University of Szeged. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -703,16 +703,16 @@
 uid = $asm.newUID
 
 $asm.putStr("#if OS(DARWIN)")
-$asm.puts "movw #{operands[1].armOperand}, :lower16:(L#{operands[0].asmLabel}_#{uid}$non_lazy_ptr-(L_offlineasm_#{uid}+4))"
-$asm.puts "movt #{operands[1].armOperand}, :upper16:(L#{operands[0].asmLabel}_#{uid}$non_lazy_ptr-(L_offlineasm_#{uid}+4))"
-$asm.puts "L_offlineasm_#{uid}:"
+$asm.puts "movw #{operands[1].armOperand}, :lower16:(L#{operands[0].asmLabel}_#{uid}$non_lazy_ptr-(Ljsc_llint_#{uid}+4))"
+$asm.puts "movt 

[webkit-changes] [294786] trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp

2022-05-24 Thread mark . lam
Title: [294786] trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp








Revision 294786
Author mark@apple.com
Date 2022-05-24 20:30:54 -0700 (Tue, 24 May 2022)


Log Message
[Clang only] Make every LLInt asm global label an alt entry.
https://bugs.webkit.org/show_bug.cgi?id=240890

Reviewed by Yusuke Suzuki.

This is needed to keep Clang from moving these labels around.  For correctness, the AfterGate
labels rely on themselves not being move from where they are declared in source asm code.  We
should enforce this with the .alt_entry directive.

* Source/_javascript_Core/llint/LowLevelInterpreter.cpp:

Canonical link: https://commits.webkit.org/250945@main

Modified Paths

trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp




Diff

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp (294785 => 294786)

--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp	2022-05-25 02:53:56 UTC (rev 294785)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp	2022-05-25 03:30:54 UTC (rev 294786)
@@ -478,8 +478,37 @@
 // Define the opcode dispatch mechanism when using an ASM loop:
 //
 
+#if COMPILER(CLANG)
+
+// We need an OFFLINE_ASM_BEGIN_SPACER because we'll be declaring every OFFLINE_ASM_GLOBAL_LABEL
+// as an alt entry. However, Clang will error out if the first global label is also an alt entry.
+// To work around this, we'll make OFFLINE_ASM_BEGIN emit an unused global label (which will now
+// be the first) that is not an alt entry, and insert a spacer instruction between it and the
+// actual first global label emitted by the offlineasm. Clang also requires that these 2 labels
+// not point to the same spot in memory; hence, the need for the spacer.
+//
+// For the spacer instruction, we'll choose a breakpoint instruction. However, we can
+// also just emit an unused piece of data. A breakpoint instruction is preferable.
+
+#if CPU(ARM_THUMB2)
+#define OFFLINE_ASM_BEGIN_SPACER "bkpt #0\n"
+#elif CPU(ARM64)
+#define OFFLINE_ASM_BEGIN_SPACER "brk #0xc471\n"
+#elif CPU(X86_64)
+#define OFFLINE_ASM_BEGIN_SPACER "int3\n"
+#else
+#define OFFLINE_ASM_BEGIN_SPACER ".int 0xbadbeef0\n"
+#endif
+
+#else
+#define OFFLINE_ASM_BEGIN_SPACER
+#endif // COMPILER(CLANG)
+
 // These are for building an interpreter from generated assembly code:
-#define OFFLINE_ASM_BEGIN   asm (
+#define OFFLINE_ASM_BEGIN   asm ( \
+OFFLINE_ASM_GLOBAL_LABEL_IMPL(jsc_llint_begin, OFFLINE_ASM_NO_ALT_ENTRY_DIRECTIVE) \
+OFFLINE_ASM_BEGIN_SPACER
+
 #define OFFLINE_ASM_END );
 
 #if ENABLE(LLINT_EMBEDDED_OPCODE_ID)
@@ -497,10 +526,20 @@
 OFFLINE_ASM_OPCODE_DEBUG_LABEL(__opcode) \
 OFFLINE_ASM_LOCAL_LABEL(__opcode)
 
+#define OFFLINE_ASM_NO_ALT_ENTRY_DIRECTIVE(label)
+
+#if COMPILER(CLANG)
+#define OFFLINE_ASM_ALT_ENTRY_DIRECTIVE(label) \
+".alt_entry " SYMBOL_STRING(label) "\n"
+#else
+#define OFFLINE_ASM_ALT_ENTRY_DIRECTIVE(label)
+#endif
+
 #if CPU(ARM_THUMB2)
-#define OFFLINE_ASM_GLOBAL_LABEL(label)  \
+#define OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, ALT_ENTRY) \
 ".text\n"\
-".balign 4\n" \
+".balign 4\n"\
+ALT_ENTRY(label) \
 ".globl " SYMBOL_STRING(label) "\n"  \
 HIDE_SYMBOL(label) "\n"  \
 ".thumb\n"   \
@@ -507,24 +546,27 @@
 ".thumb_func " THUMB_FUNC_PARAM(label) "\n"  \
 SYMBOL_STRING(label) ":\n"
 #elif CPU(ARM64)
-#define OFFLINE_ASM_GLOBAL_LABEL(label) \
+#define OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, ALT_ENTRY) \
 ".text\n"   \
-".balign 4\n"\
+".balign 4\n"   \
+ALT_ENTRY(label)\
 ".globl " SYMBOL_STRING(label) "\n" \
 HIDE_SYMBOL(label) "\n" \
 SYMBOL_STRING(label) ":\n"
 #else
-#define OFFLINE_ASM_GLOBAL_LABEL(label) \
+#define OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, ALT_ENTRY) \
 ".text\n"   \
+ALT_ENTRY(label)\
 ".globl " SYMBOL_STRING(label) "\n" \
 HIDE_SYMBOL(label) "\n" \
 SYMBOL_STRING(label) ":\n"
 #endif
 
+#define OFFLINE_ASM_GLOBAL_LABEL(label) \
+OFFLINE_ASM_GLOBAL_LABEL_IMPL(label, OFFLINE_ASM_ALT_ENTRY_DIRECTIVE)
+
 #if COMPILER(CLANG)
-#define OFFLINE_ASM_ALT_GLOBAL_LABEL(label) \
-".alt_entry " SYMBOL_STRING(label) "\n" \
-OFFLINE_ASM_GLOBAL_LABEL(label)
+#define OFFLINE_ASM_ALT_GLOBAL_LABEL(label) OFFLINE_ASM_GLOBAL_LABEL(label)
 #else
 #define OFFLINE_ASM_ALT_GLOBAL_LABEL(label)
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294785] trunk/Source/WebCore/platform/text/TextFlags.h

2022-05-24 Thread dpino
Title: [294785] trunk/Source/WebCore/platform/text/TextFlags.h








Revision 294785
Author dp...@igalia.com
Date 2022-05-24 19:53:56 -0700 (Tue, 24 May 2022)


Log Message
[GCC] Debian stable build bot broken after 250926@main
https://bugs.webkit.org/show_bug.cgi?id=240897

Reviewed by Cameron McCormack.

GCC8.3 (Debian 10) doesn't support direct brace enclosed initialization of
bitfield enums.

* Source/WebCore/platform/text/TextFlags.h: Move initialization of
  bitfield enums to constructor.

Canonical link: https://commits.webkit.org/250944@main

Modified Paths

trunk/Source/WebCore/platform/text/TextFlags.h




Diff

Modified: trunk/Source/WebCore/platform/text/TextFlags.h (294784 => 294785)

--- trunk/Source/WebCore/platform/text/TextFlags.h	2022-05-25 02:12:52 UTC (rev 294784)
+++ trunk/Source/WebCore/platform/text/TextFlags.h	2022-05-25 02:53:56 UTC (rev 294785)
@@ -65,8 +65,13 @@
 Force
 };
 
-ExpansionBehavior() = default;
+ExpansionBehavior()
+: left(Behavior::Forbid)
+, right(Behavior::Allow)
+{
 
+}
+
 ExpansionBehavior(Behavior left, Behavior right)
 : left(left)
 , right(right)
@@ -98,8 +103,9 @@
 return { Behavior::Forbid, Behavior::Forbid };
 }
 
-Behavior left : 2 { Behavior::Forbid };
-Behavior right : 2 { Behavior::Allow };
+static constexpr unsigned bitsOfKind = 2;
+Behavior left : bitsOfKind;
+Behavior right : bitsOfKind;
 };
 
 enum FontSynthesisValues {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294784] trunk/Source/WebKit

2022-05-24 Thread jya
Title: [294784] trunk/Source/WebKit








Revision 294784
Author j...@apple.com
Date 2022-05-24 19:12:52 -0700 (Tue, 24 May 2022)


Log Message
Reduce refcount of SharedMemory when sending them over IPC.
https://bugs.webkit.org/show_bug.cgi?id=240855
rdar://problem/93806688

Reviewed by Jer Noble.

In the future, we want to be able to donate memory with exclusive access to another process, this require the VM to have a refcount of 1.
No change in obeservable behaviour. Covered by existing tests.

* Source/WebKit/Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeSharedBuffer):
* Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
* Source/WebKit/WebProcess/GPU/media/RemoteMediaResourceProxy.cpp:
(WebKit::RemoteMediaResourceProxy::dataReceived):
* Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::append):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::writeItemsToPasteboard):
* Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performActionOnElement):
(WebKit::WebPage::didFinishLoadForQuickLookDocumentInMainFrame):
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::getDataSelectionForPasteboard):

Canonical link: https://commits.webkit.org/250943@main

Modified Paths

trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaResourceProxy.cpp
trunk/Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm




Diff

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (294783 => 294784)

--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2022-05-25 01:43:45 UTC (rev 294783)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2022-05-25 02:12:52 UTC (rev 294784)
@@ -188,8 +188,10 @@
 encoder.encodeFixedLengthData(element.segment->data(), element.segment->size(), 1);
 #else
 SharedMemory::Handle handle;
-auto sharedMemoryBuffer = SharedMemory::copyBuffer(*buffer);
-sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly);
+{
+auto sharedMemoryBuffer = SharedMemory::copyBuffer(*buffer);
+sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly);
+}
 encoder << SharedMemory::IPCHandle { WTFMove(handle), bufferSize };
 #endif
 }


Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm (294783 => 294784)

--- trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm	2022-05-25 01:43:45 UTC (rev 294783)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm	2022-05-25 02:12:52 UTC (rev 294784)
@@ -232,12 +232,14 @@
 uint64_t size = buffer->size();
 if (!size)
 return completionHandler({ });
-auto sharedMemoryBuffer = SharedMemory::copyBuffer(*buffer);
-if (!sharedMemoryBuffer)
-return completionHandler({ });
 SharedMemory::Handle handle;
-if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly))
-return completionHandler({ });
+{
+auto sharedMemoryBuffer = SharedMemory::copyBuffer(*buffer);
+if (!sharedMemoryBuffer)
+return completionHandler({ });
+if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly))
+return completionHandler({ });
+}
 completionHandler(SharedMemory::IPCHandle { WTFMove(handle), size });
 });
 }
@@ -554,12 +556,14 @@
 uint64_t size = buffer->size();
 if (!size)
 return completionHandler({ });
-auto sharedMemoryBuffer = SharedMemory::copyBuffer(*buffer);
-if (!sharedMemoryBuffer)
-return completionHandler({ });
 SharedMemory::Handle handle;
-if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly))
-return completionHandler({ });
+{
+auto sharedMemoryBuffer = SharedMemory::copyBuffer(*buffer);
+if (!sharedMemoryBuffer)
+return completionHandler({ });
+if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly))
+return completionHandler({ });
+}
 completionHandler(SharedMemory::IPCHandle { WTFMove(handle), size });
 });
 }


Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaResourceProxy.cpp 

[webkit-changes] [294783] tags/WebKit-7614.1.14.100.3/

2022-05-24 Thread alancoon
Title: [294783] tags/WebKit-7614.1.14.100.3/








Revision 294783
Author alanc...@apple.com
Date 2022-05-24 18:43:45 -0700 (Tue, 24 May 2022)


Log Message
Tag WebKit-7614.1.14.100.3.

Added Paths

tags/WebKit-7614.1.14.100.3/




Diff




___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294781] tags/WebKit-7614.1.14.1.10/

2022-05-24 Thread alancoon
Title: [294781] tags/WebKit-7614.1.14.1.10/








Revision 294781
Author alanc...@apple.com
Date 2022-05-24 18:37:07 -0700 (Tue, 24 May 2022)


Log Message
Tag WebKit-7614.1.14.1.10.

Added Paths

tags/WebKit-7614.1.14.1.10/




Diff




___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294782] tags/WebKit-7614.1.14.0.10/

2022-05-24 Thread alancoon
Title: [294782] tags/WebKit-7614.1.14.0.10/








Revision 294782
Author alanc...@apple.com
Date 2022-05-24 18:37:23 -0700 (Tue, 24 May 2022)


Log Message
Tag WebKit-7614.1.14.0.10.

Added Paths

tags/WebKit-7614.1.14.0.10/




Diff




___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294779] trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp

2022-05-24 Thread svillar
Title: [294779] trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp








Revision 294779
Author svil...@igalia.com
Date 2022-05-24 17:06:14 -0700 (Tue, 24 May 2022)


Log Message
Remove floating objects during tree normalization after style changes
https://bugs.webkit.org/show_bug.cgi?id=240797

Reviewed by Darin Adler.

Float boxes define their own block formatting context and thus can't have other intruding
floats. That's why this scenario is not allowed in the code, except in the case when
a regular box with floatting descendants becomes float. In that case the tree might
be temporarily in a semi-correct state until we don't remove the intruding floats.

The current code deals with that by calling rebuildFloatingObjectSetFromIntrudingFloats()
in the subsequent layout. However it's possible that before that a style change kicks in and
mutates the render tree. In that case we could be manipulating stale objects. To prevent
that we can simply directly call removeFloatingObjects() when normalizing the tree after
a style change.

* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange): Call removeFloatingObjects().

Canonical link: https://commits.webkit.org/250941@main

Modified Paths

trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp




Diff

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp (294778 => 294779)

--- trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2022-05-25 00:04:59 UTC (rev 294778)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp	2022-05-25 00:06:14 UTC (rev 294779)
@@ -673,6 +673,7 @@
 }
 };
 clearDescendantFloats();
+downcast(renderer).removeFloatingObjects();
 // Fresh floats need to be reparented if they actually belong to the previous anonymous block.
 // It copies the logic of RenderBlock::addChildIgnoringContinuation
 if (renderer.previousSibling() && renderer.previousSibling()->isAnonymousBlock())






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294778] trunk/LayoutTests

2022-05-24 Thread commit-queue
Title: [294778] trunk/LayoutTests








Revision 294778
Author commit-qu...@webkit.org
Date 2022-05-24 17:04:59 -0700 (Tue, 24 May 2022)


Log Message
[ macOS wk2 ] compositing/video/video-border-radius.html is a flakey image failure
https://bugs.webkit.org/show_bug.cgi?id=223383


Patch by Jean-Yves Avenard  on 2022-05-24
Reviewed by Eric Carlson.

The test waited on the event "canplaythrough" before performing
the screen comparison, assuming that the two videos would have
rendered their first video frame.
canplaythrough is fired, per spec, when the media engine has
buffered sufficient data to ensure a smooth playback to the end.
It provides no guarantee that playback/decoding has actually started.

So instead we wait for a frame to be actually painted with my new
favourite method of the day: requestVideoFrameCallback

* LayoutTests/compositing/video/video-border-radius.html:
* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/250940@main

Modified Paths

trunk/LayoutTests/compositing/video/video-border-radius.html
trunk/LayoutTests/platform/mac-wk2/TestExpectations




Diff

Modified: trunk/LayoutTests/compositing/video/video-border-radius.html (294777 => 294778)

--- trunk/LayoutTests/compositing/video/video-border-radius.html	2022-05-24 23:54:13 UTC (rev 294777)
+++ trunk/LayoutTests/compositing/video/video-border-radius.html	2022-05-25 00:04:59 UTC (rev 294778)
@@ -45,22 +45,13 @@
 }
 
 +