1 / 5

Survey of Typed Assembly Language (TAL)

Survey of Typed Assembly Language (TAL). Introduction and Motivation Conventional untyped compiler < Typed intermediate languages Typed intermediate language < Typed target language ( TAL) Resources

sonya-foley
Télécharger la présentation

Survey of Typed Assembly Language (TAL)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Survey of Typed Assembly Language (TAL) • Introduction and Motivation • Conventional untyped compiler < Typed intermediate languages • Typed intermediate language < Typed target language ( TAL) • Resources • From System F to Typed Assembly Language Greg Morrisett, David Walker, Karl Crary, and Neal Glew • From System F to Typed Assembly Language (Extended version). Technical Report TR97-1651 Greg Morrisett, David Walker, Karl Crary, and Neal Glew • Intensional Polymorphism in Type-Erasure Semantics. Stephanie Weirich , Karl Crary and Greg Morrisett • TALx86: A Realistic Typed Assembly Language Greg Morrisett, Karl Crary, Neal Glew, Dan Grossman, Richard Samuels, Frederick Smith, David Walker, Stephanie Weirich, and Steve Zdancewic • Structure • From system F to TAL: 4 translations and 5 typed calculi • Extension and practice: • TAL86x, a realistic typed assembly language

  2. Compilation of System F to Typed Assembly Language * Product type • Step 1 : system F and Continuation Passing style (CPS) conversion • Objective: conversion to CPS • Syntax for λF(call-by-value variant of system F augmented with products and recursion ) • Syntax forλK (target calculus, typed intermediate language) • What’re completed and changed? • Names all intermediate computations and eliminates the need for a control stack • All unconditional control transfers are achieved via function call • λK is almost linear, except for if0 • Functions in λK invoke continuations using “ void” • Halt[τ]υ terminates the computation * Recursion * * Cited from “From system F to TAL”

  3. Compilation of System F to Typed Assembly Language * • Step 2 : Simplified Polymorphic Closure Conversion • Objective: separate program code from data • Two steps: • Closure conversion proper • Approaches: Minamide et al / The Definition of Standard ML@ • Type-passing / Type-erasure interpretation of polymorphism (types are constructed and passed to polymorphic functions at run-time) (run-time type information is represented by ordinary terms) • Polymorphic instantiation cannot / can easily be handled via substitution • Requires / Don’t require both abstract kinds of translucent types • Cost of Polymorphic closure conversion • Hoisting – lift the closed function code to the top of program • Key point of implementation of the Type-erasure interpretation • Partial applications of functions to type arguments to be values Eg. : υ has type is treated as a value and has type * * Cited from “From system F to TAL”, Greg Morrisett, David Walker, Karl Crary, and Neal Glew @ Cited from “Intensional Polymorphism in Type-Erasure Semantics ”, Karl Crary, Stephanie Weirich, and Greg Morrisett

  4. Compilation of System F to Typed Assembly Language * • Step 3 : Explicit Allocation • Objective: allocate spaces for tuples and fill them out field by field • Syntax forλA(similar to λC ): • Features: • Tuples no long have value form • Creation of an n-element tuple: an allocation step + n initialization steps Eg. Creation of the pair <υ0, υ1 > * * * Cited from “From system F to TAL”

  5. Compilation of System F to Typed Assembly Language * • Step 4: Code generation • Objective: convertλA to TAL, mostly syntactic • TAL syntax * Key technical Difference TAL program * * Cited from “From system F to TAL”

More Related