首页> 外文期刊>ACM SIGPLAN Notices: A Monthly Publication of the Special Interest Group on Programming Languages >Polymorphic bytecode: Compositional compilation for Java-like languages
【24h】

Polymorphic bytecode: Compositional compilation for Java-like languages

机译:多态字节码:类似Java语言的组合编译

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

摘要

We define compositional compilation as the ability to type-check source code fragments in isolation, generate corresponding binaries, and link together fragments whose mutual assumptions are satisfied, without reinspecting the code. Even though compositional compilation is a highly desirable feature, in Java-like languages it can hardly be achieved. This is due to the fact that the bytecode generated for a fragment (say, a class) is not uniquely determined by its source code, but also depends on the compilation context.We propose a way to obtain compositional compilation for Java, by introducing a polymorphic form of bytecode containing type variables (ranging over class names) and equipped with a set of constraints involving type variables. Thus, polymorphic bytecode provides a representation for all the (standard) bytecode that can be obtained by replacing type variables with classes satisfying the associated constraints.We illustrate our proposal by developing a typing and a linking algorithm. The typing algorithm compiles a class in isolation generating the corresponding polymorphic bytecode fragment and constraints on the classes it depends on. The linking algorithm takes a collection of polymorphic bytecode fragments; checks their mutual consistency, and possibly simplifies and specializes them. In particular, linking a self-contained collection of fragments either fails, or produces standard bytecode (the same as what would have been produced by standard compilation of all fragments).
机译:我们将组合编译定义为能够对源代码片段进行单独的类型检查,生成相应的二进制文件并将满足相互假设的片段链接在一起的能力,而无需重新检查代码。尽管合成编译是非常需要的功能,但是在类似于Java的语言中,它几乎无法实现。这是由于为片段(例如,一个类)生成的字节码不是由其源代码唯一确定的,而是取决于编译上下文。我们提出了一种通过引入Java来获取Java组成编译的方法。字节码的多态形式,包含类型变量(在类名范围内)并配备了一组涉及类型变量的约束。因此,多态字节码提供了所有(标准)字节码的表示形式,这些字节码可以通过用满足相关约束的类替换类型变量来获得。我们通过开发类型和链接算法来说明我们的建议。键入算法隔离地编译一个类,生成相应的多态字节码片段和对其依赖的类的约束。链接算法收集多态字节码片段的集合;检查它们的相互一致性,并可能简化和专门化它们。特别是,链接一个完整的片段集合要么失败,要么产生标准字节码(与所有片段的标准编译产生的字节码相同)。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号