发明名称 Compiler dispatch function for object-oriented C
摘要 A compiler is described that generates instructions to execute object-oriented method call invocations in an efficient manner. Specifically, a method dispatch operation distinguishes between those method calls that do not require dynamic invocation from those that do, and optimizes the instructions generated to perform the former. For each object class declaration encountered during compilation, a dispatch array is created. Each dispatch array contains entries for all method calls which can be made to the class, including those implemented in an ancestor class(es), and all protocols adopted by these classes. As each method call is parsed during compilation, if the compiler finds an entry for the calling method in a dispatch table, an instruction to call a non-dynamic method dispatch function is generated. If, on the other hand, no entry for the calling method is found in a dispatch array, the compiler generates a conventional dynamic method dispatch instruction. The non-dynamic method dispatch function uses the dispatch array to directly identify the calling method's executable code segment. Use of non-dynamic method invocation can provide a substantial speed gain during program execution.
申请公布号 US5960197(A) 申请公布日期 1999.09.28
申请号 US19960644041 申请日期 1996.05.09
申请人 SUN MICROSYSTEMS, INC. 发明人 SEGNAN, MARINO
分类号 G06F9/42;G06F9/45;(IPC1-7):G06F9/44 主分类号 G06F9/42
代理机构 代理人
主权项
地址