[Webkit-unassigned] [Bug 122627] DFG: Add JIT support for LogicalNot(String/StringIdent)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 11 13:34:26 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=122627





--- Comment #10 from Filip Pizlo <fpizlo at apple.com>  2013-10-11 13:33:15 PST ---
(From update of attachment 214019)
View in context: https://bugs.webkit.org/attachment.cgi?id=214019&action=review

> LayoutTests/js/script-tests/test_not_string.js:15
> +
> +function foo(text) {
> +  return !!text
> +}
> +
> +var sum = 0;
> +var str = ""
> +for (var i=0; i < 1000000; i++) {
> +  sum += foo(str)
> +
> +  if (sum < 10)
> +    str += "a"
> +}
> +
> +shouldBe("sum", "999999");

- Tests for the DFG are usually called "dfg-<blah>.js"

- We usually use "-" as a word separator in test names.

- This test appears to rely on 1000000 being enough runs to trigger the DFG.  That's actually probably good enough, but you could make the test more robust by using the dfgShouldBe function:

dfgShouldBe(foo, "foo(\"\")", "true");
dfgShouldBe(foo, "foo(\"blah\")", "false");

You can alternatively do this sort of manually, like:

noInline(foo);
while (!dfgCompiled({f:foo}))
    foo( .... some arguments to warm it up ...);

shouldBe("foo(...   // your actual tests here

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list