diff options
Diffstat (limited to 'deps/v8/test/js-perf-test/IC')
-rw-r--r-- | deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js | 23 | ||||
-rw-r--r-- | deps/v8/test/js-perf-test/IC/run.js | 24 |
2 files changed, 47 insertions, 0 deletions
diff --git a/deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js b/deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js new file mode 100644 index 0000000000..deb0a81762 --- /dev/null +++ b/deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js @@ -0,0 +1,23 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +new BenchmarkSuite('LoadConstantFromPrototype', [1000], [ + new Benchmark('LoadConstantFromPrototype', false, false, 0, LoadConstantFromPrototype) +]); + +function Foo() {}; + +Foo.prototype.bar = {}; +Foo.prototype.covfefe = function() {}; +Foo.prototype.baz = 1; + +function LoadConstantFromPrototype() { + let foo = new Foo(); + + for (let i = 0; i < 1000; ++i) { + foo.bar; + foo.covfefe; + foo.baz; + } +} diff --git a/deps/v8/test/js-perf-test/IC/run.js b/deps/v8/test/js-perf-test/IC/run.js new file mode 100644 index 0000000000..254799c7d3 --- /dev/null +++ b/deps/v8/test/js-perf-test/IC/run.js @@ -0,0 +1,24 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +load('../base.js'); + +load('loadconstantfromprototype.js'); + +function PrintResult(name, result) { + print(name + '-IC(Score): ' + result); +} + +function PrintStep(name) {} + +function PrintError(name, error) { + PrintResult(name, error); +} + +BenchmarkSuite.config.doWarmup = undefined; +BenchmarkSuite.config.doDeterministic = undefined; + +BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, + NotifyError: PrintError, + NotifyStep: PrintStep }); |