diff options
Diffstat (limited to 'deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_function_calls.js')
-rw-r--r-- | deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_function_calls.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_function_calls.js b/deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_function_calls.js index 292c1c0c7e..70b6038dd6 100644 --- a/deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_function_calls.js +++ b/deps/v8/tools/clusterfuzz/js_fuzzer/test/test_mutate_function_calls.js @@ -36,14 +36,15 @@ describe('Mutate functions', () => { }); it('is robust without available functions', () => { - sandbox.stub(random, 'random').callsFake(() => { return 0.3; }); + sandbox.stub(random, 'random').callsFake(() => { return 0.2; }); // We just ensure here that mutating this file doesn't throw. loadAndMutate('mutate_function_call.js'); }); - it('optimizes functions in V8', () => { + it('optimizes functions with turbofan in V8', () => { sandbox.stub(random, 'random').callsFake(() => { return 0.5; }); + sandbox.stub(random, 'choose').callsFake(p => true); const source = loadAndMutate('mutate_function_call.js'); const mutated = sourceHelpers.generateCode(source); @@ -51,6 +52,18 @@ describe('Mutate functions', () => { 'mutate_function_call_expected.js', mutated); }); + it('optimizes functions with maglev in V8', () => { + sandbox.stub(random, 'random').callsFake(() => { return 0.5; }); + // False-path takes 'Maglev'. Other calls to choose should return + // true. It's also used to determine if a mutator should be chosen. + sandbox.stub(random, 'choose').callsFake(p => p == 0.7 ? false : true); + + const source = loadAndMutate('mutate_function_call.js'); + const mutated = sourceHelpers.generateCode(source); + helpers.assertExpectedResult( + 'mutate_function_call_maglev_expected.js', mutated); + }); + it('compiles functions in V8 to baseline', () => { sandbox.stub(random, 'random').callsFake(() => { return 0.7; }); |