Skip to main content

Representation Analysis for Coercion Placement

  • Conference paper
  • First Online:
Static Analysis (SAS 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2477))

Included in the following conference series:

Abstract

This paper presents a global approach to representation analysis based on program-wide data and control flow information. Boxing and unboxing coercions can be placed around any variable occurrence, not only where values are produced and consumed.

The analysis first constructs a graph representing all legal coercion placements, then selects one of them. Assigning unboxed representations to as many variables as possible does not necessarily minimize execution time (or the number of executed coercions); we present and measure several heuristics.

When combined with function cloning, the analysis is powerful enough to eliminate almost all coercions from several nonstrict programs, including a simple polymorphic type checker.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Urban Boquist. Code Optimization Techniques for Lazy Functional Languages. PhD thesis, Chalmers University of Technology, April 1999.

    Google Scholar 

  2. Allyn Dimock, Robert Muller, Franklyn Turbak, and J. B. Wells. Strongly typed flow-directed representation transformations. ACM SIGPLAN Notices, 32(8), August 1997.

    Google Scholar 

  3. Karl-Filip Faxén. Optimizing lazy functional programs using flow inference. In Allan Mycroft, editor, Proceedings of the Second International Symposium on Static Analysis, pages 136–153, Glasgow, UK, September 1995. Springer-Verlag.

    Google Scholar 

  4. Karl-Filip Faxén. Analysing, Transforming and Compiling Lazy Functional Programs. PhD thesis, Department of Teleinformatics, Royal Institute of Technology, June 1997.

    Google Scholar 

  5. Karl-Filip Faxén. Cheap eagerness: Speculative evaluation in a lazy functional language. In Philip Wadler, editor, Proceedings of the 2000 International Conference on Functional Programming, September 2000.

    Google Scholar 

  6. Karl-Filip Faxén. The costs and benefits of cloning in a lazy functional language. In Stephen Gilmore, editor, Trends in Functional Programming, volume 2, pages 1–12. Intellect, 2001. Proc. of Scottish Functional Programming Workshop, 2000.

    Google Scholar 

  7. Cordelia V. Hall, Simon L. Peyton Jones, and Patrick M. Sansom. Unboxing using specialisation. In Glasgow functional programming workshop. Springer Verlag, July 1994.

    Google Scholar 

  8. Robert Harper and Greg Morrisett. Compiling polymorphism using intensional type analysis. In Principles of Programming Languages, San Francisco, January 1995.

    Google Scholar 

  9. Pieter Hartel and Koen Langendoen. Benchmarking implementations of lazy functional languages. In Functional Programming & Computer Architecture, pages 341–349, Copenhagen, June 93.

    Google Scholar 

  10. Fritz Henglein. Global tagging optimization by type inference. In Proc. 1992 ACM Conf. on LISP and Functional Programming (LFP), San Francisco, California, pages 205–215. ACM, ACM Press, June 1992.

    Google Scholar 

  11. Fritz Henglein and Jesper Jørgensen. Formally optimal boxing. In Conference Record of POPL’ 94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 213–226, Portland, Oregon, January 1994.

    Google Scholar 

  12. Xavier Leroy. Unboxed objects and polymorphic typing. In Conference Record of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 177–188, Albequerque, New Mexico, January 1992.

    Google Scholar 

  13. Yasuhiko Minamide and Jacques Garrigue. On the runtime complexity of typedirected unboxing. In Proc. International Conference on Functional Programming, pages 1–12. ACM Press, September 1998.

    Google Scholar 

  14. Christian Mossin. Flow Analysis of Typed Higher-Order Programs. PhD thesis, DIKU, University of Copenhagen, Denmark, January 1997.

    MATH  Google Scholar 

  15. John Peterson. Untagged data in tagged environments: Choosing optimal representations at compile time. In Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, pages 89–99. ACM Press, September 1989.

    Google Scholar 

  16. Simon L Peyton Jones and André Santos. A transformation-based optimizer for Haskell. Science of Computer Programming, 32(1–3):3–47, September 1998.

    Google Scholar 

  17. Manuel Serrano and Marc Feeley. Storage use analysis and its applications. ACM SIGPLAN Notices, 31(6):50–61, June 1996.

    Google Scholar 

  18. Zhong Shao. Flexible representation analysis. ACM SIGPLAN Notices, 32(8):85–98, August 1997.

    Google Scholar 

  19. Zhong Shao and Andrew W. Appel. A type-based compiler for Standard ML. In Programming Language Design and Implementation, pages 116–129, La Jolla, CA, June 1995. ACM Press.

    Google Scholar 

  20. Stephen T. Weeks. MLton user’s guide. Available from http://www.sourcelight.com/MLton, September 2000.

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Faxén, KF. (2002). Representation Analysis for Coercion Placement. In: Hermenegildo, M.V., Puebla, G. (eds) Static Analysis. SAS 2002. Lecture Notes in Computer Science, vol 2477. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45789-5_21

Download citation

  • DOI: https://doi.org/10.1007/3-540-45789-5_21

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-44235-6

  • Online ISBN: 978-3-540-45789-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics