v1.7 JSB 2.0 支持讨论帖

jit分级…求相关说明

1.7 beta1是比较早的版本了,里面有几个已知的问题已经修复,期待beta2出来。还有配套的creator编辑器,比如加密功能,构建面板完善(V8不再支持jsc)。
这些完善之后,就可以真正移植起来。

https://stackoverflow.com/questions/22281265/is-javascriptcore-framework-on-ios-7-using-jit-compilation
No, JavaScriptCore on iOS 7+ won’t be able to JIT compile for you, because iOS disallows mapping writable/executable pages of memory as a hard rule, and that’s a requirement for JIT. Only MobileSafari.app, Web.app and a handful of other system apps carry an entitlement that allows them to JIT compile. The new WKWebView in iOS 8 is rendered in a separate process that is allowed to JIT compile, so JavaScript in a WKWebView is faster than a UIWebView or plain JSContext.

https://github.com/phoboslab/JavaScriptCore-iOS/issues/19
The built-in UIWebView runs in a separate process in iOS8 which is whitelisted to use the JIT.
Updating to the latest JSC version will still not allow us to use the JIT. Hijacking a JSContext from WKWebView could work, though.

http://facebook.github.io/react-native/docs/javascript-environment.html
JSC doesn’t use JIT due to the absence of writable executable memory in iOS apps.

上面是之前搜索到的一些资料,可以大概了解JSC不能使用JIT的原因。但无论如何,它的性能确实比1.6快出好几倍。

1赞

之前在iOS上调试,断点下来,看到有jit相关的函数调用堆栈。所以判断应该是有启用初级的优化。

具体我再确认一下。
不过能确定的是,1.7的jsc的纯JS运行的性能比SpiderMonkey好很多。

这个问题是我们使用了JS的新特性导致的,mac 10.11和ios9中的JSC还不支持此特性。这个我们后续会处理一下。

2赞

多谢,那就等新的beta版本了,期待:)@dumganhar
mac系统更新到10.13后可以了

但是ios性能高啊,其实苹果才是硬件狂魔。。。

苹果笔记本的显卡不是很低端吗,还都是集成显卡

没记错的话,JS吃的是CPU吧

Debugger & Profiler 可以玩了,文档在:

https://github.com/cocos-creator/cocos2d-x-lite/blob/develop/cocos/scripting/js-bindings/docs/JSB2.0-learning-zh.md

的调试章节。

模拟器直接支持调试&Profile

敬请期待。:slight_smile:

7赞

请求合并cocos2dx creator 底层的核心代码。。。
确保核心代码能够同时更新,给用cocos2dx 以及JSB的兄弟们能带来福音。

在这两个PR中修复:

https://github.com/cocos-creator/cocos2d-x-lite/pull/883

https://github.com/cocos-creator/engine/pull/2033

这个,,,暂时没这个计划

我升级了mac系统,可以用了,发现了新的错误,在主贴里记录了

看了文档,终于可以和浏览器一样Debug了,牛逼牛逼:clap:
我们游戏试验成功,可以在Chrome里面调试模拟器。

1赞

已经试验成功了?跟进好快啊。:+1:

来晚了,这里这么热闹,我也想试试1.7,@panda 上面说1.7 beta2我没找到下载地址,只找到1.7 beta1。

怎么做到的,求指教,:grin:

beta2估计在路上吧,具体要问@nantas了。
colin应该是用beta1 + 自己合并一些cocos2d-x-lite和engine仓库的代码去验证的。

就是fork官方的仓库,然后自己编译跟进的。

1赞