检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:孙蒴 张伟[1,2,3] 冯温迪[1] 张俞炜 SUN Shuo;ZHANG Wei;FENG Wendi;ZHANG Yuwei(Computer School,Beijing Information Science and Technology University,Beijing 100101,China;Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing(Beijing Information Science and Technology University),Beijing 100101,China;Beijing Laboratory of National Economic Security Early-warning Engineering(Beijing Information Science and Technology University),Beijing 100101,China;School of Computer Science,Peking University,Beijing 100871,China)
机构地区:[1]北京信息科技大学计算机学院,北京100101 [2]北京未来区块链与隐私计算高精尖中心(北京信息科技大学),北京100101 [3]国家经济安全预警工程北京实验室(北京信息科技大学),北京100101 [4]北京大学计算机学院,北京100871
出 处:《计算机应用》2024年第7期2151-2159,共9页journal of Computer Applications
基 金:国家重点研发计划项目(2022YFC3320900);北京市教育委员会科研计划项目(KM202311232005);“北京未来区块链与隐私计算高精尖中心”;“国家经济安全预警工程北京实验室”资助。
摘 要:外部函数接口(FFI)是解决一种编程语言调用其他语言函数库的主要方法。针对使用FFI技术时需要大量人工编码的问题,提出自动化外部函数接口生成(AFIG)方法。该方法利用基于抽象语法树的源码逆向分析技术,从被封装的库文件中精准提取出用于描述函数接口信息的多语言融合的统一表示。基于此统一表示,不同平台的代码生成器可利用多语言转换规则矩阵,全自动化地生成不同平台的FFI相关代码。为解决FFI代码生成中的效率低下问题,设计了一种基于依赖分析的任务聚合策略,通过把存在依赖的任务聚合为新的任务,有效消除了FFI代码任务在并行下的阻塞与死锁,从而实现任务在多核系统下的可扩展与负载均衡。实验结果表明:与人工编码相比,AFIG方法减少了FFI开发中98.14%的开发编码量以及41.95%的测试编码量;与现有的SWIG(Simplified Wrapper and Interface Generator)方法相比,在同等任务下可减少61.27%的开发成本;且生成效率随着计算资源的增加呈线性增长。Foreign Function Interface(FFI)is a fundamental method to invoke interfaces provided in other programming languages.Focusing on huge amount of manual coding required when using FFI,an Automatic Foreign function Interface Generation(AFIG)method was proposed.The reverse source code analysis technique based on abstract syntax tree was employed by AFIG to accurately retrieve the multilingual intermediate representation from library binaries,in which function interface information was uniformly described.Based on the representation,the multilingual conversion rule matrix could be utilized by different platform code generators to automatically generate FFI codes for various platforms without handcrafting.To further reduce generation time usage,a dependency analysis-based task aggregation strategy was proposed,by which tasks with dependencies were consolidated as monolithic ones.Hence,blocking and deadlocks were efficiently eliminated,and load balancing and scalability on multi-core systems were achieved,accordingly.Experimental results indicate that AFIG achieves a reduction of 98.14%for FFI developing codes and 41.95%for testing codes compared to manual coding method;under the same task,AFIG further reduces development cost by 61.27%compared to SWIG(Simplified Wrapper and Interface Generator).And the code generation efficiency of AFIG increases linearly with the increase of computing resources.
关 键 词:外部函数接口 代码生成 依赖消除 并行处理 静态分析
分 类 号:TP311.56[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.49