Title: [210119] trunk/Source/_javascript_Core
- Revision
- 210119
- Author
- [email protected]
- Date
- 2016-12-22 15:23:51 -0800 (Thu, 22 Dec 2016)
Log Message
BytecodeGenerator::m_finallyDepth should be unsigned.
https://bugs.webkit.org/show_bug.cgi?id=166438
Reviewed by Saam Barati.
Also removed FinallyContext::m_finallyDepth because it is not used.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::pushFinallyControlFlowScope):
(JSC::BytecodeGenerator::labelScopeDepth):
* bytecompiler/BytecodeGenerator.h:
(JSC::FinallyContext::FinallyContext):
(JSC::FinallyContext::finallyLabel):
(JSC::FinallyContext::depth): Deleted.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (210118 => 210119)
--- trunk/Source/_javascript_Core/ChangeLog 2016-12-22 23:18:12 UTC (rev 210118)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-12-22 23:23:51 UTC (rev 210119)
@@ -1,5 +1,22 @@
2016-12-22 Mark Lam <[email protected]>
+ BytecodeGenerator::m_finallyDepth should be unsigned.
+ https://bugs.webkit.org/show_bug.cgi?id=166438
+
+ Reviewed by Saam Barati.
+
+ Also removed FinallyContext::m_finallyDepth because it is not used.
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::pushFinallyControlFlowScope):
+ (JSC::BytecodeGenerator::labelScopeDepth):
+ * bytecompiler/BytecodeGenerator.h:
+ (JSC::FinallyContext::FinallyContext):
+ (JSC::FinallyContext::finallyLabel):
+ (JSC::FinallyContext::depth): Deleted.
+
+2016-12-22 Mark Lam <[email protected]>
+
De-duplicate finally blocks.
https://bugs.webkit.org/show_bug.cgi?id=160168
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (210118 => 210119)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2016-12-22 23:18:12 UTC (rev 210118)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2016-12-22 23:23:51 UTC (rev 210119)
@@ -3687,7 +3687,7 @@
while (m_labelScopes.size() && !m_labelScopes.last().refCount())
m_labelScopes.removeLast();
- ControlFlowScope scope(ControlFlowScope::Finally, currentLexicalScopeIndex(), FinallyContext(m_currentFinallyContext, finallyLabel, m_finallyDepth));
+ ControlFlowScope scope(ControlFlowScope::Finally, currentLexicalScopeIndex(), FinallyContext(m_currentFinallyContext, finallyLabel));
m_controlFlowScopeStack.append(WTFMove(scope));
m_finallyDepth++;
@@ -3886,8 +3886,8 @@
int BytecodeGenerator::labelScopeDepth() const
{
- int depth = localScopeDepth() + m_finallyDepth;
- ASSERT(depth == static_cast<int>(m_controlFlowScopeStack.size()));
+ unsigned depth = localScopeDepth() + m_finallyDepth;
+ ASSERT(depth == m_controlFlowScopeStack.size());
return depth;
}
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h (210118 => 210119)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2016-12-22 23:18:12 UTC (rev 210118)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2016-12-22 23:23:51 UTC (rev 210119)
@@ -121,18 +121,15 @@
struct FinallyContext {
FinallyContext() { }
- FinallyContext(FinallyContext* outerContext, Label* finallyLabel, int finallyDepth)
+ FinallyContext(FinallyContext* outerContext, Label* finallyLabel)
: m_outerContext(outerContext)
, m_finallyLabel(finallyLabel)
- , m_finallyDepth(finallyDepth)
{
- ASSERT(m_finallyDepth >= 0);
ASSERT(m_jumps.isEmpty());
}
FinallyContext* outerContext() const { return m_outerContext; }
Label* finallyLabel() const { return m_finallyLabel; }
- int depth() const { return m_finallyDepth; }
uint32_t numberOfBreaksOrContinues() const { return m_numberOfBreaksOrContinues.unsafeGet(); }
void incNumberOfBreaksOrContinues() { m_numberOfBreaksOrContinues++; }
@@ -151,7 +148,6 @@
private:
FinallyContext* m_outerContext { nullptr };
Label* m_finallyLabel { nullptr };
- int m_finallyDepth { 0 };
Checked<uint32_t, WTF::CrashOnOverflow> m_numberOfBreaksOrContinues;
bool m_handlesReturns { false };
Vector<FinallyJump> m_jumps;
@@ -1091,7 +1087,7 @@
SegmentedVector<RegisterID, 32> m_parameters;
SegmentedVector<Label, 32> m_labels;
LabelScopeStore m_labelScopes;
- int m_finallyDepth { 0 };
+ unsigned m_finallyDepth { 0 };
int m_localScopeDepth { 0 };
const CodeType m_codeType;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes