Advanced Search
    Huang Yukun, Chen Rong, Pei Xilong, Cao Jing. A Compound Native Object Model Based on the Strategy of Cross-Language Object Migration[J]. Journal of Computer Research and Development, 2015, 52(1): 141-155. DOI: 10.7544/issn1000-1239.2015.20131166
    Citation: Huang Yukun, Chen Rong, Pei Xilong, Cao Jing. A Compound Native Object Model Based on the Strategy of Cross-Language Object Migration[J]. Journal of Computer Research and Development, 2015, 52(1): 141-155. DOI: 10.7544/issn1000-1239.2015.20131166

    A Compound Native Object Model Based on the Strategy of Cross-Language Object Migration

    • 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.
    • loading

    Catalog

      Turn off MathJax
      Article Contents

      /

      DownLoad:  Full-Size Img  PowerPoint
      Return
      Return