git://git.webkit.org
/
WebKit-https.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[JSC] Clean up Object.entries implementation
[WebKit-https.git]
/
JSTests
/
microbenchmarks
/
elidable-new-object-then-call.js
1
function sumOfArithSeries(limit) {
2
return limit * (limit + 1) / 2;
3
}
4
5
var n = 10000000;
6
7
function bar(p, o) {
8
if (p)
9
return 5;
10
else
11
return 6;
12
}
13
14
function foo() {
15
var result = 0;
16
for (var i = 0; i < n; ++i) {
17
var o = {f: i};
18
var p = {f: i + 1};
19
bar(i, o);
20
bar(i, p);
21
result += o.f + p.f;
22
}
23
return result;
24
}
25
26
var result = foo();
27
if (result != sumOfArithSeries(n - 1) + sumOfArithSeries(n))
28
throw "Error: bad result: " + result;