[WHLSL] Pointers should have automatically-generated equality checks
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2018 00:48:34 +0000 (00:48 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2018 00:48:34 +0000 (00:48 +0000)
commit0b264b8bc7454bfe606c6d136fd9dbbf545a63df
treee26ecc2fd779705ab1dd736cb48a84b18287766b
parent22a43c270bbe205a18859001ce1d2629acbd1b04
[WHLSL] Pointers should have automatically-generated equality checks
https://bugs.webkit.org/show_bug.cgi?id=189986

Reviewed by Filip Pizlo.

C allows for pointer equality, and we need it so people can do null checks.
This is generated the same way all our other NativeFuncs are generated - by Checker
creating NativeFuncs inside CallExpression.resolve().

This patch also does some general cleanup.

* WebGPUShadingLanguageRI/All.js: Everything the late checker does is no longer necessary.
The last thing it was doing was making sure that only primitive types are in resources, but
it's totally reasonable to put structs and arrays in resources, so I removed this pass. We
still have to add a check to make sure resources can't live within resources, but I expect
that will be done in the same place that semantics are checked.
* WebGPUShadingLanguageRI/AllocateAtEntryPoints.js:
(allocateAtEntryPoints.updateFunction.UpdateFunctions.prototype._addVariableDeclaration):
Name the global struct for debugging purposes.
* WebGPUShadingLanguageRI/CallExpression.js:
(CallExpression.prototype._resolveByInstantiation): Cleanup
(CallExpression.prototype._resolveWithOperatorAnderIndexer): Ditto
(CallExpression.prototype._resolveWithOperatorLength): Ditto
(CallExpression.prototype._resolveWithReferenceComparator): Add support to automatically
generate pointer equality NativeFuncs.
* WebGPUShadingLanguageRI/EPtr.js: Implement pointer equality in the interpreter.
* WebGPUShadingLanguageRI/LateChecker.js: Removed.
* WebGPUShadingLanguageRI/LayoutBuffers.js: Renamed from Tools/WebGPUShadingLanguageRI/LateCheckAndLayoutBuffers.js.
(layoutBuffers):
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL Tests.xcodeproj/project.pbxproj:
* WebGPUShadingLanguageRI/NativeFunc.js:
* WebGPUShadingLanguageRI/OperatorArrayRefLength.js:
(OperatorArrayRefLength.prototype.instantiateImplementation):
(OperatorArrayRefLength):
* WebGPUShadingLanguageRI/Prepare.js:
(let.prepare):
* WebGPUShadingLanguageRI/SPIRV.html:
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(tests.ternaryExpression):
(tests.break): Speed up testing time
(tests.doWhile): Ditto
(tests.forLoop): Ditto
(tests.atomics): Ditto
(tests.atomicsNull): Ditto
(tests.pointerEquality): Test pointer equality
(tests.standardLibraryDevicePointers):
(tests.devicePtrPtr): Deleted.
(tests.threadgroupPtrPtr): Deleted.
(tests.constantPtrPtr): Deleted.
* WebGPUShadingLanguageRI/index.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236628 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/All.js
Tools/WebGPUShadingLanguageRI/AllocateAtEntryPoints.js
Tools/WebGPUShadingLanguageRI/CallExpression.js
Tools/WebGPUShadingLanguageRI/EArrayRef.js
Tools/WebGPUShadingLanguageRI/EPtr.js
Tools/WebGPUShadingLanguageRI/LateChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/LayoutBuffers.js [moved from Tools/WebGPUShadingLanguageRI/LateCheckAndLayoutBuffers.js with 94% similarity]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL Tests.xcodeproj/project.pbxproj
Tools/WebGPUShadingLanguageRI/NativeFunc.js
Tools/WebGPUShadingLanguageRI/OperatorArrayRefLength.js
Tools/WebGPUShadingLanguageRI/Prepare.js
Tools/WebGPUShadingLanguageRI/SPIRV.html
Tools/WebGPUShadingLanguageRI/Test.html
Tools/WebGPUShadingLanguageRI/Test.js
Tools/WebGPUShadingLanguageRI/index.html