[Webkit-unassigned] [Bug 145638] ES6 Arrow function. Write tests for the controlFlowProfiler

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 8 13:14:28 PDT 2015


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

Saam Barati <saambarati1 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |saambarati1 at gmail.com

--- Comment #2 from Saam Barati <saambarati1 at gmail.com> ---
This looks good to me. You should also have a test that
tests the assumption for range of the entire function itself.
The way this works for functions now is that the entire
function executing offset will begin from the "function"
key word and will end with the closing "}" of the function.
We do this by passing in different parts of the function that
represent the textual boundary of the function.

We should match this style with arrow function syntax so the beginning
should be the "(" in the parameter list, or the beginning letter
of the parameter in the single parameter case. For example, I'd make tests
like this:

```
function foo1(test) {
   var f1 = () => { "hello"; }
   if (test)
       f1();
}
foo1(false);
checkBasicBlock(foo1, '() =>', ShouldNotHaveExecuted);
checkBasicBlock(foo1, '; }', ShouldNotHaveExecuted);
foo1(true);
checkBasicBlock(foo1, '() =>', ShouldHaveExecuted);
checkBasicBlock(foo1, '; }', ShouldHaveExecuted);
// etc, maybe different offsets, too.

function foo2(test) {
   var f1 = (xyz) => { "hello" }
   if (test)
       f1();
}
foo1(false);
checkBasicBlock(foo1, '(xyz) =>', ShouldNotHaveExecuted);
checkBasicBlock(foo1, '; }', ShouldNotHaveExecuted);
foo1(true);
checkBasicBlock(foo1, '(xyz) =>', ShouldHaveExecuted);
checkBasicBlock(foo1, '; }', ShouldHaveExecuted);
// etc, maybe other tests with single parameter syntax, etc.

``` 

(Actually, looking through the tests for the control flow profiler, it doesn't look like there are other
tests that check function boundaries for regular functions. I should open a bug for that).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150608/efbd1b9c/attachment.html>


More information about the webkit-unassigned mailing list