Title: [221824] trunk/Tools

Diff

Modified: trunk/Tools/ChangeLog (221823 => 221824)


--- trunk/Tools/ChangeLog	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/ChangeLog	2017-09-09 16:56:53 UTC (rev 221824)
@@ -1,3 +1,16 @@
+2017-09-09  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r221776.
+
+        This change caused wsl-tests.yaml/Test.js to time out on Debug
+        JSC bots.
+
+        Reverted changeset:
+
+        "Add "if" statements to WSL"
+        https://bugs.webkit.org/show_bug.cgi?id=176294
+        http://trac.webkit.org/changeset/221776
+
 2017-09-09  Michael Catanzaro  <[email protected]>
 
         MiniBrowser closes tab instead of window on close signal

Modified: trunk/Tools/WebGPUShadingLanguageRI/All.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/All.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/All.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -65,7 +65,6 @@
 load("FuncInstantiator.js");
 load("FuncParameter.js");
 load("FunctionLikeBlock.js");
-load("IfStatement.js");
 load("Inline.js");
 load("Inliner.js");
 load("InstantiateImmediates.js");

Modified: trunk/Tools/WebGPUShadingLanguageRI/Checker.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Checker.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Checker.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -220,23 +220,11 @@
     {
         let resultType = node.operand.visit(this);
         if (!resultType)
-            throw new Error("Trying to negate something with no type: " + node.operand);
+            throw new Error("Trying to negate something with no type: " + node.value);
         if (!resultType.equals(this._program.intrinsics.bool))
-            throw new WError("Trying to negate something that isn't a bool: " + node.operand);
+            throw new WError("Trying to negate something that isn't a bool: " + node.value);
         return this._program.intrinsics.bool;
     }
-
-    visitIfStatement(node)
-    {
-        let conditionalResultType = node.conditional.visit(this);
-        if (!conditionalResultType)
-            throw new Error("Trying to negate something with no type: " + node.conditional);
-        if (!conditionalResultType.equals(this._program.intrinsics.bool))
-            throw new WError("Trying to negate something that isn't a bool: " + node.conditional);
-        node.body.visit(this);
-        if (node.elseBody)
-            node.elseBody.visit(this);
-    }
     
     visitCommaExpression(node)
     {

Modified: trunk/Tools/WebGPUShadingLanguageRI/Evaluator.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Evaluator.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Evaluator.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -150,14 +150,6 @@
     {
         return EPtr.box(!node.operand.visit(this).loadValue());
     }
-
-    visitIfStatement(node)
-    {
-        if (node.conditional.visit(this).loadValue())
-            return node.body.visit(this);
-        else if (node.elseBody)
-            return node.elseBody.visit(this);
-    }
     
     visitCallExpression(node)
     {

Deleted: trunk/Tools/WebGPUShadingLanguageRI/IfStatement.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/IfStatement.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/IfStatement.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 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. ``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
- * 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. 
- */
-"use strict";
-
-class IfStatement extends Node {
-    constructor(origin, conditional, body, elseBody)
-    {
-        super();
-        this._origin = origin;
-        this._conditional = conditional;
-        this._body = body;
-        this._elseBody = elseBody;
-    }
-
-    get origin() { return this._origin; }
-    get conditional() { return this._conditional; }
-    get body() { return this._body; }
-    get elseBody() { return this._elseBody; }
-
-    toString()
-    {
-        let result = "if (" + this.conditional + ") " + this.body;
-        if (this.elseBody)
-            return result + " else " + this.elseBody;
-        return result;
-    }
-};
-

Modified: trunk/Tools/WebGPUShadingLanguageRI/NameResolver.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/NameResolver.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/NameResolver.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -90,15 +90,6 @@
         for (let statement of node.statements)
             statement.visit(checker);
     }
-
-    visitIfStatement(node)
-    {
-        node.conditional.visit(this);
-        // If statement's bodies might not be Blocks, so we need to explicitly give them a new context.
-        node.body.visit(new NameResolver(new NameContext(this._nameContext)));
-        if (node.elseBody)
-            node.elseBody.visit(new NameResolver(new NameContext(this._nameContext)));
-    }
     
     visitProtocolDecl(node)
     {

Modified: trunk/Tools/WebGPUShadingLanguageRI/Parse.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Parse.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Parse.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -148,7 +148,7 @@
                 let type = parseType();
                 let name = consumeKind("identifier");
                 assertNext(",", ">", ">>");
-                return new ConstexprTypeParameter(type.origin, name.text, type);
+                return new ConstexprTypeParameter(type.origin, name, type);
             });
             if (constexpr)
                 result.push(constexpr);
