Commit 6bd97a63 authored by Alberto Garcia's avatar Alberto Garcia
Browse files

New upstream version 2.15.91

parent b7e87958
......@@ -818,10 +818,14 @@ webkit_website_data_manager_clear (<em class="parameter"><code><a class="link" h
modified in the past <em class="parameter"><code>timespan</code></em>
.
If <em class="parameter"><code>timespan</code></em>
is 0 all website data will be removed.</p>
is 0, all website data will be removed.</p>
<p>When the operation is finished, <em class="parameter"><code>callback</code></em>
will be called. You can then call
<a class="link" href="WebKitWebsiteDataManager.html#webkit-website-data-manager-clear-finish" title="webkit_website_data_manager_clear_finish ()"><code class="function">webkit_website_data_manager_clear_finish()</code></a> to get the result of the operation.</p>
<p>Due to implementation limitations, this function does not currently delete
any stored cookies if <em class="parameter"><code>timespan</code></em>
is nonzero. This behavior may change in the
future.</p>
<div class="refsect3">
<a name="webkit-website-data-manager-clear.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
......
......@@ -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">WebKit2GTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.15.90</p></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.15.91</p></div>
</div>
<hr>
</div>
......
......@@ -177,7 +177,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 (90)
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (91)
</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.15.90</p></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.15.91</p></div>
</div>
<hr>
</div>
......
==================
WebKitGTK+ 2.15.91
==================
What's new in WebKitGTK+ 2.15.91?
- Fix rendering artifacts when resizing the window in accelerated compositing mode.
- Remove flickering when leaving accelerated compositing mode.
- Fix a web process crash when loading duck duck go.
- Properly handle copy drag and drop operations.
- Fix a hang when sending an IPC messages fails because socket read buffers are full.
- Ensure we never try to load GTK2 plugins in Wayland.
- Fix several crashes and rendering issues.
==================
WebKitGTK+ 2.15.90
==================
......
......@@ -228,6 +228,7 @@ set(JavaScriptCore_SOURCES
bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp
bytecode/LazyOperandValueProfile.cpp
bytecode/MethodOfGettingAValueProfile.cpp
bytecode/ModuleNamespaceAccessCase.cpp
bytecode/ModuleProgramCodeBlock.cpp
bytecode/ObjectPropertyCondition.cpp
bytecode/ObjectPropertyConditionSet.cpp
......@@ -474,6 +475,7 @@ set(JavaScriptCore_SOURCES
heap/CellContainer.cpp
heap/CodeBlockSet.cpp
heap/CollectionScope.cpp
heap/CollectorPhase.cpp
heap/ConservativeRoots.cpp
heap/DeferGC.cpp
heap/DestructionMode.cpp
......@@ -481,6 +483,7 @@ set(JavaScriptCore_SOURCES
heap/FullGCActivityCallback.cpp
heap/FreeList.cpp
heap/GCActivityCallback.cpp
heap/GCConductor.cpp
heap/GCLogging.cpp
heap/HandleSet.cpp
heap/HandleStack.cpp
......@@ -490,7 +493,6 @@ set(JavaScriptCore_SOURCES
heap/HeapProfiler.cpp
heap/HeapSnapshot.cpp
heap/HeapSnapshotBuilder.cpp
heap/HeapStatistics.cpp
heap/HeapTimer.cpp
heap/HeapVerifier.cpp
heap/IncrementalSweeper.cpp
......@@ -576,7 +578,6 @@ set(JavaScriptCore_SOURCES
jit/CallFrameShuffler64.cpp
jit/ExecutableAllocationFuzz.cpp
jit/ExecutableAllocator.cpp
jit/ExecutableAllocatorFixedVMPool.cpp
jit/GCAwareJITStubRoutine.cpp
jit/GPRInfo.cpp
jit/HostCallReturnValue.cpp
......
......@@ -196,6 +196,9 @@ void LinkBuffer::copyCompactAndLinkCode(MacroAssembler& macroAssembler, void* ow
void LinkBuffer::linkCode(MacroAssembler& macroAssembler, void* ownerUID, JITCompilationEffort effort)
{
// Ensure that the end of the last invalidation point does not extend beyond the end of the buffer.
macroAssembler.label();
#if !ENABLE(BRANCH_COMPACTION)
#if defined(ASSEMBLER_HAS_CONSTANT_POOL) && ASSEMBLER_HAS_CONSTANT_POOL
macroAssembler.m_assembler.buffer().flushConstantPool(false);
......
......@@ -37,7 +37,10 @@
#include "HeapInlines.h"
#include "IntrinsicGetterAccessCase.h"
#include "JSCJSValueInlines.h"
#include "JSModuleEnvironment.h"
#include "JSModuleNamespaceObject.h"
#include "LinkBuffer.h"
#include "ModuleNamespaceAccessCase.h"
#include "PolymorphicAccess.h"
#include "ScopedArguments.h"
#include "ScratchRegisterAllocator.h"
......@@ -65,6 +68,7 @@ std::unique_ptr<AccessCase> AccessCase::create(VM& vm, JSCell* owner, AccessType
case StringLength:
case DirectArgumentsLength:
case ScopedArgumentsLength:
case ModuleNamespaceLoad:
case Replace:
break;
default:
......@@ -148,6 +152,7 @@ bool AccessCase::guardedByStructureCheck() const
case StringLength:
case DirectArgumentsLength:
case ScopedArgumentsLength:
case ModuleNamespaceLoad:
return false;
default:
return true;
......@@ -193,6 +198,13 @@ bool AccessCase::canReplace(const AccessCase& other) const
case DirectArgumentsLength:
case ScopedArgumentsLength:
return other.type() == type();
case ModuleNamespaceLoad: {
if (other.type() != type())
return false;
auto& thisCase = this->as<ModuleNamespaceAccessCase>();
auto& otherCase = this->as<ModuleNamespaceAccessCase>();
return thisCase.moduleNamespaceObject() == otherCase.moduleNamespaceObject();
}
default:
if (!guardedByStructureCheck() || !other.guardedByStructureCheck())
return false;
......@@ -239,6 +251,12 @@ bool AccessCase::visitWeak(VM& vm) const
auto& intrinsic = this->as<IntrinsicGetterAccessCase>();
if (intrinsic.intrinsicFunction() && !Heap::isMarked(intrinsic.intrinsicFunction()))
return false;
} else if (type() == ModuleNamespaceLoad) {
auto& accessCase = this->as<ModuleNamespaceAccessCase>();
if (accessCase.moduleNamespaceObject() && !Heap::isMarked(accessCase.moduleNamespaceObject()))
return false;
if (accessCase.moduleEnvironment() && !Heap::isMarked(accessCase.moduleEnvironment()))
return false;
}
return true;
......@@ -344,6 +362,11 @@ void AccessCase::generateWithGuard(
return;
}
case ModuleNamespaceLoad: {
this->as<ModuleNamespaceAccessCase>().emit(state, fallThrough);
return;
}
default: {
if (viaProxy()) {
fallThrough.append(
......@@ -991,6 +1014,7 @@ void AccessCase::generateImpl(AccessGenerationState& state)
case DirectArgumentsLength:
case ScopedArgumentsLength:
case ModuleNamespaceLoad:
// These need to be handled by generateWithGuard(), since the guard is part of the
// algorithm. We can be sure that nobody will call generate() directly for these since they
// are not guarded by structure checks.
......
......@@ -95,7 +95,8 @@ public:
ArrayLength,
StringLength,
DirectArgumentsLength,
ScopedArgumentsLength
ScopedArgumentsLength,
ModuleNamespaceLoad,
};
enum State : uint8_t {
......
......@@ -2532,7 +2532,12 @@ void CodeBlock::visitChildren(SlotVisitor& visitor)
visitor.reportExtraMemoryVisited(m_jitCode->size());
if (m_instructions.size()) {
unsigned refCount = m_instructions.refCount();
RELEASE_ASSERT(refCount);
if (!refCount) {
dataLog("CodeBlock: ", RawPointer(this), "\n");
dataLog("m_instructions.data(): ", RawPointer(m_instructions.data()), "\n");
dataLog("refCount: ", refCount, "\n");
RELEASE_ASSERT_NOT_REACHED();
}
visitor.reportExtraMemoryVisited(m_instructions.size() * sizeof(Instruction) / refCount);
}
......
......@@ -34,6 +34,7 @@
#include "JSScope.h"
#include "LLIntData.h"
#include "LowLevelInterpreter.h"
#include "ModuleNamespaceAccessCase.h"
#include "PolymorphicAccess.h"
#include "StructureStubInfo.h"
#include <wtf/ListDump.h>
......@@ -147,6 +148,15 @@ GetByIdStatus GetByIdStatus::computeForStubInfo(const ConcurrentJSLocker& locker
#endif // ENABLE(DFG_JIT)
#if ENABLE(JIT)
GetByIdStatus::GetByIdStatus(const ModuleNamespaceAccessCase& accessCase)
: m_state(ModuleNamespace)
, m_wasSeenInJIT(true)
, m_moduleNamespaceObject(accessCase.moduleNamespaceObject())
, m_moduleEnvironment(accessCase.moduleEnvironment())
, m_scopeOffset(accessCase.scopeOffset())
{
}
GetByIdStatus GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback(
const ConcurrentJSLocker& locker, CodeBlock* profiledBlock, StructureStubInfo* stubInfo, UniquedStringImpl* uid,
CallLinkStatus::ExitSiteData callExitSiteData)
......@@ -195,6 +205,16 @@ GetByIdStatus GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback(
}
case CacheType::Stub: {
if (list->size() == 1) {
const AccessCase& access = list->at(0);
switch (access.type()) {
case AccessCase::ModuleNamespaceLoad:
return GetByIdStatus(access.as<ModuleNamespaceAccessCase>());
default:
break;
}
}
for (unsigned listIndex = 0; listIndex < list->size(); ++listIndex) {
const AccessCase& access = list->at(listIndex);
if (access.viaProxy())
......@@ -376,6 +396,7 @@ bool GetByIdStatus::makesCalls() const
case NoInformation:
case TakesSlowPath:
case Custom:
case ModuleNamespace:
return false;
case Simple:
for (unsigned i = m_variants.size(); i--;) {
......@@ -420,6 +441,9 @@ void GetByIdStatus::dump(PrintStream& out) const
case Custom:
out.print("Custom");
break;
case ModuleNamespace:
out.print("ModuleNamespace");
break;
case TakesSlowPath:
out.print("TakesSlowPath");
break;
......
......@@ -30,10 +30,15 @@
#include "ConcurrentJSLock.h"
#include "ExitingJITType.h"
#include "GetByIdVariant.h"
#include "ScopeOffset.h"
namespace JSC {
class AccessCase;
class CodeBlock;
class JSModuleEnvironment;
class JSModuleNamespaceObject;
class ModuleNamespaceAccessCase;
class StructureStubInfo;
typedef HashMap<CodeOrigin, StructureStubInfo*, CodeOriginApproximateHash> StubInfoMap;
......@@ -41,12 +46,19 @@ typedef HashMap<CodeOrigin, StructureStubInfo*, CodeOriginApproximateHash> StubI
class GetByIdStatus {
public:
enum State {
NoInformation, // It's uncached so we have no information.
Simple, // It's cached for a simple access to a known object property with
// a possible structure chain and a possible specific value.
Custom, // It's cached for a custom accessor with a possible structure chain.
TakesSlowPath, // It's known to often take slow path.
MakesCalls // It's known to take paths that make calls.
// It's uncached so we have no information.
NoInformation,
// It's cached for a simple access to a known object property with
// a possible structure chain and a possible specific value.
Simple,
// It's cached for a custom accessor with a possible structure chain.
Custom,
// It's cached for an access to a module namespace object's binding.
ModuleNamespace,
// It's known to often take slow path.
TakesSlowPath,
// It's known to take paths that make calls.
MakesCalls,
};
GetByIdStatus()
......@@ -59,6 +71,7 @@ public:
{
ASSERT(state == NoInformation || state == TakesSlowPath || state == MakesCalls);
}
GetByIdStatus(
State state, bool wasSeenInJIT, const GetByIdVariant& variant = GetByIdVariant())
......@@ -84,19 +97,24 @@ public:
bool operator!() const { return !isSet(); }
bool isSimple() const { return m_state == Simple; }
bool isCustom() const { return m_state == Custom; }
bool isModuleNamespace() const { return m_state == ModuleNamespace; }
size_t numVariants() const { return m_variants.size(); }
const Vector<GetByIdVariant, 1>& variants() const { return m_variants; }
const GetByIdVariant& at(size_t index) const { return m_variants[index]; }
const GetByIdVariant& operator[](size_t index) const { return at(index); }
bool takesSlowPath() const { return m_state == TakesSlowPath || m_state == MakesCalls || m_state == Custom; }
bool takesSlowPath() const { return m_state == TakesSlowPath || m_state == MakesCalls || m_state == Custom || m_state == ModuleNamespace; }
bool makesCalls() const;
bool wasSeenInJIT() const { return m_wasSeenInJIT; }
// Attempts to reduce the set of variants to fit the given structure set. This may be approximate.
void filter(const StructureSet&);
JSModuleNamespaceObject* moduleNamespaceObject() const { return m_moduleNamespaceObject; }
JSModuleEnvironment* moduleEnvironment() const { return m_moduleEnvironment; }
ScopeOffset scopeOffset() const { return m_scopeOffset; }
void dump(PrintStream&) const;
......@@ -105,6 +123,7 @@ private:
static bool hasExitSite(const ConcurrentJSLocker&, CodeBlock*, unsigned bytecodeIndex);
#endif
#if ENABLE(JIT)
GetByIdStatus(const ModuleNamespaceAccessCase&);
static GetByIdStatus computeForStubInfoWithoutExitSiteFeedback(
const ConcurrentJSLocker&, CodeBlock* profiledBlock, StructureStubInfo*,
UniquedStringImpl* uid, CallLinkStatus::ExitSiteData);
......@@ -116,6 +135,9 @@ private:
State m_state;
Vector<GetByIdVariant, 1> m_variants;
bool m_wasSeenInJIT;
JSModuleNamespaceObject* m_moduleNamespaceObject { nullptr };
JSModuleEnvironment* m_moduleEnvironment { nullptr };
ScopeOffset m_scopeOffset { };
};
} // namespace JSC
/*
* Copyright (C) 2017 Yusuke Suzuki <utatane.tea@gmail.com>.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "ModuleNamespaceAccessCase.h"
#if ENABLE(JIT)
#include "CCallHelpers.h"
#include "HeapInlines.h"
#include "JSModuleEnvironment.h"
#include "JSModuleNamespaceObject.h"
#include "PolymorphicAccess.h"
#include "StructureStubInfo.h"
namespace JSC {
ModuleNamespaceAccessCase::ModuleNamespaceAccessCase(VM& vm, JSCell* owner, JSModuleNamespaceObject* moduleNamespaceObject, JSModuleEnvironment* moduleEnvironment, ScopeOffset scopeOffset)
: Base(vm, owner, ModuleNamespaceLoad, invalidOffset, nullptr, ObjectPropertyConditionSet())
, m_scopeOffset(scopeOffset)
{
m_moduleNamespaceObject.set(vm, owner, moduleNamespaceObject);
m_moduleEnvironment.set(vm, owner, moduleEnvironment);
}
std::unique_ptr<AccessCase> ModuleNamespaceAccessCase::create(VM& vm, JSCell* owner, JSModuleNamespaceObject* moduleNamespaceObject, JSModuleEnvironment* moduleEnvironment, ScopeOffset scopeOffset)
{
return std::unique_ptr<AccessCase>(new ModuleNamespaceAccessCase(vm, owner, moduleNamespaceObject, moduleEnvironment, scopeOffset));
}
ModuleNamespaceAccessCase::~ModuleNamespaceAccessCase()
{
}
std::unique_ptr<AccessCase> ModuleNamespaceAccessCase::clone() const
{
std::unique_ptr<ModuleNamespaceAccessCase> result(new ModuleNamespaceAccessCase(*this));
result->resetState();
return WTFMove(result);
}
void ModuleNamespaceAccessCase::emit(AccessGenerationState& state, MacroAssembler::JumpList& fallThrough)
{
CCallHelpers& jit = *state.jit;
JSValueRegs valueRegs = state.valueRegs;
GPRReg baseGPR = state.baseGPR;
fallThrough.append(
jit.branchPtr(
CCallHelpers::NotEqual,
baseGPR,
CCallHelpers::TrustedImmPtr(m_moduleNamespaceObject.get())));
jit.loadValue(&m_moduleEnvironment->variableAt(m_scopeOffset), valueRegs);
state.failAndIgnore.append(jit.branchIfEmpty(valueRegs));
state.succeed();
}
} // namespace JSC
#endif // ENABLE(JIT)
/*
* Copyright (C) 2017 Yusuke Suzuki <utatane.tea@gmail.com>.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#if ENABLE(JIT)
#include "AccessCase.h"
namespace JSC {
class JSModuleEnvironment;
class JSModuleNamespaceObject;
class ModuleNamespaceAccessCase : public AccessCase {
public:
using Base = AccessCase;
friend class AccessCase;
JSModuleNamespaceObject* moduleNamespaceObject() const { return m_moduleNamespaceObject.get(); }
JSModuleEnvironment* moduleEnvironment() const { return m_moduleEnvironment.get(); }
ScopeOffset scopeOffset() const { return m_scopeOffset; }
static std::unique_ptr<AccessCase> create(VM&, JSCell* owner, JSModuleNamespaceObject*, JSModuleEnvironment*, ScopeOffset);
std::unique_ptr<AccessCase> clone() const override;
void emit(AccessGenerationState&, MacroAssembler::JumpList& fallThrough);
~ModuleNamespaceAccessCase();
private:
ModuleNamespaceAccessCase(VM&, JSCell* owner, JSModuleNamespaceObject*, JSModuleEnvironment*, ScopeOffset);
WriteBarrier<JSModuleNamespaceObject> m_moduleNamespaceObject;
WriteBarrier<JSModuleEnvironment> m_moduleEnvironment;
ScopeOffset m_scopeOffset;
};
} // namespace JSC
#endif // ENABLE(JIT)
......@@ -645,6 +645,9 @@ void printInternal(PrintStream& out, AccessCase::AccessType type)
case AccessCase::ScopedArgumentsLength:
out.print("ScopedArgumentsLength");
return;
case AccessCase::ModuleNamespaceLoad:
out.print("ModuleNamespaceLoad");
return;
}
RELEASE_ASSERT_NOT_REACHED();
......
/*
* Copyright (C) 2008-2009, 2012-2016 Apple Inc. All rights reserved.
* Copyright (C) 2008-2017 Apple Inc. All rights reserved.
* Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca>
* Copyright (C) 2012 Igalia, S.L.
*
......@@ -4822,25 +4822,23 @@ void BytecodeGenerator::emitGeneratorStateChange(int32_t state)
bool BytecodeGenerator::emitJumpViaFinallyIfNeeded(int targetLabelScopeDepth, Label& jumpTarget)
{
ASSERT(labelScopeDepth() - targetLabelScopeDepth >= 0);
size_t scopeDelta = labelScopeDepth() - targetLabelScopeDepth;
ASSERT(scopeDelta <= m_controlFlowScopeStack.size());
if (!scopeDelta)
return false; // No finallys to thread through.
ControlFlowScope* topScope = &m_controlFlowScopeStack.last();
ControlFlowScope* bottomScope = &m_controlFlowScopeStack.last() - scopeDelta;
size_t numberOfScopesToCheckForFinally = labelScopeDepth() - targetLabelScopeDepth;
ASSERT(numberOfScopesToCheckForFinally <= m_controlFlowScopeStack.size());
if (!numberOfScopesToCheckForFinally)
return false;
FinallyContext* innermostFinallyContext = nullptr;
FinallyContext* outermostFinallyContext = nullptr;
while (topScope > bottomScope) {
if (topScope->isFinallyScope()) {
FinallyContext* finallyContext = &topScope->finallyContext;
size_t scopeIndex = m_controlFlowScopeStack.size() - 1;
while (numberOfScopesToCheckForFinally--) {
ControlFlowScope* scope = &m_controlFlowScopeStack[scopeIndex--];
if (scope->isFinallyScope()) {
FinallyContext* finallyContext = &scope->finallyContext;
if (!innermostFinallyContext)
innermostFinallyContext = finallyContext;
outermostFinallyContext = finallyContext;
finallyContext->incNumberOfBreaksOrContinues();
}
--topScope;
}
if (!outermostFinallyContext)
return false; // No finallys to thread through.
......@@ -4856,21 +4854,20 @@ bool BytecodeGenerator::emitJumpViaFinallyIfNeeded(int targetLabelScopeDepth, La
bool BytecodeGenerator::emitReturnViaFinallyIfNeeded(RegisterID* returnRegister)
{
if (!m_controlFlowScopeStack.size())
return false; // No finallys to thread through.
ControlFlowScope* topScope = &m_controlFlowScopeStack.last();
ControlFlowScope* bottomScope = &m_controlFlowScopeStack.first();
size_t numberOfScopesToCheckForFinally = m_controlFlowScopeStack.size();
if (!numberOfScopesToCheckForFinally)
return false;
FinallyContext* innermostFinallyContext = nullptr;
while (topScope >= bottomScope) {
if (topScope->isFinallyScope()) {
FinallyContext* finallyContext = &topScope->finallyContext;
while (numberOfScopesToCheckForFinally) {
size_t scopeIndex = --numberOfScopesToCheckForFinally;
ControlFlowScope* scope = &m_controlFlowScopeStack[scopeIndex];
if (scope->isFinallyScope()) {
FinallyContext* finallyContext = &scope->finallyContext;
if (!innermostFinallyContext)
innermostFinallyContext = finallyContext;
finallyContext->setHandlesReturns();
}
--topScope;
}
if (!innermostFinallyContext)
return false; // No finallys to thread through.
......
......@@ -46,6 +46,7 @@
#include "Heap.h"
#include "JSCInlines.h"