Bug 175581

Summary: Add Offline Assembler parsing test to RexBench
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, rniwa, sbarati, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch sbarati: review+

Description Michael Saboff 2017-08-15 10:24:41 PDT
The JavaScriptCore offline assembler makes heavy use of regular expressions when parsing.  This would be a good test for RexBench.
Comment 1 Radar WebKit Bug Importer 2017-08-15 10:25:29 PDT
<rdar://problem/33898475>
Comment 2 Michael Saboff 2017-08-15 10:49:32 PDT
Created attachment 318138 [details]
Patch
Comment 3 Build Bot 2017-08-15 10:51:58 PDT
Attachment 318138 [details] did not pass style-queue:


ERROR: PerformanceTests/RexBench/OfflineAssembler/convert_asm_to_js.py:48:  multiple statements on one line (semicolon)  [pep8/E702] [5]
ERROR: PerformanceTests/RexBench/OfflineAssembler/convert_asm_to_js.py:59:  no spaces around keyword / parameter equals  [pep8/E251] [5]
ERROR: PerformanceTests/RexBench/OfflineAssembler/convert_asm_to_js.py:60:  no spaces around keyword / parameter equals  [pep8/E251] [5]
Total errors found: 3 in 23 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Saam Barati 2017-08-15 12:14:56 PDT
Comment on attachment 318138 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=318138&action=review

r=me

> PerformanceTests/ChangeLog:16
> +        The input data is the current tip of tree LLInt .asm source files.  Those file
> +        were converted to JavaScript using the python script, convert_asm_to_js.py.
> +        There is also a new JavaScript file, generate_expected.js, to create the
> +        expected output JavaScript file.

How much faster is this than the ruby version?

> PerformanceTests/RexBench/offline_assembler_benchmark.js:44
> +var results = [];
> +var benchmark = new OfflineAssemblerBenchmark();
> +var numIterations = 20;

I vote for `let` here

> PerformanceTests/RexBench/OfflineAssembler/parser.js:27
> +

It would be cool if you extended it to allow for unicode in some way (maybe in the future)
Comment 5 Michael Saboff 2017-08-15 12:46:33 PDT
(In reply to Saam Barati from comment #4)
> Comment on attachment 318138 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=318138&action=review
> 
> r=me
> 
> > PerformanceTests/ChangeLog:16
> > +        The input data is the current tip of tree LLInt .asm source files.  Those file
> > +        were converted to JavaScript using the python script, convert_asm_to_js.py.
> > +        There is also a new JavaScript file, generate_expected.js, to create the
> > +        expected output JavaScript file.
> 
> How much faster is this than the ruby version?

I didn't measure.

> > PerformanceTests/RexBench/offline_assembler_benchmark.js:44
> > +var results = [];
> > +var benchmark = new OfflineAssemblerBenchmark();
> > +var numIterations = 20;
> 
> I vote for `let` here

That is the style for all the other tests and also the form used in ARES-6.

> > PerformanceTests/RexBench/OfflineAssembler/parser.js:27
> > +
> 
> It would be cool if you extended it to allow for unicode in some way (maybe
> in the future)

I'm planning on writing one more subtest focused on just Unicode.
Comment 6 Michael Saboff 2017-08-15 13:12:00 PDT
Committed r220752: <http://trac.webkit.org/changeset/220752>