首页> 外文期刊>The Computer journal >SSA Transformations to Facilitate Type Inference in Dynamically Typed Code
【24h】

SSA Transformations to Facilitate Type Inference in Dynamically Typed Code

机译:SSA转换以促进动态类型代码中的类型推断

获取原文
获取原文并翻译 | 示例
           

摘要

In most dynamically typed languages, variables are created without declaring their type. This way of programming allows variable reuse, so that variables sometimes hold different dynamic types in the same scope. Besides, it is also common to use the same variable to hold different dynamic types, depending on the execution flow of the program. When dynamically typed code is compiled into Java and.Net, the dynamic variables are usually generated as Object references. The approach of declaring variables with the top type (e.g. Object in Java and.Net) requires unsafe and inefficient type casts and, sometimes, the use of reflection. We propose the use of SSA (Static Single Assignment) transformations to facilitate inferring the type of dynamically typed local variables. The approach has been included in an existing compiler for the.Net framework. The result is that dynamically typed code performs significantly better when the SSA transformations are used, and it outperforms C#. Our technique reduces memory consumption at runtime by 35%, but increases compilation time by 13%.
机译:在大多数动态类型的语言中,创建变量时不会声明其类型。这种编程方式允许变量重用,以便变量有时在同一范围内拥有不同的动态类型。此外,根据程序的执行流程,通常使用相同的变量来保存不同的动态类型。将动态类型的代码编译为Java和.Net时,动态变量通常作为对象引用生成。声明具有顶部类型的变量(例如Java和.Net中的Object)的方法需要不安全且效率低下的类型转换,有时还需要使用反射。我们建议使用SSA(静态单一分配)转换来帮助推断动态类型的局部变量的类型。该方法已包含在.Net框架的现有编译器中。结果是,当使用SSA转换时,动态类型代码的性能明显更好,并且其性能优于C#。我们的技术将运行时的内存消耗减少了35%,但将编译时间增加了13%。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号