Commit b464b62f authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[jsperf] Add benchmark for LoadConstantFromPrototype

Bug: v8:9616
Change-Id: Ieca74f8df90b342672c8904beef2c2298f0ba597
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1755991Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63221}
parent dd6af4e6
// 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;
}
}
// 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 });
......@@ -618,6 +618,18 @@
{"name": "Inline-Serialize-Error.stack"},
{"name": "Recursive-Serialize-Error.stack"}
]
},
{
"name": "IC",
"path": ["IC"],
"main": "run.js",
"flags": ["--no-opt"],
"resources": ["loadconstantfromprototype.js"],
"results_regexp": "^%s\\-IC\\(Score\\): (.+)$",
"tests": [
{"name": "LoadConstantFromPrototype"
}
]
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment