WebKit Bugzilla
Attachment 359218 Details for
Bug 193432
: [WHLSL] Add the high zombie finder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193432-20190115161646.patch (text/plain), 8.98 KB, created by
Myles C. Maxfield
on 2019-01-15 16:16:47 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2019-01-15 16:16:47 PST
Size:
8.98 KB
patch
obsolete
>Subversion Revision: 240016 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0386473d019f2fe7e86ca6c1e16c904e726dc51a..79e89d17bcbf7e66ac4198b3544da1d7390eef7f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-15 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [WHLSL] Add the high zombie finder >+ https://bugs.webkit.org/show_bug.cgi?id=193432 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++. >+ >+ No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort >+ of test. When enough of the compiler is present, I'll port the reference implementation's test suite. >+ >+ * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added. >+ (WebCore::WHLSL::findHighZombies): >+ * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added. >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ > 2019-01-15 Chris Dumez <cdumez@apple.com> > > Unreviewed, rolling out r239993, r239995, r239997, and >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..8cf69fc5c18fb95ca9555a89f1b982eec15cfdf8 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp >@@ -0,0 +1,76 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * 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. AND ITS CONTRIBUTORS ``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 ITS 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 "WHLSLHighZombieFinder.h" >+ >+#if ENABLE(WEBGPU) >+ >+#include "WHLSLVisitor.h" >+ >+namespace WebCore { >+ >+namespace WHLSL { >+ >+#if !ASSERT_DISABLED >+// If a high-level construct somehow manages to live on when we're lowered, it's a high zombie. >+class HighZombieFinder : public Visitor { >+public: >+ HighZombieFinder() = default; >+ >+ virtual ~HighZombieFinder() = default; >+ >+private: >+ void visit(AST::DotExpression&) override >+ { >+ ASSERT_NOT_REACHED(); >+ } >+ >+ void visit(AST::IndexExpression&) override >+ { >+ ASSERT_NOT_REACHED(); >+ } >+ >+ void visit(AST::ReadModifyWriteExpression&) override >+ { >+ ASSERT_NOT_REACHED(); >+ } >+}; >+#endif >+ >+void findHighZombies(Program& program) >+{ >+#if ASSERT_DISABLED >+ UNUSED_PARAM(program); >+#else >+ HighZombieFinder().Visitor::visit(program); >+#endif >+} >+ >+} >+ >+} >+ >+#endif >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h >new file mode 100644 >index 0000000000000000000000000000000000000000..6a439143afe8dff3f190acc49841826ad33cfa20 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h >@@ -0,0 +1,42 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * 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. AND ITS CONTRIBUTORS ``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 ITS 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(WEBGPU) >+ >+namespace WebCore { >+ >+namespace WHLSL { >+ >+class Program; >+ >+void findHighZombies(Program&); >+ >+} >+ >+} >+ >+#endif >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp >index d822f075a13df7f0ca3290168eba59b44182fc07..e3201d25949e0babcfee5d88aa2b2b14f80d634a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp >@@ -28,6 +28,9 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLStructureDefinition.h" >+#include "WHLSLTypeDefinition.h" >+#include "WHLSLTypeReference.h" > #include "WHLSLVisitor.h" > #include <wtf/HashSet.h> > >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 03a45de790af6593d4677b83edf8679081abe33c..287bdf329db38e8573f6f632f85471fcb9266d44 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -322,6 +322,7 @@ Modules/webgpu/WHLSL/WHLSLNameContext.cpp > Modules/webgpu/WHLSL/WHLSLNameResolver.cpp > Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp > Modules/webgpu/WHLSL/WHLSLVisitor.cpp >+Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp > Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp > Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp > Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index e16ab9df46a81d67d1f4b7cf812e051cdec0f8bb..8293803f64004ef36ff7f30ddbcad6d9ab298f27 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -6427,6 +6427,8 @@ > 1C840B9A21EC400900D0500D /* WHLSLGatherEntryPointItems.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLGatherEntryPointItems.h; sourceTree = "<group>"; }; > 1C840B9B21EC400900D0500D /* WHLSLChecker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLChecker.cpp; sourceTree = "<group>"; }; > 1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; >+ 1C9AE5CA21ED9DF50069D5F2 /* WHLSLHighZombieFinder.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLHighZombieFinder.cpp; sourceTree = "<group>"; }; >+ 1C9AE5CB21ED9DF50069D5F2 /* WHLSLHighZombieFinder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLHighZombieFinder.h; sourceTree = "<group>"; }; > 1CA19E030DC255950065A994 /* EventLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventLoopMac.mm; sourceTree = "<group>"; }; > 1CA19E150DC255CA0065A994 /* EventLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoop.h; sourceTree = "<group>"; }; > 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObject.h; sourceTree = "<group>"; }; >@@ -25454,6 +25456,8 @@ > 1C840B9721EC400700D0500D /* WHLSLChecker.h */, > 1C840B9921EC400800D0500D /* WHLSLGatherEntryPointItems.cpp */, > 1C840B9A21EC400900D0500D /* WHLSLGatherEntryPointItems.h */, >+ 1C9AE5CA21ED9DF50069D5F2 /* WHLSLHighZombieFinder.cpp */, >+ 1C9AE5CB21ED9DF50069D5F2 /* WHLSLHighZombieFinder.h */, > C234A99A21E90F56003C984D /* WHLSLInferTypes.cpp */, > C234A99B21E90F57003C984D /* WHLSLInferTypes.h */, > C234A9B721E92CC1003C984D /* WHLSLIntrinsics.cpp */,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193432
:
359130
|
359218
|
359247
|
359255