Title: [249418] trunk/Source/_javascript_Core
- Revision
- 249418
- Author
- ysuz...@apple.com
- Date
- 2019-09-03 00:26:55 -0700 (Tue, 03 Sep 2019)
Log Message
[JSC] Remove BytecodeGenerator::emitPopScope
https://bugs.webkit.org/show_bug.cgi?id=201395
Reviewed by Saam Barati.
Use emitGetParentScope. And this patch also removes several unnecessary mov bytecode emissions.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::emitPopScope): Deleted.
* bytecompiler/BytecodeGenerator.h:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (249417 => 249418)
--- trunk/Source/_javascript_Core/ChangeLog 2019-09-03 05:59:35 UTC (rev 249417)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-09-03 07:26:55 UTC (rev 249418)
@@ -1,3 +1,19 @@
+2019-09-03 Yusuke Suzuki <ysuz...@apple.com>
+
+ [JSC] Remove BytecodeGenerator::emitPopScope
+ https://bugs.webkit.org/show_bug.cgi?id=201395
+
+ Reviewed by Saam Barati.
+
+ Use emitGetParentScope. And this patch also removes several unnecessary mov bytecode emissions.
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::popLexicalScopeInternal):
+ (JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
+ (JSC::BytecodeGenerator::emitPopWithScope):
+ (JSC::BytecodeGenerator::emitPopScope): Deleted.
+ * bytecompiler/BytecodeGenerator.h:
+
2019-09-01 Yusuke Suzuki <ysuz...@apple.com>
[JSC] Merge op_check_traps into op_enter and op_loop_hint
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (249417 => 249418)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2019-09-03 05:59:35 UTC (rev 249417)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2019-09-03 07:26:55 UTC (rev 249418)
@@ -2219,7 +2219,7 @@
if (hasCapturedVariables) {
RELEASE_ASSERT(stackEntry.m_scope);
- emitPopScope(scopeRegister(), stackEntry.m_scope);
+ emitGetParentScope(scopeRegister(), stackEntry.m_scope);
popLocalControlFlowScope();
stackEntry.m_scope->deref();
}
@@ -2277,8 +2277,7 @@
// as the previous scope because the loop body is compiled under
// the assumption that the scope's register index is constant even
// though the value in that register will change on each loop iteration.
- RefPtr<RegisterID> parentScope = emitGetParentScope(newTemporary(), loopScope);
- move(scopeRegister(), parentScope.get());
+ emitGetParentScope(scopeRegister(), loopScope);
OpCreateLexicalEnvironment::emit(this, loopScope, scopeRegister(), loopSymbolTable, addConstantValue(jsTDZValue()));
@@ -3511,15 +3510,9 @@
return dst;
}
-void BytecodeGenerator::emitPopScope(RegisterID* dst, RegisterID* scope)
-{
- RefPtr<RegisterID> parentScope = emitGetParentScope(newTemporary(), scope);
- move(dst, parentScope.get());
-}
-
void BytecodeGenerator::emitPopWithScope()
{
- emitPopScope(scopeRegister(), scopeRegister());
+ emitGetParentScope(scopeRegister(), scopeRegister());
popLocalControlFlowScope();
auto stackEntry = m_lexicalScopeStack.takeLast();
stackEntry.m_scope->deref();
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h (249417 => 249418)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2019-09-03 05:59:35 UTC (rev 249417)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2019-09-03 07:26:55 UTC (rev 249418)
@@ -1018,7 +1018,6 @@
template<typename LookUpVarKindFunctor>
bool instantiateLexicalVariables(const VariableEnvironment&, SymbolTable*, ScopeRegisterType, LookUpVarKindFunctor);
void emitPrefillStackTDZVariables(const VariableEnvironment&, SymbolTable*);
- void emitPopScope(RegisterID* dst, RegisterID* scope);
RegisterID* emitGetParentScope(RegisterID* dst, RegisterID* scope);
void emitPushFunctionNameScope(const Identifier& property, RegisterID* value, bool isCaptured);
void emitNewFunctionExpressionCommon(RegisterID*, FunctionMetadataNode*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes