Commit 0973de40 authored by Alberto Garcia's avatar Alberto Garcia
Browse files

Update upstream source from tag 'upstream/2.28.2'

Update to upstream version '2.28.2'
with Debian dir 35f39b0c012b857980fd22bc765b0e6f2f7de6f4
parents 4fc36bdb c140a499
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">JavaScriptCore GLib Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for JavaScriptCore 2.28.1</p></div>
<div><p class="releaseinfo">for JavaScriptCore 2.28.2</p></div>
</div>
<hr>
</div>
......
......@@ -175,7 +175,7 @@ have included when compiling your code.</p>
<hr>
<div class="refsect2">
<a name="JSC-MICRO-VERSION:CAPS"></a><h3>JSC_MICRO_VERSION</h3>
<pre class="programlisting">#define JSC_MICRO_VERSION (1)
<pre class="programlisting">#define JSC_MICRO_VERSION (2)
</pre>
</div>
</div>
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKitGTK Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKitGTK 2.28.1</p></div>
<div><p class="releaseinfo">for WebKitGTK 2.28.2</p></div>
</div>
<hr>
</div>
......
......@@ -213,7 +213,7 @@ against at application run time.</p>
<hr>
<div class="refsect2">
<a name="WEBKIT-MICRO-VERSION:CAPS"></a><h3>WEBKIT_MICRO_VERSION</h3>
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (1)
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (2)
</pre>
<p>Like <a class="link" href="webkit2gtk-4.0-WebKitVersion.html#webkit-get-micro-version" title="webkit_get_micro_version ()"><code class="function">webkit_get_micro_version()</code></a>, but from the headers used at
application compile time, rather than from the library linked
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKitDOMGTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.28.1</p></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.28.2</p></div>
</div>
<hr>
</div>
......
================
WebKitGTK 2.28.2
================
What's new in WebKitGTK 2.28.2?
- Fix excessive CPU usage due to GdkFrameClock not being stopped.
- Fix UI process crash when EGL_WL_bind_wayland_display extension is not available.
- Fix position of select popup menus in X11.
- Fix playing of Youtube 'live stream'/H264 URLs.
- Fix a crash under X11 when cairo uses xcb.
- Fix the build in MIPS64.
- Fix several crashes and rendering issues.
================
WebKitGTK 2.28.1
================
......
......@@ -178,29 +178,28 @@ end
# Wasm specific helpers
macro preserveCalleeSavesUsedByWasm()
# NOTE: We intentionally don't save memoryBase and memorySize here. See the comment
# in restoreCalleeSavesUsedByWasm() below for why.
subp CalleeSaveSpaceStackAligned, sp
if ARM64 or ARM64E
emit "stp x23, x26, [x29, #-16]"
emit "stp x19, x22, [x29, #-32]"
emit "stp x19, x26, [x29, #-16]"
elsif X86_64
storep memorySize, -0x08[cfr]
storep memoryBase, -0x10[cfr]
storep PB, -0x18[cfr]
storep wasmInstance, -0x20[cfr]
storep PB, -0x8[cfr]
storep wasmInstance, -0x10[cfr]
else
error
end
end
macro restoreCalleeSavesUsedByWasm()
# NOTE: We intentionally don't restore memoryBase and memorySize here. These are saved
# and restored when entering Wasm by the JSToWasm wrapper and changes to them are meant
# to be observable within the same Wasm module.
if ARM64 or ARM64E
emit "ldp x23, x26, [x29, #-16]"
emit "ldp x19, x22, [x29, #-32]"
emit "ldp x19, x26, [x29, #-16]"
elsif X86_64
loadp -0x08[cfr], memorySize
loadp -0x10[cfr], memoryBase
loadp -0x18[cfr], PB
loadp -0x20[cfr], wasmInstance
loadp -0x8[cfr], PB
loadp -0x10[cfr], wasmInstance
else
error
end
......
......@@ -2173,6 +2173,9 @@ auto AirIRGenerator::addCall(uint32_t functionIndex, const Signature& signature,
restoreWebAssemblyGlobalState(RestoreCachedStackLimit::Yes, m_info.memory, currentInstance, continuation);
} else {
auto* patchpoint = emitCallPatchpoint(m_currentBlock, signature, results, args);
// We need to clobber the size register since the LLInt always bounds checks
if (m_mode == MemoryMode::Signaling)
patchpoint->clobberLate(RegisterSet { PinnedRegisterInfo::get().sizeRegister });
patchpoint->setGenerator([unlinkedWasmToWasmCalls, functionIndex] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
AllowMacroScratchRegisterUsage allowScratch(jit);
CCallHelpers::Call call = jit.threadSafePatchableNearCall();
......
......@@ -1726,6 +1726,9 @@ auto B3IRGenerator::addCall(uint32_t functionIndex, const Signature& signature,
patchpoint->effects.writesPinned = true;
patchpoint->effects.readsPinned = true;
// We need to clobber the size register since the LLInt always bounds checks
if (m_mode == MemoryMode::Signaling)
patchpoint->clobberLate(RegisterSet { PinnedRegisterInfo::get().sizeRegister });
patchpoint->setGenerator([unlinkedWasmToWasmCalls, functionIndex] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
AllowMacroScratchRegisterUsage allowScratch(jit);
CCallHelpers::Call call = jit.threadSafePatchableNearCall();
......
......@@ -94,8 +94,6 @@ RegisterAtOffsetList* LLIntCallee::calleeSaveRegisters()
#else
#error Unsupported architecture.
#endif
registers.set(GPRInfo::regCS3); // Memory base
registers.set(GPRInfo::regCS4); // Memory size
ASSERT(registers.numberOfSetRegisters() == numberOfLLIntCalleeSaveRegisters);
calleeSaveRegisters.construct(WTFMove(registers));
});
......
......@@ -46,7 +46,7 @@
namespace JSC { namespace Wasm {
constexpr unsigned numberOfLLIntCalleeSaveRegisters = 4;
constexpr unsigned numberOfLLIntCalleeSaveRegisters = 2;
using ArgumentLocation = B3::ValueRep;
enum class CallRole : uint8_t {
......
......@@ -146,7 +146,9 @@ void LLIntPlan::didCompleteCompilation(const AbstractLocker& locker)
SignatureIndex signatureIndex = m_moduleInformation->internalFunctionSignatureIndices[functionIndex];
const Signature& signature = SignatureInformation::get(signatureIndex);
CCallHelpers jit;
std::unique_ptr<InternalFunction> function = createJSToWasmWrapper(jit, signature, &m_unlinkedWasmToWasmCalls[functionIndex], m_moduleInformation.get(), m_mode, functionIndex);
// The LLInt always bounds checks
MemoryMode mode = MemoryMode::BoundsChecking;
std::unique_ptr<InternalFunction> function = createJSToWasmWrapper(jit, signature, &m_unlinkedWasmToWasmCalls[functionIndex], m_moduleInformation.get(), mode, functionIndex);
LinkBuffer linkBuffer(jit, nullptr, JITCompilationCanFail);
if (UNLIKELY(linkBuffer.didFailToAllocate())) {
......
......@@ -35,26 +35,6 @@
namespace JSC { namespace Wasm {
static Vector<GPRReg> getPinnedRegisters(unsigned remainingPinnedRegisters)
{
Vector<GPRReg> registers;
jsCallingConvention().calleeSaveRegisters.forEach([&] (Reg reg) {
if (!reg.isGPR())
return;
GPRReg gpr = reg.gpr();
if (!remainingPinnedRegisters || RegisterSet::stackRegisters().get(reg))
return;
if (RegisterSet::runtimeTagRegisters().get(reg)) {
// Since we don't need to, we currently don't pick from the tag registers to allow
// JS->Wasm stubs to freely use these registers.
return;
}
--remainingPinnedRegisters;
registers.append(gpr);
});
return registers;
}
const PinnedRegisterInfo& PinnedRegisterInfo::get()
{
static LazyNeverDestroyed<PinnedRegisterInfo> staticPinnedRegisterInfo;
......@@ -63,8 +43,6 @@ const PinnedRegisterInfo& PinnedRegisterInfo::get()
unsigned numberOfPinnedRegisters = 2;
if (!Context::useFastTLS())
++numberOfPinnedRegisters;
Vector<GPRReg> pinnedRegs = getPinnedRegisters(numberOfPinnedRegisters);
GPRReg baseMemoryPointer = GPRInfo::regCS3;
GPRReg sizeRegister = GPRInfo::regCS4;
GPRReg wasmContextInstancePointer = InvalidGPRReg;
......
......@@ -161,7 +161,8 @@ bool WebAssemblyFunction::useTagRegisters() const
RegisterSet WebAssemblyFunction::calleeSaves() const
{
return Wasm::PinnedRegisterInfo::get().toSave(instance()->memoryMode());
// Pessimistically save callee saves in BoundsChecking mode since the LLInt always bounds checks
return Wasm::PinnedRegisterInfo::get().toSave(Wasm::MemoryMode::BoundsChecking);
}
RegisterAtOffsetList WebAssemblyFunction::usedCalleeSaveRegisters() const
......
......@@ -49,7 +49,7 @@ namespace WTF {
// Use 64 KiB for any unknown CPUs to be conservative.
#if OS(DARWIN)
constexpr size_t CeilingOnPageSize = 16 * KB;
#elif OS(WINDOWS) || CPU(MIPS) || CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64)
#elif OS(WINDOWS) || CPU(MIPS) || CPU(MIPS64) || CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64)
constexpr size_t CeilingOnPageSize = 4 * KB;
#elif CPU(UNKNOWN) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE)
constexpr size_t CeilingOnPageSize = 64 * KB;
......
......@@ -241,6 +241,17 @@ void MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime(const MediaTime&
}
}
static bool checkShouldDelaySeek(GstStateChangeReturn getStateResult, GstState currentState, GstState newState)
{
if (getStateResult != GST_STATE_CHANGE_ASYNC)
return false;
if (GST_STATE_TRANSITION(currentState, newState) == GST_STATE_CHANGE_PLAYING_TO_PAUSED)
return false;
if (currentState == GST_STATE_READY && newState >= GST_STATE_PAUSED)
return false;
return true;
}
bool MediaPlayerPrivateGStreamerMSE::doSeek(const MediaTime& position, float rate, GstSeekFlags seekType)
{
// FIXME: Make a copy here because in some cases below it is modified. This
......@@ -259,13 +270,11 @@ bool MediaPlayerPrivateGStreamerMSE::doSeek(const MediaTime& position, float rat
m_isSeeking = false;
return false;
}
if ((getStateResult == GST_STATE_CHANGE_ASYNC
&& !(state == GST_STATE_PLAYING && newState == GST_STATE_PAUSED))
|| state < GST_STATE_PAUSED
|| m_isEndReached
|| !m_gstSeekCompleted) {
bool shouldDelaySeek = checkShouldDelaySeek(getStateResult, state, newState);
if (shouldDelaySeek || m_isEndReached || !m_gstSeekCompleted) {
CString reason = "Unknown reason";
if (getStateResult == GST_STATE_CHANGE_ASYNC) {
if (shouldDelaySeek) {
reason = makeString("In async change ",
gst_element_state_get_name(state), " --> ",
gst_element_state_get_name(newState)).utf8();
......@@ -347,20 +356,26 @@ bool MediaPlayerPrivateGStreamerMSE::doSeek(const MediaTime& position, float rat
GST_DEBUG_OBJECT(pipeline(), "Actual seek to %s, end time: %s, rate: %f", toString(startTime).utf8().data(), toString(endTime).utf8().data(), rate);
// This will call notifySeekNeedsData() after some time to tell that the pipeline is ready for sample enqueuing.
webKitMediaSrcPrepareSeek(WEBKIT_MEDIA_SRC(m_source.get()), seekTime);
m_gstSeekCompleted = false;
if (!gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, seekType, GST_SEEK_TYPE_SET, toGstClockTime(startTime), GST_SEEK_TYPE_SET, toGstClockTime(endTime))) {
webKitMediaSrcSetReadyForSamples(WEBKIT_MEDIA_SRC(m_source.get()), true);
m_isSeeking = false;
m_gstSeekCompleted = true;
GST_DEBUG_OBJECT(pipeline(), "doSeek(): gst_element_seek() failed, returning false");
return false;
}
if (state < GST_STATE_PAUSED) {
// Special case of initial seek. We set the right segment instead of a seek.
webKitMediaSrcPrepareInitialSeek(WEBKIT_MEDIA_SRC(m_source.get()), rate, startTime, endTime);
notifySeekNeedsDataForTime(seekTime);
GST_DEBUG("Initial seek succeeded, returning true");
} else {
// This will call notifySeekNeedsData() after some time to tell that the pipeline is ready for sample enqueuing.
webKitMediaSrcPrepareSeek(WEBKIT_MEDIA_SRC(m_source.get()), seekTime);
// The samples will be enqueued in notifySeekNeedsData().
GST_DEBUG_OBJECT(pipeline(), "doSeek(): gst_element_seek() succeeded, returning true");
if (!gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, seekType, GST_SEEK_TYPE_SET, toGstClockTime(startTime), GST_SEEK_TYPE_SET, toGstClockTime(endTime))) {
webKitMediaSrcSetReadyForSamples(WEBKIT_MEDIA_SRC(m_source.get()), true);
m_isSeeking = false;
m_gstSeekCompleted = true;
GST_DEBUG("gst_element_seek() failed, returning false");
return false;
}
// The samples will be enqueued in notifySeekNeedsData().
GST_DEBUG("gst_element_seek() succeeded, returning true");
}
return true;
}
......
......@@ -729,6 +729,55 @@ void webKitMediaSrcPrepareSeek(WebKitMediaSrc* source, const MediaTime& time)
GST_OBJECT_UNLOCK(source);
}
GstPadProbeReturn initialSeekSegmentFixerProbe(GstPad *pad, GstPadProbeInfo *info, gpointer userData)
{
GstEvent* event = GST_PAD_PROBE_INFO_EVENT(info);
if (GST_EVENT_TYPE(event) == GST_EVENT_SEGMENT) {
const GstSegment* originalSegment = nullptr;
const GstSegment* fixedSegment = static_cast<GstSegment*>(userData);
gst_event_parse_segment(event, &originalSegment);
GST_DEBUG("Segment at %s: %" GST_SEGMENT_FORMAT ", replaced by %" GST_SEGMENT_FORMAT, GST_ELEMENT_NAME(GST_PAD_PARENT(pad)), originalSegment, fixedSegment);
gst_event_replace(reinterpret_cast<GstEvent**>(&info->data), gst_event_new_segment(fixedSegment));
return GST_PAD_PROBE_REMOVE;
}
return GST_PAD_PROBE_OK;
}
void webKitMediaSrcPrepareInitialSeek(WebKitMediaSrc* source, double rate, const MediaTime& startTime, const MediaTime& endTime)
{
GST_OBJECT_LOCK(source);
MediaTime seekTime = (rate >= 0) ? startTime : endTime;
source->priv->seekTime = seekTime;
source->priv->appsrcSeekDataCount = 0;
source->priv->appsrcNeedDataCount = 0;
for (Stream* stream : source->priv->streams) {
stream->appsrcNeedDataFlag = false;
// Don't allow samples away from the seekTime to be enqueued.
stream->lastEnqueuedTime = seekTime;
}
// The pending action will be performed in enabledAppsrcSeekData().
source->priv->appsrcSeekDataNextAction = MediaSourceSeekToTime;
GUniquePtr<GstSegment> segment(gst_segment_new());
segment->format = GST_FORMAT_TIME;
gst_segment_do_seek(segment.get(), rate, GST_FORMAT_TIME,
static_cast<GstSeekFlags>(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
GST_SEEK_TYPE_SET, WebCore::toGstUnsigned64Time(startTime),
GST_SEEK_TYPE_SET, WebCore::toGstUnsigned64Time(endTime), nullptr);
for (Stream* stream : source->priv->streams) {
// This probe will fix the segment autogenerated by appsrc.
GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(stream->appsrc, "src"));
gst_pad_add_probe(pad.get(), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
initialSeekSegmentFixerProbe, gst_segment_copy(segment.get()), reinterpret_cast<GDestroyNotify>(gst_segment_free));
stream->sourceBuffer->setReadyForMoreSamples(true);
}
GST_OBJECT_UNLOCK(source);
}
namespace WTF {
template <> GRefPtr<WebKitMediaSrc> adoptGRef(WebKitMediaSrc* ptr)
{
......
......@@ -73,6 +73,7 @@ GType webkit_media_src_get_type(void);
void webKitMediaSrcSetMediaPlayerPrivate(WebKitMediaSrc*, WebCore::MediaPlayerPrivateGStreamerMSE*);
void webKitMediaSrcPrepareSeek(WebKitMediaSrc*, const MediaTime&);
void webKitMediaSrcPrepareInitialSeek(WebKitMediaSrc*, double rate, const MediaTime& startTime, const MediaTime& endTime);
void webKitMediaSrcSetReadyForSamples(WebKitMediaSrc*, bool);
G_END_DECLS
......
......@@ -40,8 +40,14 @@ DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk(PlatformDisplayID displayID)
DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk()
{
if (m_window)
gtk_widget_destroy(m_window);
if (!m_window)
return;
auto* frameClock = gtk_widget_get_frame_clock(m_window);
ASSERT(frameClock);
g_signal_handlers_disconnect_matched(frameClock, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
gdk_frame_clock_end_updating(frameClock);
gtk_widget_destroy(m_window);
}
static void onFrameClockUpdate(GdkFrameClock*, DisplayRefreshMonitorGtk* monitor)
......@@ -60,8 +66,7 @@ bool DisplayRefreshMonitorGtk::requestRefreshCallback()
gtk_widget_realize(m_window);
auto* frameClock = gtk_widget_get_frame_clock(m_window);
if (!frameClock)
return false;
ASSERT(frameClock);
g_signal_connect(frameClock, "update", G_CALLBACK(onFrameClockUpdate), this);
gdk_frame_clock_begin_updating(frameClock);
......
......@@ -92,7 +92,12 @@ bool AcceleratedBackingStoreWayland::checkRequirements()
{
#if USE(WPE_RENDERER)
if (!glImageTargetTexture2D) {
if (!wpe_fdo_initialize_for_egl_display(PlatformDisplay::sharedDisplay().eglDisplay()))
auto* eglDisplay = PlatformDisplay::sharedDisplay().eglDisplay();
const char* extensions = eglQueryString(eglDisplay, EGL_EXTENSIONS);
if (!GLContext::isExtensionSupported(extensions, "EGL_WL_bind_wayland_display"))
return false;
if (!wpe_fdo_initialize_for_egl_display(eglDisplay))
return false;
std::unique_ptr<WebCore::GLContext> eglContext = GLContext::createOffscreenContext();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment