7 Star 45 Fork 26

Gitee 极速下载/WebKit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/WebKit/webkit
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
function-bind-no-inlining.js 638 Bytes
一键复制 编辑 原始数据 按行查看 历史
function assert(b) {
if (!b)
throw new Error("Bad")
}
noInline(assert);
function test(f, v, c, d) {
return f.bind(v, c, d);
}
noInline(test);
function test2(f, v) {
return f.bind(v);
}
noInline(test);
function foo(a,b,c,d,e,f) { return this; }
let thisValue = {};
let start = Date.now();
for (let i = 0; i < 1000000; i++) {
let f = test(foo, thisValue, 20, 30);
assert(f(foo, thisValue, 20, 30) === thisValue);
}
for (let i = 0; i < 1000000; i++) {
let f = test2(foo, thisValue);
assert(f(foo, thisValue, 20, 30) === thisValue);
}
const verbose = false;
if (verbose)
print(Date.now() - start);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/WebKit.git
git@gitee.com:mirrors/WebKit.git
mirrors
WebKit
WebKit
main

搜索帮助