为什么Android编译器为相同代码生成不同的Methodref
我碰巧遇到了一些有线编译的字体模式,我相信这两者都共享类似于以下
class SomeWebView extends WebView {
SomeWebView() {
this.getSettings();
}
}
版本1(app a中的代码写)的相同源代码发射代码,例如:
invoke-virtual **WebView**->getSettings() WebSettings, p0
2版(复制到应用程序b)发射代码,例如
invoke-virtual **SomeWebView**->getSettings() WebSettings, p0
:没有更改正确性(?),但是我想知道哪个步骤介绍了此更改及其官方优化名称(例如Devirtualization?但是我确定不是),
请注意某些webview不会覆盖getSettings
i happened to encounter some wired compiled bytecode which i believe both sharing the same source code like below
class SomeWebView extends WebView {
SomeWebView() {
this.getSettings();
}
}
version 1 (above code write in app a) emits code like:
invoke-virtual **WebView**->getSettings() WebSettings, p0
version 2 (with same code copied to app b) emits code like:
invoke-virtual **SomeWebView**->getSettings() WebSettings, p0
although this changes nothing in correctness(?), but i want to know which step introduced this change and its official optimization name (like devirtualization? but i'm sure it's not)
notice SomeWebView DOES NOT override getSettings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论