当然,如果类层次结构发生变化,并且出现另外的目标方法,则JIT编译器可以更正最初生成的代码以便执行虚调用。
Of course, if the class hierarchy changes and a second target method becomes possible, then the JIT compiler can correct the originally generated code so that the virtual invocation is performed.
研究表明:大多数虚调用只有一个目标对应于所有的接收方对象,而JIT编译器可以为直接调用生成比虚调用更有效率的代码。
Research has shown that most virtual invocations have only a single target for all receiver objects, and JIT compilers can generate more-efficient code for a direct call than for a virtual invocation.
会话虚包模式用对会话bean的单个调用来代替对实体bean的多个调用。
The session Facade pattern substitutes a single call to a session bean for multiple calls to an entity bean.
应用推荐