|
计算机科学 2006
A Solution to the Polymorphism of Object-Oriented Programs in WCET Analysis
|
Abstract:
It is a tendency for real-time systems to be designed with object-oriented modeling language,such as Unified Modeling Language (UML),and implemented with object-oriented languages such as C~ . However, some object-oriented features like polymorphism bring about challenges for Worst-Case Execution Time (WCET) analysis. This paper presents a solution to cope with a kind of widely used dynamic binding by introducing UML design information into WCET analysis. Realizing that the association in UML is a relationship between two or more concrete classes, we emphasize the specification of the multiplicity of the roles of an association, and suppose the ease of establishing the mapping between an association and its representation in source code. Based on the multiplicity of the roles of association, we compute the execution count of a loop structure that traverses all the objects of the sub-classes a super class variable represents in the loop, and determine the number of objects of each concrete class in a super (virtual) class call site. By combining our method with the method of Corti and Gross, we can calculate the WCET of a program written in object-oriented languages with polymorphism characteristics. Empirical study shows that the cases we explore are broadly used in object-oriented programs.