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

[ic] Add benchmark for LdaKeyedLoad

Bug: v8:9449
Change-Id: I7c50db92459df2a8a7da7b0bd2efdd2f3bed3e46
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1690952Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62671}
parent 3f3625f3
// 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.
function addBenchmark(name, test) {
new BenchmarkSuite(name, [1000],
[
new Benchmark(name, false, false, 0, test)
]);
}
function objectLookupStringConstant() {
const x = { 1: "foo" };
for (var i = 0; i < 1000; ++i) {
const p = x["1"];
}
}
function objectLookupIndexNumber() {
const x = { 1: "foo" };
const a = 1;
for (var i = 0; i < 1000; ++i) {
const p = x[a];
}
}
function objectLookupIndexString() {
const x = { 1: "foo" };
const a = "1";
for (var i = 0; i < 1000; ++i) {
const p = x[a];
}
}
addBenchmark('Object-Lookup-String-Constant', objectLookupStringConstant);
addBenchmark('Object-Lookup-Index-Number', objectLookupIndexNumber);
addBenchmark('Object-Lookup-Index-String', objectLookupIndexString);
......@@ -359,6 +359,18 @@
{"name": "Smi-Value"},
{"name": "Prototype-Chain-Value"}
]
},
{
"name": "LdaKeyedProperty",
"main": "run.js",
"resources": [ "LdaKeyedProperty.js" ],
"test_flags": [ "LdaKeyedProperty" ],
"results_regexp": "^%s\\-BytecodeHandler\\(Score\\): (.+)$",
"tests": [
{"name": "Object-Lookup-String-Constant"},
{"name": "Object-Lookup-Index-Number"},
{"name": "Object-Lookup-Index-String"}
]
}
]
},
......
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