File tree Expand file tree Collapse file tree
src/jmh/java/org/mozilla/javascript/benchmarks
testsrc/benchmarks/v8-benchmarks-v6 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,31 +178,32 @@ public Object rayTrace(RayTraceState state) {
178178 return state .rt .call (state .cx , state .scope , state .scope , emptyArgs );
179179 }
180180
181- /* TODO not working right now
182181 @ State (Scope .Thread )
183182 public static class RegExpState extends AbstractState {
184- Callable re;
185-
186- @Setup(Level.Trial)
187- public void setUp() {
188- initialize();
189- evaluateSource(cx, scope, "testsrc/benchmarks/v8-benchmarks-v6/regexp.js");
190- runSetup();
191- re = getRunFunc("RegExp");
192- }
193-
194- @TearDown(Level.Trial)
195- public void tearDown() {
196- runCleanup();
197- cleanup();
198- }
183+ Callable re ;
184+
185+ @ Param ({"false" , "true" })
186+ public boolean interpreted ;
187+
188+ @ Setup (Level .Trial )
189+ public void setUp () {
190+ initialize (interpreted );
191+ evaluateSource (cx , scope , "testsrc/benchmarks/v8-benchmarks-v6/regexp.js" );
192+ runSetup ();
193+ re = getRunFunc ("RegExpBench" );
194+ }
195+
196+ @ TearDown (Level .Trial )
197+ public void tearDown () {
198+ runCleanup ();
199+ cleanup ();
200+ }
199201 }
200202
201203 @ Benchmark
202204 public Object regExp (RegExpState state ) {
203- return state.re.call(state.cx, state.scope, state.scope, emptyArgs);
205+ return state .re .call (state .cx , state .scope , state .scope , emptyArgs );
204206 }
205- */
206207
207208 @ State (Scope .Thread )
208209 public static class RichardsState extends AbstractState {
Original file line number Diff line number Diff line change 3737// scrambled to exercise the regexp engine on different input strings.
3838
3939
40- var RegExp = new BenchmarkSuite ( 'RegExp ' , 910985 , [
41- new Benchmark ( "RegExp " , RegExpRun , RegExpSetup , RegExpTearDown )
40+ var RegExpBench = new BenchmarkSuite ( 'RegExpBench ' , 910985 , [
41+ new Benchmark ( "RegExpBench " , RegExpRun , RegExpSetup , RegExpTearDown )
4242] ) ;
4343
4444var regExpBenchmark = null ;
You can’t perform that action at this time.
0 commit comments