Commit f021c622 authored by Z Nguyen-Huu's avatar Z Nguyen-Huu Committed by Commit Bot

add micro-benchmark for proxy trap getPrototypeOf

Bug: v8:664
Change-Id: I180a59462bd22a1f2378a59fd31edbb539603a1f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1659569
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62227}
parent b8474e70
......@@ -37,7 +37,9 @@
{"name": "IsExtensibleWithoutTrap"},
{"name": "IsExtensibleWithTrap"},
{"name": "PreventExtensionsWithoutTrap"},
{"name": "PreventExtensionsWithTrap"}
{"name": "PreventExtensionsWithTrap"},
{"name": "GetPrototypeOfWithoutTrap"},
{"name": "GetPrototypeOfWithTrap"}
]
},
{
......
......@@ -591,3 +591,37 @@ newBenchmark("PreventExtensionsWithTrap", {
},
teardown() {}
});
// ----------------------------------------------------------------------------
newBenchmark("GetPrototypeOfWithoutTrap", {
setup() {
p = new Proxy({}, {});
},
run() {
for(var i = 0; i < ITERATIONS; i++) {
value = Object.getPrototypeOf(p);
}
return value;
},
teardown() {}
});
// ----------------------------------------------------------------------------
newBenchmark("GetPrototypeOfWithTrap", {
setup() {
p = new Proxy({}, {
getPrototypeOf: function(target) {
return Array.prototype;
}
});
},
run() {
for(var i = 0; i < ITERATIONS; i++) {
value = Object.getPrototypeOf(p);
}
return value;
},
teardown() {}
});
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