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

add micro-benchmark for Proxy with isExtensible trap

Bug: v8:6664
Change-Id: Ie320264cfba8c33c90405bb009f584b8e2b3d8ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1637660Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61969}
parent 9a52cc11
......@@ -33,7 +33,9 @@
{"name": "SetIndexWithTrap"},
{"name": "SetSymbolWithoutTrap"},
{"name": "SetSymbolWithTrap"},
{"name": "HasInIdiom"}
{"name": "HasInIdiom"},
{"name": "IsExtensibleWithoutTrap"},
{"name": "IsExtensibleWithTrap"}
]
},
{
......
......@@ -506,3 +506,47 @@ newBenchmark("HasInIdiom", {
return result === 20 * SOME_NUMBER;
}
});
// ----------------------------------------------------------------------------
obj = {};
value = false;
newBenchmark("IsExtensibleWithoutTrap", {
setup() {
p = new Proxy(obj, {});
},
run() {
for(var i = 0; i < ITERATIONS; i++) {
value = Object.isExtensible(p);
}
return value;
},
teardown() {
return value === true;
}
});
// ----------------------------------------------------------------------------
obj = {};
value = false;
newBenchmark("IsExtensibleWithTrap", {
setup() {
p = new Proxy(obj, {
isExtensible: function(target) {
return true;
}
});
},
run() {
for(var i = 0; i < ITERATIONS; i++) {
value = Object.isExtensible(p);
}
return value;
},
teardown() {
return value === true;
}
});
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