Diff
Modified: trunk/LayoutTests/ChangeLog (249764 => 249765)
--- trunk/LayoutTests/ChangeLog 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/ChangeLog 2019-09-11 16:01:33 UTC (rev 249765)
@@ -1,3 +1,16 @@
+2019-09-11 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, rolling out r249758.
+
+ Breaks the watchOS build.
+
+ Reverted changeset:
+
+ "[WHLSL] Ensure structs/arrays with pointers as fields are
+ disallowed"
+ https://bugs.webkit.org/show_bug.cgi?id=201525
+ https://trac.webkit.org/changeset/249758
+
2019-09-11 Chris Dumez <cdu...@apple.com>
Unreviewed, re-skip service worker test that was unskipped in r249716
Modified: trunk/LayoutTests/webgpu/whlsl/array-spec-tests.html (249764 => 249765)
--- trunk/LayoutTests/webgpu/whlsl/array-spec-tests.html 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/webgpu/whlsl/array-spec-tests.html 2019-09-11 16:01:33 UTC (rev 249765)
@@ -29,7 +29,7 @@
return result;
}
`;
- await checkFail(program);
+ assert_equals(await callIntFunction(program, "foo", []), 76 + 39 + 83);
}
whlslTests.assignLength = async () => {
Deleted: trunk/LayoutTests/webgpu/whlsl/ensure-proper-pointer-usage-expected.txt (249764 => 249765)
--- trunk/LayoutTests/webgpu/whlsl/ensure-proper-pointer-usage-expected.txt 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/webgpu/whlsl/ensure-proper-pointer-usage-expected.txt 2019-09-11 16:01:33 UTC (rev 249765)
@@ -1,3 +0,0 @@
-
-PASS noPointersInStructOrArray
-
Deleted: trunk/LayoutTests/webgpu/whlsl/ensure-proper-pointer-usage.html (249764 => 249765)
--- trunk/LayoutTests/webgpu/whlsl/ensure-proper-pointer-usage.html 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/webgpu/whlsl/ensure-proper-pointer-usage.html 2019-09-11 16:01:33 UTC (rev 249765)
@@ -1,111 +0,0 @@
-<!DOCTYPE html>
-<html>
-<meta charset=utf-8>
-<meta name="timeout" content="long">
-<title>correct pointer usage.</title>
-<script src=""
-<script src=""
-<script src=""
-<script src=""
-<script>
-const whlslTests = {};
-
-whlslTests.noPointersInStructOrArray = async () => {
- await checkFail(`
- struct S { int x; thread int* ptr; }
- void foo() { }
- `);
-
- await checkFail(`
- typedef T = thread int*;
- struct S { int x; T ptr; }
- void foo() { }
- `);
-
- await checkFail(`
- struct S { thread int*[42] arr; }
- void foo() { }
- `);
-
-
- await checkFail(`
- void foo() {
- thread int*[42] arr;
- }
- `);
-
- await checkFail(`
- typedef T = thread int*;
- void foo() {
- T[42] arr;
- }
- `);
-
- await checkFail(`
- typedef T = thread int*[42];
- void foo() { }
- `);
-
- await checkFail(`
- void foo() {
- int x;
- thread int* ptr = &x;
- (&ptr);
- }
- `);
-
- await checkFail(`
- typedef T = thread int*[];
- void foo() { }
- `);
-
- await checkFail(`
- typedef I = int;
- typedef T = thread I*[];
- void foo() { }
- `);
-
- await checkFail(`
- typedef I = thread int*;
- typedef T = thread I[];
- void foo() { }
- `);
-
- await checkFail(`
- typedef I = thread int[];
- typedef T = thread I[];
- void foo() { }
- `);
-
- await checkFail(`
- typedef I = thread int*;
- typedef T = thread I*;
- void foo() { }
- `);
-
- await checkFail(`
- void foo() {
- int x;
- thread int[] arr = @x;
- (@arr);
- }
- `);
-
- await checkFail(`
- void foo() {
- int x;
- thread int[] arr = @x;
- (&arr);
- }
- `);
-
- await checkFail(`
- typedef I = thread int[];
- typedef T = thread I*;
- void foo() { }
- `);
-};
-
-runTests(whlslTests);
-</script>
-</html>
Modified: trunk/LayoutTests/webgpu/whlsl/js/test-harness.js (249764 => 249765)
--- trunk/LayoutTests/webgpu/whlsl/js/test-harness.js 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/webgpu/whlsl/js/test-harness.js 2019-09-11 16:01:33 UTC (rev 249765)
@@ -158,7 +158,6 @@
class Harness {
constructor ()
{
- this._loaded = false;
}
async requestDevice()
@@ -170,8 +169,6 @@
// WebGPU is not supported.
// FIXME: Add support for GPUAdapterRequestOptions and GPUDeviceDescriptor,
// and differentiate between descriptor validation errors and no WebGPU support.
- } finally {
- this._loaded = true;
}
}
@@ -185,9 +182,6 @@
*/
async callTypedFunction(type, functions, name, args)
{
- if (!this._loaded)
- throw new Error("GPU device not loaded.");
-
if (this._device === undefined)
throw new WebGPUUnsupportedError();
@@ -269,11 +263,8 @@
*/
async checkCompileFail(source)
{
- if (!this._loaded)
- throw new Error("GPU device not loaded.");
-
if (this._device === undefined)
- throw new WebGPUUnsupportedError();
+ return;
let entryPointCode = `
[numthreads(1, 1, 1)]
@@ -528,7 +519,6 @@
function runTests(obj) {
window.addEventListener("load", async () => {
- await harness.requestDevice();
try {
for (const name in obj) {
if (!name.startsWith("_"))
Modified: trunk/LayoutTests/webgpu/whlsl/pointer-spec-tests.html (249764 => 249765)
--- trunk/LayoutTests/webgpu/whlsl/pointer-spec-tests.html 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/webgpu/whlsl/pointer-spec-tests.html 2019-09-11 16:01:33 UTC (rev 249765)
@@ -29,8 +29,8 @@
result += x;
return result;
}
- `;
- await checkFail(program);
+ `;;
+ assert_equals(await callIntFunction(program, "foo", []), 76 + 39 + 83);
}
whlslTests.pointerToMember = async () =>
Modified: trunk/LayoutTests/webgpu/whlsl/test-harness-test.html (249764 => 249765)
--- trunk/LayoutTests/webgpu/whlsl/test-harness-test.html 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/LayoutTests/webgpu/whlsl/test-harness-test.html 2019-09-11 16:01:33 UTC (rev 249765)
@@ -186,9 +186,8 @@
}, "Successfully compiling code in checkFail is an error.")
};
-window.addEventListener("load", async () => {
+window.addEventListener("load", () => {
try {
- await harness.requestDevice();
for (const name in whlslTests) {
if (!name.startsWith("_"))
whlslTests[name]();
Modified: trunk/Source/WebCore/ChangeLog (249764 => 249765)
--- trunk/Source/WebCore/ChangeLog 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/ChangeLog 2019-09-11 16:01:33 UTC (rev 249765)
@@ -1,3 +1,16 @@
+2019-09-11 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, rolling out r249758.
+
+ Breaks the watchOS build.
+
+ Reverted changeset:
+
+ "[WHLSL] Ensure structs/arrays with pointers as fields are
+ disallowed"
+ https://bugs.webkit.org/show_bug.cgi?id=201525
+ https://trac.webkit.org/changeset/249758
+
2019-09-11 Ali Juma <aj...@chromium.org>
Prevent reentrancy FrameLoader::dispatchUnloadEvents()
Deleted: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp (249764 => 249765)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp 2019-09-11 16:01:33 UTC (rev 249765)
@@ -1,98 +0,0 @@
-/*
- * 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 "WHLSLCheckReferenceTypes.h"
-
-#if ENABLE(WEBGPU)
-
-#include "WHLSLAST.h"
-#include "WHLSLVisitor.h"
-
-namespace WebCore {
-
-namespace WHLSL {
-
-class ReferenceTypeChecker final : public Visitor {
-public:
- ReferenceTypeChecker() = default;
- virtual ~ReferenceTypeChecker() = default;
-
-private:
- ALWAYS_INLINE void checkType(AST::UnnamedType& type, CodeLocation codeLocation, const char* error)
- {
- auto& unifiedType = type.unifyNode();
- if (is<AST::ReferenceType>(unifiedType)) {
- setError(Error(error, codeLocation));
- return;
- }
-
- if (is<AST::UnnamedType>(unifiedType))
- checkErrorAndVisit(downcast<AST::UnnamedType>(unifiedType));
- }
-
- void visit(AST::ReferenceType& referenceType) override
- {
- checkType(referenceType.elementType(), referenceType.codeLocation(), "reference type cannot have another reference type as an inner type");
- }
-
- void visit(AST::ArrayType& arrayType) override
- {
- checkType(arrayType.type(), arrayType.codeLocation(), "array type cannot have a reference type as its inner type");
- }
-
- void visit(AST::StructureElement& structureElement) override
- {
- checkType(structureElement.type(), structureElement.codeLocation(), "cannot have a structure field which is a reference type");
- }
-
- void visit(AST::_expression_& _expression_) override
- {
- Visitor::visit(_expression_);
- checkErrorAndVisit(_expression_.resolvedType());
- }
-};
-
-Expected<void, Error> checkReferenceTypes(Program& program)
-{
- // This pass does these things:
- // 1. Disallow structs to have fields which are references. This prevents us from having to
- // figure out how to default initialize such a struct. We could relax this in the future if we
- // did an analysis on which structs contain reference fields, and ensure such struct variables
- // always have initializers. This would also require us to create constructors for structs which
- // initialize each field.
- // 2. We also do the same for arrays.
- // 3. References can only be one level deep. So no pointers to pointers. No references to
- // references, etc. This is to support logical mode.
- ReferenceTypeChecker referenceTypeChecker;
- referenceTypeChecker.checkErrorAndVisit(program);
- return referenceTypeChecker.result();
-}
-
-} // namespace WHLSL
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGPU)
Deleted: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h (249764 => 249765)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h 2019-09-11 16:01:33 UTC (rev 249765)
@@ -1,45 +0,0 @@
-/*
- * 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)
-
-#include "WHLSLError.h"
-#include <wtf/Expected.h>
-
-namespace WebCore {
-
-namespace WHLSL {
-
-class Program;
-
-Expected<void, Error> checkReferenceTypes(Program&);
-
-}
-
-}
-
-#endif
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp (249764 => 249765)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp 2019-09-11 16:01:33 UTC (rev 249765)
@@ -936,6 +936,7 @@
auto& unnamedType = downcast<AST::UnnamedType>(unifyNode);
if (is<AST::PointerType>(unnamedType)) {
auto& pointerType = downcast<AST::PointerType>(unnamedType);
+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=198163 Save the fact that we're not targetting the item; we're targetting the item's inner element.
assignConcreteType(makeArrayReferenceExpression, AST::ArrayReferenceType::create(makeArrayReferenceExpression.codeLocation(), pointerType.addressSpace(), pointerType.elementType()));
return;
}
Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.cpp (249764 => 249765)
--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.cpp 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPrepare.cpp 2019-09-11 16:01:33 UTC (rev 249765)
@@ -31,7 +31,6 @@
#include "WHLSLASTDumper.h"
#include "WHLSLCheckDuplicateFunctions.h"
#include "WHLSLCheckTextureReferences.h"
-#include "WHLSLCheckReferenceTypes.h"
#include "WHLSLChecker.h"
#include "WHLSLComputeDimensions.h"
#include "WHLSLFunctionStageChecker.h"
@@ -232,7 +231,6 @@
RUN_PASS(checkLiteralTypes, program);
CHECK_PASS(checkTextureReferences, program);
- CHECK_PASS(checkReferenceTypes, program);
RUN_PASS(resolveProperties, program);
RUN_PASS(findHighZombies, program);
CHECK_PASS(checkStatementBehavior, program);
Modified: trunk/Source/WebCore/Sources.txt (249764 => 249765)
--- trunk/Source/WebCore/Sources.txt 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/Sources.txt 2019-09-11 16:01:33 UTC (rev 249765)
@@ -313,7 +313,6 @@
Modules/webgpu/WHLSL/WHLSLParser.cpp
Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp
Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp
-Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp
Modules/webgpu/WHLSL/WHLSLChecker.cpp
Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp
Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (249764 => 249765)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-09-11 15:41:44 UTC (rev 249764)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-09-11 16:01:33 UTC (rev 249765)
@@ -8331,8 +8331,6 @@
522DA3D3229E1D390042D151 /* WHLSLGlobalVariableReference.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLGlobalVariableReference.h; sourceTree = "<group>"; };
522E1A172297D6D400E5D36A /* WHLSLPreserveVariableLifetimes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLPreserveVariableLifetimes.cpp; sourceTree = "<group>"; };
522E1A192297D6D400E5D36A /* WHLSLPreserveVariableLifetimes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLPreserveVariableLifetimes.h; sourceTree = "<group>"; };
- 524BD47E23277E15008F56C1 /* WHLSLCheckReferenceTypes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLCheckReferenceTypes.cpp; sourceTree = "<group>"; };
- 524BD48023277E16008F56C1 /* WHLSLCheckReferenceTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLCheckReferenceTypes.h; sourceTree = "<group>"; };
526724F11CB2FDF60075974D /* TextTrackRepresentationCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextTrackRepresentationCocoa.mm; sourceTree = "<group>"; };
526724F21CB2FDF60075974D /* TextTrackRepresentationCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentationCocoa.h; sourceTree = "<group>"; };
526B3F0122FB7BDD0076D37D /* WHLSLPruneUnreachableStandardLibraryFunctions.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLPruneUnreachableStandardLibraryFunctions.cpp; sourceTree = "<group>"; };
@@ -25581,8 +25579,6 @@
1C840B9721EC400700D0500D /* WHLSLChecker.h */,
1C281C6D22B87B9800691C00 /* WHLSLCheckTextureReferences.cpp */,
1C281C6E22B87B9800691C00 /* WHLSLCheckTextureReferences.h */,
- 524BD47E23277E15008F56C1 /* WHLSLCheckReferenceTypes.cpp */,
- 524BD48023277E16008F56C1 /* WHLSLCheckReferenceTypes.h */,
522BAB9622E6A36200C54CE9 /* WHLSLCodeLocation.h */,
1C86CA4B22AA19FF001BF961 /* WHLSLComputeDimensions.cpp */,
1C86CA4C22AA19FF001BF961 /* WHLSLComputeDimensions.h */,