summaryrefslogtreecommitdiff
path: root/deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js')
-rw-r--r--deps/v8/test/js-perf-test/IC/loadconstantfromprototype.js23
1 files changed, 23 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;
+ }
+}