why android compiler generate different MethodRef for same code

19 Views Asked by At

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

0

There are 0 best solutions below