ABSTRACT
We present the problem of class hierarchy complementation: given a partially known hierarchy of classes together with subtyping constraints ("A has to be a transitive subtype of B") complete the hierarchy so that it satisfies all constraints. The problem has immediate practical application to the analysis of partial programs--e.g., it arises in the process of providing a sound handling of "phantom classes" in the Soot program analysis framework. We provide algorithms to solve the hierarchy complementation problem in the single inheritance and multiple inheritance settings. We also show that the problem in a language such as Java, with single inheritance but multiple subtyping and distinguished class vs. interface types, can be decomposed into separate single- and multiple-subtyping instances. We implement our algorithms in a tool, JPhantom, which complements partial Java bytecode programs so that the result is guaranteed to satisfy the Java verifier requirements. JPhantom is highly scalable and runs in mere seconds even for large input applications and complex constraints (with a maximum of 14s for a 19MB binary).
- K. Ali and O. Lhoták. Application-only call graph construction. In Proc. of the 26th European Conf. on Object-Oriented Programming, ECOOP '12, pages 688--712. Springer, 2012. Google ScholarDigital Library
- K. Ali and O. Lhoták. Averroes: Whole-program analysis without the whole program. In Proc. of the 27th European Conf. on Object-Oriented Programming, ECOOP '13, pages 378--400. Springer, 2013. Google ScholarDigital Library
- D. Ancona, F. Damiani, S. Drossopoulou, and E. Zucca. Polymorphic bytecode: compositional compilation for Java-like languages. In Proc. of the 32nd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL '05, pages 26--37, New York, NY, USA, 2005. ACM. Google ScholarDigital Library
- D. Ancona, F. Damiani, S. Drossopoulou, E. Zucca, and D. U. D. Genova. Even more principal typings for Java-like languages. In ECOOP Workshop on Formal Techniques for Java Programs (FTfJP), 2004.Google Scholar
- D. Ancona and E. Zucca. Principal typings for Java-like languages. In Proc. of the 31st ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL '04, pages 306--317, New York, NY, USA, 2004. ACM. Google ScholarDigital Library
- M. Bravenboer and Y. Smaragdakis. Strictly declarative specification of sophisticated points-to analyses. In Proc. of the 24th Annual ACM SIGPLAN Conf. on Object Oriented Programming, Systems, Languages, and Applications, OOPSLA '09, New York, NY, USA, 2009. ACM. Google ScholarDigital Library
- E. Bruneton, R. Lenglet, and T. Coupaye. ASM: A code manipulation tool to implement adaptable systems. In Adaptable and extensible component systems, 2002.Google Scholar
- C. Daskalakis, R. M. Karp, E. Mossel, S. Riesenfeld, and E. Verbin. Sorting and selection in posets. In Proc. of the 20th Annual ACM-SIAM Symp. on Discrete Algorithms, SODA '09, pages 392--401, Philadelphia, PA, USA, 2009. Society for Industrial and Applied Mathematics. Google ScholarDigital Library
- D. Dig. A refactoring approach to parallelism. IEEE Software, 28(1):17--22, Jan. 2011. Google ScholarDigital Library
- J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java#8482; Language Specification, Third Edition. Addison-Wesley Professional, 2005. Google ScholarDigital Library
- S. Guarnieri and B. Livshits. GateKeeper: mostly static enforcement of security and reliability policies for Javascript code. In Proc. of the 18th USENIX Security Symposium, SSYM '09, pages 151--168, Berkeley, CA, USA, 2009. USENIX Association. Google ScholarDigital Library
- A. Hejlsberg, S. Wiltamuth, and P. Golde. C\# Language Specification. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2003. Google ScholarDigital Library
- G. Kastrinis and Y. Smaragdakis. Hybrid context-sensitivity for points-to analysis. In Proc. of the 2013 ACM SIGPLAN Conf. on Programming Language Design and Implementation, PLDI '13. ACM, 2013. Google ScholarDigital Library
- T. Lindholm and F. Yellin. Java Virtual Machine Specification. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2nd edition, 1999. Google ScholarDigital Library
- M. Madsen, B. Livshits, and M. Fanning. Practical static analysis of Javascript applications in the presence of frameworks and libraries. Technical Report MSR-TR-2012--66, Microsoft Research, July 2012.Google Scholar
- M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In Proc. of the 2006 ACM SIGPLAN Conf. on Programming Language Design and Implementation, PLDI '06, pages 308--319. ACM, 2006. Google ScholarDigital Library
- M. Odersky, P. Altherr, V. Cremet, B. Emir, S. Maneth, S. Micheloud, N. Mihaylov, M. Schinz, E. Stenman, and M. Zenger. An overview of the Scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google Scholar
- R. F. St\"ark and J. Schmid. The problem of bytecode verification in current implementations of the JVM. Technical report, ETH Zürich, 2000.Google Scholar
- R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan. Soot - a Java bytecode optimization framework. In Proc. of the 1999 Conf. of the Centre for Advanced Studies on Collaborative research, CASCON '99. IBM Press, 1999. Google ScholarDigital Library
- R. Vallée-Rai, E. Gagnon, L. J. Hendren, P. Lam, P. Pominville, and V. Sundaresan. Optimizing Java bytecode using the Soot framework: Is it feasible? In Proc. of the 9th Int. Conf. on Compiler Construction, CC '00, pages 18--34, 2000. Google ScholarDigital Library
Index Terms
- Class hierarchy complementation: soundly completing a partial type graph
Recommendations
Class hierarchy complementation: soundly completing a partial type graph
OOPSLA '13We present the problem of class hierarchy complementation: given a partially known hierarchy of classes together with subtyping constraints ("A has to be a transitive subtype of B") complete the hierarchy so that it satisfies all constraints. The ...
Program transformations for portable CPU accounting and control in Java
PEPM '04: Proceedings of the 2004 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulationIn this paper we introduce a novel scheme for portable CPU accounting and control in Java, which is based on program transformation techniques at the bytecode level and can be used with every standard Java Virtual Machine. In our approach applications, ...
J-Orchestra: Enhancing Java programs with distribution capabilities
J-Orchestra is a system that enhances centralized Java programs with distribution capabilities. Operating at the bytecode level, J-Orchestra transforms a centralized Java program (i.e., running on a single Java Virtual Machine (JVM)) into a distributed ...
Comments