A compound native object model based on the strategy of cross-language object migration

被引:0
作者
Huang, Yukun [1 ,3 ]
Chen, Rong [1 ,2 ]
Pei, Xilong [1 ]
Cao, Jing [2 ]
机构
[1] Institute of Electronic and Information Engineering, Tongji University, Shanghai
[2] Shanghai Kortide Century Technology, Ltd., Shanghai
[3] School of Information Technology, Jiangxi University of Finance and Economics, Nanchang
来源
Jisuanji Yanjiu yu Fazhan/Computer Research and Development | 2015年 / 52卷 / 01期
关键词
Cross-language; Dalvik virtual machine; !text type='Java']Java[!/text] native interface (JNI); Metadata; Native component;
D O I
10.7544/issn1000-1239.2015.20131166
中图分类号
学科分类号
摘要
The Java native interface (JNI) mechanism, which is designed to handle the interaction between native code and Java code, is currently widely utilized to develop mobile applications. However, JNI is observed hardly from perfection in two points: on one hand, the overhead of invoking functions of JNI interfaces heavily affects programs' runtime performance; on the other hand, the complexity of the JNI's programming specification prevents the integration and reusing of third party native components in Java code. To solve these problems, a new strategy is advised to migrate objects between Java components and native components by injecting necessary information of native objects into high-level objects. Guided by this strategy, a model of compound native objects (CNO) is proposed to integrate a Java object and a native object into a compound object which share same metadata maintained by Java class objects. Therefore the CNO model could literally reduce the overheads for the time saving of data type conversions, and lessen down the programming burden of the bridging code. A prototype of the CNO model is implemented on the basis of the Dalvik virtual machine such that Java could reuse third-party components in a dynamical and efficient way. Experiments show that the CNO model outweighs JNI in better performance of accessing native methods. ©, 2015, Science Press. All right reserved.
引用
收藏
页码:141 / 155
页数:14
相关论文
共 39 条
[1]  
Bornstein D., Dalvik VM internals, Proc of the Google I/O Developer Conf, pp. 1-58, (2008)
[2]  
Developers A., Android NDK
[3]  
Ratabouil S., Android NDK Beginner's Guide, pp. 5-22, (2012)
[4]  
Liang S., The Java TM Native Interface: Programmer's Guide and Specification, pp. 6-23, (1999)
[5]  
Gilmore S., Shkaravska O., Estimating the cost of native method calls for resource-bounded functional programming languages, Electronic Notes in Theoretical Computer Science, 151, 3, pp. 27-45, (2006)
[6]  
Lin C., Lin J.H., Dow C.R., Et al., Benchmark dalvik and native code for android system, Proc of the 2nd Int Conf on Innovations in Bio-inspired Computing and Applications, pp. 320-323, (2011)
[7]  
Canfora G., Fasolino A.R., Frattolillo G., Et al., A wrapping approach for migrating legacy system interactive functionalities to service oriented architectures, Journal of Systems and Software, 81, 4, pp. 463-480, (2008)
[8]  
Chiang C.C., Wrapping legacy systems for use in heterogeneous computing environments, Information and Software Technology, 43, 8, pp. 497-507, (2001)
[9]  
Bubak M., Kurzyniec D., Luszczek P., Convenient use of legacy software in Java with Janet package, Future Generation Computer Systems, 17, 8, pp. 987-997, (2001)
[10]  
Korsholm S., Jean P., The Java legacy interface, Proc of the 5th Int Workshop on Java Technologies for Real-Time and Embedded Systems, pp. 187-195, (2007)