@@ -535,19 +535,6 @@
         consume(";");
         return new Return(origin, _expression_);
     }
-
-    function parseIfStatement()
-    {
-        let origin = consume("if");
-        consume("(");
-        let conditional = parseExpression();
-        consume(")");
-        let body = parseStatement();
-        let elseBody;
-        if (tryConsume("else"))
-            elseBody = parseStatement();
-        return new IfStatement(origin, new CastExpression(conditional.origin, new TypeRef(conditional.origin, "bool", []), [], [conditional]), body, elseBody);
-    }
     
     function parseVariableDecls()
     {
@@ -580,10 +567,6 @@
             return parseDo();
         if (token.text == "for")
             return parseFor();
-        if (token.text == "if")
-            return parseIfStatement();
-        if (token.text == "{")
-            return parseBlock();
         let variableDecl = lexer.backtrackingScope(parseVariableDecls);
         if (variableDecl)
             return variableDecl;

Modified: trunk/Tools/WebGPUShadingLanguageRI/ReturnChecker.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/ReturnChecker.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/ReturnChecker.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -40,12 +40,8 @@
         // https://bugs.webkit.org/show_bug.cgi?id=176263
         return node.statements.reduce((result, statement) => result || statement.visit(this), false);
     }
-
-    visitIfStatement(node)
-    {
-        return node.elseBody && node.body.visit(this) && node.elseBody.visit(this);
-    }
-
+    
+    // When we add control flow statements, we'll need to return true only if both blocks return true.
     // If a loop returns, then it counts only if the loop is guaranteed to run at least once.
     
     visitReturn(node)

Modified: trunk/Tools/WebGPUShadingLanguageRI/Rewriter.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Rewriter.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Rewriter.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -283,10 +283,5 @@
     {
         return new LogicalNot(node.origin, node.operand.visit(this));
     }
-
-    visitIfStatement(node)
-    {
-        return new IfStatement(node.origin, node.conditional.visit(this), node.body.visit(this), node.elseBody ? node.elseBody.visit(this) : undefined);
-    }
 }
 

Modified: trunk/Tools/WebGPUShadingLanguageRI/Test.html (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Test.html	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Test.html	2017-09-09 16:56:53 UTC (rev 221824)
@@ -41,7 +41,6 @@
 <script src=""
 <script src=""
 <script src=""
-<script src=""
 <script src=""
 <script src=""
 <script src=""

Modified: trunk/Tools/WebGPUShadingLanguageRI/Test.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Test.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Test.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -1109,233 +1109,6 @@
     checkInt(program, callFunction(program, "foo", [], [makeInt(program, 54), makeInt(program, 12), makeInt(program, 39)]), 54 + 12 + 39);
 }
 
