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: Maya Lekova <mslekova@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#62227}
This commit is contained in:
parent
b8474e7022
commit
f021c622a9
@ -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() {}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user