Title: [239898] trunk/Source/_javascript_Core
Revision
239898
Author
[email protected]
Date
2019-01-12 01:49:17 -0800 (Sat, 12 Jan 2019)

Log Message

Unreviewed, fix scope check assertions
https://bugs.webkit.org/show_bug.cgi?id=193308

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::notifyLexicalBindingShadowing):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::notifyLexicalBindingShadowing):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (239897 => 239898)


--- trunk/Source/_javascript_Core/ChangeLog	2019-01-12 07:42:11 UTC (rev 239897)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-01-12 09:49:17 UTC (rev 239898)
@@ -1,3 +1,15 @@
+2019-01-12  Yusuke Suzuki  <[email protected]>
+
+        Unreviewed, fix scope check assertions
+        https://bugs.webkit.org/show_bug.cgi?id=193308
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::notifyLexicalBindingShadowing):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::notifyLexicalBindingShadowing):
+        * runtime/ProgramExecutable.cpp:
+        (JSC::ProgramExecutable::initializeGlobalProperties):
+
 2019-01-11  John Wilander  <[email protected]>
 
         Compile out Web API Statistics Collection

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (239897 => 239898)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2019-01-12 07:42:11 UTC (rev 239897)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2019-01-12 09:49:17 UTC (rev 239898)
@@ -2676,7 +2676,7 @@
         return;
     JSGlobalObject* globalObject = m_globalObject.get();
 
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
 
     ConcurrentJSLocker locker(m_lock);
 
@@ -2693,7 +2693,7 @@
                     // We pass JSGlobalLexicalScope as a start point of the scope chain.
                     // It should immediately find the lexical binding because that's the reason why we perform this rewriting now.
                     ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), bytecode.localScopeDepth, globalObject->globalScope(), ident, Get, bytecode.resolveType, InitializationMode::NotInitialization);
-                    EXCEPTION_ASSERT_UNUSED(throwScope, !throwScope.exception());
+                    scope.releaseAssertNoException();
                     ASSERT(op.type == GlobalLexicalVarWithVarInjectionChecks || op.type == GlobalLexicalVar);
                     metadata.resolveType = needsVarInjectionChecks(originalResolveType) ? GlobalLexicalVarWithVarInjectionChecks : GlobalLexicalVar;
                     metadata.localScopeDepth = 0;
@@ -2717,7 +2717,7 @@
                     // We pass JSGlobalLexicalScope as a start point of the scope chain.
                     // It should immediately find the lexical binding because that's the reason why we perform this rewriting now.
                     ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), bytecode.localScopeDepth, globalObject->globalScope(), ident, Get, bytecode.getPutInfo.resolveType(), InitializationMode::NotInitialization);
-                    EXCEPTION_ASSERT_UNUSED(throwScope, !throwScope.exception());
+                    scope.releaseAssertNoException();
                     ASSERT(op.type == GlobalLexicalVarWithVarInjectionChecks || op.type == GlobalLexicalVar);
                     metadata.getPutInfo = GetPutInfo(bytecode.getPutInfo.resolveMode(), needsVarInjectionChecks(originalResolveType) ? GlobalLexicalVarWithVarInjectionChecks : GlobalLexicalVar, bytecode.getPutInfo.initializationMode());
                     metadata.watchpointSet = op.watchpointSet;
@@ -2738,7 +2738,7 @@
                     // We pass JSGlobalLexicalScope as a start point of the scope chain.
                     // It should immediately find the lexical binding because that's the reason why we perform this rewriting now.
                     ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), bytecode.symbolTableOrScopeDepth, globalObject->globalScope(), ident, Put, bytecode.getPutInfo.resolveType(), bytecode.getPutInfo.initializationMode());
-                    EXCEPTION_ASSERT_UNUSED(throwScope, !throwScope.exception());
+                    scope.releaseAssertNoException();
                     ASSERT(op.type == GlobalLexicalVarWithVarInjectionChecks || op.type == GlobalLexicalVar || op.type == Dynamic);
 
                     ResolveType resolveType = op.type;

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (239897 => 239898)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2019-01-12 07:42:11 UTC (rev 239897)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2019-01-12 09:49:17 UTC (rev 239898)
@@ -1853,6 +1853,7 @@
 
 void JSGlobalObject::notifyLexicalBindingShadowing(VM& vm, const IdentifierSet& set)
 {
+    auto scope = DECLARE_THROW_SCOPE(vm);
 #if ENABLE(DFG_JIT)
     for (const auto& key : set)
         ensureReferencedPropertyWatchpointSet(key.get()).fireAll(vm, "Lexical binding shadows the existing global properties");
@@ -1861,7 +1862,9 @@
         if (codeBlock->globalObject() != this)
             return;
         codeBlock->notifyLexicalBindingShadowing(vm, set);
+        scope.assertNoException();
     });
+    scope.release();
 }
 
 void JSGlobalObject::queueMicrotask(Ref<Microtask>&& task)

Modified: trunk/Source/_javascript_Core/runtime/ProgramExecutable.cpp (239897 => 239898)


--- trunk/Source/_javascript_Core/runtime/ProgramExecutable.cpp	2019-01-12 07:42:11 UTC (rev 239897)
+++ trunk/Source/_javascript_Core/runtime/ProgramExecutable.cpp	2019-01-12 09:49:17 UTC (rev 239898)
@@ -207,8 +207,10 @@
         }
     }
 
-    if (!shadowedProperties.isEmpty())
+    if (!shadowedProperties.isEmpty()) {
         globalObject->notifyLexicalBindingShadowing(vm, WTFMove(shadowedProperties));
+        throwScope.assertNoException();
+    }
 
     return nullptr;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to