-function TEST_variableShadowing()
-{
-    let program = doPrep(`
-        int foo()
-        {
-            int y;
-            int x = 7;
-            {
-                int x = 8;
-                y = x;
-            }
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], []), 8);
-    program = doPrep(`
-        int foo()
-        {
-            int y;
-            int x = 7;
-            {
-                int x = 8;
-            }
-            y = x;
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], []), 7);
-}
-
-function TEST_ifStatement()
-{
-    let program = doPrep(`
-        int foo(int x)
-        {
-            int y = 6;
-            if (x == 7) {
-                y = 8;
-            }
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 3)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 4)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 5)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 6)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 7)]), 8);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 8)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 9)]), 6);
-}
-
-function TEST_ifElseStatement()
-{
-    let program = doPrep(`
-        int foo(int x)
-        {
-            int y = 6;
-            if (x == 7) {
-                y = 8;
-            } else {
-                y = 9;
-            }
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 3)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 4)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 5)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 6)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 7)]), 8);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 8)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 9)]), 9);
-}
-
-function TEST_ifElseIfStatement()
-{
-    let program = doPrep(`
-        int foo(int x)
-        {
-            int y = 6;
-            if (x == 7) {
-                y = 8;
-            } else if (x == 8) {
-                y = 9;
-            }
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 3)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 4)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 5)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 6)]), 6);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 7)]), 8);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 8)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 9)]), 6);
-}
-
-function TEST_ifElseIfElseStatement()
-{
-    let program = doPrep(`
-        int foo(int x)
-        {
-            int y = 6;
-            if (x == 7) {
-                y = 8;
-            } else if (x == 8) {
-                y = 9;
-            } else {
-                y = 10;
-            }
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 3)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 4)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 5)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 6)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 7)]), 8);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 8)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 9)]), 10);
-}
-
-function TEST_returnIf()
-{
-    checkFail(
-        () => doPrep(`
-            int foo(int x)
-            {
-                int y = 6;
-                if (x == 7) {
-                    return y;
-                }
-            }
-        `),
-        (e) => e instanceof WTypeError);
-    checkFail(
-        () => doPrep(`
-            int foo(int x)
-            {
-                int y = 6;
-                if (x == 7) {
-                    return y;
-                } else {
-                    y = 8;
-                }
-            }
-        `),
-        (e) => e instanceof WTypeError);
-    checkFail(
-        () => doPrep(`
-            int foo(int x)
-            {
-                int y = 6;
-                if (x == 7) {
-                    y = 8;
-                } else {
-                    return y;
-                }
-            }
-        `),
-        (e) => e instanceof WTypeError);
-    let program = doPrep(`
-        int foo(int x)
-        {
-            int y = 6;
-            if (x == 7) {
-                return 8;
-            } else {
-                return 10;
-            }
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 3)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 4)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 5)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 6)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 7)]), 8);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 8)]), 10);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 9)]), 10);
-    checkFail(
-        () => doPrep(`
-            int foo(int x)
-            {
-                int y = 6;
-                if (x == 7) {
-                    return 8;
-                } else if (x == 9) {
-                    return 10;
-                }
-            }
-        `),
-        (e) => e instanceof WTypeError);
-    program = doPrep(`
-        int foo(int x)
-        {
-            int y = 6;
-            if (x == 7) {
-                return 8;
-            } else {
-                y = 9;
-            }
-            return y;
-        }
-    `);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 3)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 4)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 5)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 6)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 7)]), 8);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 8)]), 9);
-    checkInt(program, callFunction(program, "foo", [], [makeInt(program, 9)]), 9);
-    checkFail(
-        () => doPrep(`
-            int foo(int x)
-            {
-                int y = 6;
-                if (x == 7) {
-                    return 8;
-                } else {
-                    return 10;
-                }
-                return 11;
-            }
-        `),
-        (e) => e instanceof WTypeError);
-}
-
 function TEST_protocolMonoPolySigDoublePolyDefExplicit()
 {
     checkFail(

Modified: trunk/Tools/WebGPUShadingLanguageRI/TypeDef.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/TypeDef.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/TypeDef.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -38,10 +38,5 @@
     get name() { return this._name; }
     get typeParameters() { return this._typeParameters; }
     get type() { return this._type; }
-    
-    toString()
-    {
-        return "typedef " + this.name + "<" + this.typeParameters + "> = " + this.type;
-    }
 }
 

Modified: trunk/Tools/WebGPUShadingLanguageRI/Visitor.js (221823 => 221824)


--- trunk/Tools/WebGPUShadingLanguageRI/Visitor.js	2017-09-09 16:54:40 UTC (rev 221823)
+++ trunk/Tools/WebGPUShadingLanguageRI/Visitor.js	2017-09-09 16:56:53 UTC (rev 221824)
@@ -208,14 +208,6 @@
             node.variable.visit(this);
     }
     
-    visitIfStatement(node)
-    {
-        node.conditional.visit(this);
-        node.body.visit(this);
-        if (node.elseBody)
-            node.elseBody.visit(this);
-    }
-
     visitReturn(node)
     {
         if (node.value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to