← Back to Patent Explorer
US5960197A Expired / Lapsed US ⏱️ 0.0 years remaining

Compiler dispatch function for object-oriented C

Assignee: Oracle America Inc
•
Filing: 1996-05-09
•
Granted: 1999-09-28
•
Expires: 2016-05-09
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract 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.

Inventors

  • 👤 Marino Segnan

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-08 21:56
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/40; G06F8/41; G06F8/44; G06F8/447; G06F9/00; G06F9/06; G06F9/44; G06F9/448; G06F9/4488; G06F9/449; G06F9/4491

Claims Analysis

Total Claims: 19
Claim 1
Independent Claim 208 words
A process executed by a computer system for compiling an object-oriented computer program into a compiled program, said object-oriented computer program having a plurality of declared object classes and a plurality of method call instructions, each of said plurality of method call instructions having an object type identifier and a method selector, said process comprising: (a) generating for each declared object class a first data structure, said first data structure having one element for each defined method for said declared object class, said element comprising a pointer to a method selector for said defined method and an index value; (b) generating for each method call instruction an instruction to store a pointer to said object type identifier in a specified first register of said computer system; and (c) testing whether a method identifier is an element of one of said first data structures and (i) if so, generating an instruction to store the index associated with said method identifier in a second specified register and then generating an instruction to jump to a non-dynamic method dispatch function, (ii) else generating an instruction to store a pointer to said method identifier in said second specified register and then generating an instruction to jump to a dynamic method dispatch function.
Claim 2
Dependent Claim 208 words
A process executed by a computer system for compiling an object-oriented computer program into a compiled program, said object-oriented computer program having a plurality of declared object classes and a plurality of method call instructions, each of said plurality of method call instructions having an object type identifier and a method selector, said process comprising: (a) generating for each declared object class a first data structure, said first data structure having one element for each defined method for said declared object class, said element comprising a pointer to a method selector for said defined method and an index value; (b) generating for each method call instruction an instruction to store a pointer to said object type identifier in a specified first register of said computer system; and (c) testing whether a method identifier is an element of one of said first data structures and (i) if so, generating an instruction to store the index associated with said method identifier in a second specified register and then generating an instruction to jump to a non-dynamic method dispatch function, (ii) else generating an instruction to store a pointer to said method identifier in said second specified register and then generating an instruction to jump to a dynamic method dispatch function.
Claim 3
Dependent Claim 37 words
The process of claim 1, wherein said non-dynamic method dispatch function uses the index value stored in said second specified register to locate an executable code segment associated with the pointer stored in said specified first register.
Claim 4
Dependent Claim 33 words
A program storage device that is readable by a computer system, said program storage device having encoded therein a program of instructions that includes instructions for executing the process described in claim 2.
Claim 5
Dependent Claim 15 words
A computer system comprising a compiler program for performing the operations described in claim 2.
Claim 6
Dependent Claim 36 words
A program storage device that is readable by a computer system, said program storage device having encoded therein a program of instructions that includes instructions for executing the process described in claim 1, 2, or 7.
Claim 7
Dependent Claim 15 words
A computer system comprising a compiler program for performing the operations described in claim 1.
Claim 8
Dependent Claim 159 words
A computer-executed non-dynamic dispatch function process for evaluating a method call instruction expressed in the programming language OBJECTIVE-C, said method call instruction having an object class identifier, a method selector, and an executable code segment, said object class identifier belonging to an object class, said object class having a class data structure and a class dispatch table, said class dispatch table having an index value associated with said method selector, said non-dynamic dispatch function process comprising: loading a pointer to said class data structure; loading a pointer to said class dispatch table wherein the pointer to the class dispatch table is arranged to be loaded using the class data structure; loading a pointer to an entry in said class dispatch table corresponding to said index value; loading a pointer to said executable code segment associated with said pointer loaded to said entry in said class dispatch table corresponding to said index value; and jumping to said executable code segment.
Claim 9
Dependent Claim 159 words
A computer-executed non-dynamic dispatch function process for evaluating a method call instruction expressed in the programming language OBJECTIVE-C, said method call instruction having an object class identifier, a method selector, and an executable code segment, said object class identifier belonging to an object class, said object class having a class data structure and a class dispatch table, said class dispatch table having an index value associated with said method selector, said non-dynamic dispatch function process comprising: loading a pointer to said class data structure; loading a pointer to said class dispatch table wherein the pointer to the class dispatch table is arranged to be loaded using the class data structure; loading a pointer to an entry in said class dispatch table corresponding to said index value; loading a pointer to said executable code segment associated with said pointer loaded to said entry in said class dispatch table corresponding to said index value; and jumping to said executable code segment.
Claim 10
Dependent Claim 33 words
A program storage device that is readable by a computer system, said program storage device having encoded therein a program of instructions that includes instructions for executing the process described in claim 7.
Claim 11
Dependent Claim 15 words
A computer system comprising a compiler program for performing the operations described in claim 7.
Claim 12
Dependent Claim 35 words
A computer-executed non-dynamic dispatch function process as recited in claim 7 further including loading a pointer to a method data structure associated with said entry in said class dispatch table corresponding to said index value.
Claim 13
Dependent Claim 60 words
A computer-executed non-dynamic dispatch function process as recited in claim 10 wherein loading a pointer to said executable code segment with said pointer loaded to said entry in said class dispatch table corresponding to said index value includes using the pointer to the method data structure associated with said entry in said class dispatch table corresponding to said index value.
Claim 14
Dependent Claim 97 words
A memory for storing data for access by a compiler program being executed on a computer system, the memory comprising: a data structure stored in said memory, said data structure used by said compiler program for processing a method call to a specified object class, said data structure including at least one entry having an index value, a pointer to a method identifier associated with said specified object class, said method identifier being arranged to identify a method associated with said specified object class, and a pointer to an executable code segment associated with said identified method.
Claim 15
Dependent Claim 97 words
A memory for storing data for access by a compiler program being executed on a computer system, the memory comprising: a data structure stored in said memory, said data structure used by said compiler program for processing a method call to a specified object class, said data structure including at least one entry having an index value, a pointer to a method identifier associated with said specified object class, said method identifier being arranged to identify a method associated with said specified object class, and a pointer to an executable code segment associated with said identified method.
Claim 16
Dependent Claim 14 words
The memory of claim 12 wherein said method identifier is a method name string.
Claim 17
Dependent Claim 168 words
A computer program product arranged to cause a computer system to compile an object-based computer program into a compiled program, the object-based computer program having at least one declared object class and at least one method call instruction, the at least one method call instruction having an object type identifier and a method selector, the computer program product comprising: computer code for generating a first data structure for the at least one declared object class, the first data structure having an element for each defined method for the at least one declared object class, the element including a pointer to a method selector for the defined method and an index value; computer code for generating an instruction to store a pointer to the object type identifier for the at least one method call instruction in a specified first register of the computer system; computer code for determining whether a method identifier is an element of the first data structure; and a computer-readable medium that stores the computer codes.
Claim 18
Dependent Claim 168 words
A computer program product arranged to cause a computer system to compile an object-based computer program into a compiled program, the object-based computer program having at least one declared object class and at least one method call instruction, the at least one method call instruction having an object type identifier and a method selector, the computer program product comprising: computer code for generating a first data structure for the at least one declared object class, the first data structure having an element for each defined method for the at least one declared object class, the element including a pointer to a method selector for the defined method and an index value; computer code for generating an instruction to store a pointer to the object type identifier for the at least one method call instruction in a specified first register of the computer system; computer code for determining whether a method identifier is an element of the first data structure; and a computer-readable medium that stores the computer codes.
Claim 19
Dependent Claim 113 words
A computer program product according to claim 14, the computer program product further including: computer code for generating an instruction to store the index associated with the method identifier in a specified second register and for generating an instruction to jump to a non-dynamic method dispatch function when it is determined that the method identifier is an element of the first data structure; and computer code for generating an instruction to store a pointer to the method identifier in the specified second register and for generating an instruction to jump to a dynamic method dispatch function when it is determined that the method identifier is not an element in the first data structure.

References Cited (Backward Citations)

US5421016A Cited
US5535391A Cited
US5515536A Cited
US5579518A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2002-09-27 2003-03-29 2003-09-28 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2006-09-27 2007-03-29 2007-09-28 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2010-09-27 2011-03-29 2011-09-28 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag