Title: [241348] trunk/Source/WebCore
- Revision
- 241348
- Author
- [email protected]
- Date
- 2019-02-12 23:13:07 -0800 (Tue, 12 Feb 2019)
Log Message
Remove unnecessary null check in bindings.
https://bugs.webkit.org/show_bug.cgi?id=194581
Reviewed by Yusuke Suzuki.
It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
It will just return false. Since we don't expect the root pointer to be null in
the common case, having a null check here is also not optimal. We'll remove this
unneeded null check.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (241347 => 241348)
--- trunk/Source/WebCore/ChangeLog 2019-02-13 06:43:02 UTC (rev 241347)
+++ trunk/Source/WebCore/ChangeLog 2019-02-13 07:13:07 UTC (rev 241348)
@@ -1,3 +1,20 @@
+2019-02-12 Mark Lam <[email protected]>
+
+ Remove unnecessary null check in bindings.
+ https://bugs.webkit.org/show_bug.cgi?id=194581
+
+ Reviewed by Yusuke Suzuki.
+
+ It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
+ It will just return false. Since we don't expect the root pointer to be null in
+ the common case, having a null check here is also not optimal. We'll remove this
+ unneeded null check.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
+ (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
+
2019-02-12 Rob Buis <[email protected]>
Align with Fetch on data: URLs
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (241347 => 241348)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2019-02-13 06:43:02 UTC (rev 241347)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2019-02-13 07:13:07 UTC (rev 241348)
@@ -4679,7 +4679,7 @@
}
push(@implContent, $rootString);
- push(@implContent, " return root && visitor.containsOpaqueRoot(root);\n");
+ push(@implContent, " return visitor.containsOpaqueRoot(root);\n");
} else {
if (!$emittedJSCast) {
push(@implContent, " UNUSED_PARAM(handle);\n");
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp (241347 => 241348)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp 2019-02-13 06:43:02 UTC (rev 241347)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp 2019-02-13 07:13:07 UTC (rev 241348)
@@ -204,7 +204,7 @@
TestGenerateIsReachable* root = &jsTestGenerateIsReachable->wrapped();
if (UNLIKELY(reason))
*reason = "Reachable from TestGenerateIsReachable";
- return root && visitor.containsOpaqueRoot(root);
+ return visitor.containsOpaqueRoot(root);
}
void JSTestGenerateIsReachableOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes