IP Library Granted Patent US 7,337,173
Granted Patent B1
US 7,337,173 · App. 08/984,904 · Granted Feb 26, 2008

Compiler having global element optimization

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,337,173
App. No.
08/984,904
Granted
Feb 26, 2008
Kind
B1
Abstract

An optimization technique is provided which automatically reduces the number of globals in a program to the minimum required. The optimization technique identifies those elements which are placed in a program as global elements, but which do not need to be global elements. The optimization technique parses all files in a program, identifies all global elements, and removes any global elements that are not used outside of a particular file within the program by converting these global elements to local elements or by disregarding those elements.

Claims (50)

1. In a compiler, an optimization method comprising the steps of:

executing a first compilation step, said first compilation step comprising the steps of:

compiling a source program during said first compilation step; and

building a database during said first compilation step that identifies each global element within said source program and that identifies how to recompile said source program;

performing a prelink step during which said source program compiled during said first compilation step is analyzed to determine which global elements do not need to be global elements;

executing a second compilation step, said second compilation step comprising the step of:

recompiling said source program during a second compilation step, during which step said global elements that do not need to be global elements are converted to local elements; and

linking said recompiled source program to produce a compiled object file.

2. The method of claim 1 , further comprising the step of:

providing said source program to said compiler for use during said first compilation step.

3. The method of claim 2 , further comprising the step of:

providing a global to local symbol conversion module for identifying all global elements in said source program and for producing an assembler source file during said first compilation step.

4. The method of claim 3 , further comprising the step of:

providing an assembler for receiving said assembler source file and for producing an object file therefrom.

5. The method of claim 4 , further comprising the step of:

providing a global to local symbol conversion module during said prelink step for determining all dependencies within said object file.

6. The method of claim 5 , wherein said determination of said dependencies comprises identifying global elements that are used in more than one file.

7. The method of claim 5 , wherein said global to local symbol conversion module determines if an element is currently global, if the element is not used outside of the file in which it currently resides, and if the element is actually being used by the file.

8. The method of claim 5 , wherein said determination is made for each global element to determine if a given function must be global.

9. The method of claim 5 , wherein said database is accessed to include information regarding global element dependencies.

10. The method of claim 9 , wherein database access is a process that to involves both reading data produced to identify global elements and writing data produced to identify desired state for these global elements.

11. The method of claim 1 , wherein an object file produced from said source program during the first compilation step is analyzed by a linker during said prelink step.

12. The method of claim 1 , wherein information regarding the manner in which said source program is to be compiled and a current list of global elements is available after said first compilation step is completed.

13. The method of claim 1 , further comprising the step of:

determining which global elements may be safely converted to local elements because they are not used outside of the local file and which global elements may be disregarded because they are not used or are redundant.

14. The method of claim 1 , wherein one or more global inline functions created for debugging purposes are converted to local information.

15. The method of claim 1 , wherein redundant and unused global elements are disregarded.

16. In a computer, a computer program for operating said computer to implement a compilation process, said computer program including functional elements comprising:

a compiler for receiving a source program and for compiling said source program, said compiler comprising:

a module for building a database that identifies each global element within said source program;

a linker for analyzing said source program to determine which global elements do not need to be global elements; and

a module for converting said global elements that do not need to be global elements to local elements to produce a recompiled source program;

wherein said linker links said recompiled source program to produce a compiled object file.

17. The apparatus of claim 16 , said compiler further comprising:

a first global to local symbol conversion module for identifying all global elements in said source program and for producing an assembler source file.

18. The apparatus of claim 17 , said compiler further comprising:

an assembler for receiving said assembler source file and for producing an object file therefrom.

19. The apparatus of claim 18 , said linker further comprising:

a second global to local symbol conversion module for determining all dependencies within said object file.

20. The apparatus of claim 19 , wherein said determination of said dependencies comprises identifying global elements that are used in more than one file.

21. The apparatus of claim 19 , wherein said determination is made for each global element to determine if a given function must be global.

22. The apparatus of claim 19 , wherein said global to local symbol conversion module determines if an element is currently global, if the element is not used outside of the file in which it currently resides, and if the element is actually being used by the file.

23. The apparatus of claim 19 , wherein said database is accessed to include information regarding global element dependencies.

24. The apparatus of claim 23 , wherein database access is a process that involves both reading data produced to identify global elements and writing data produced to identify dependencies for these global elements.

25. The apparatus of claim 16 , wherein said compiler produces information regarding the manner in which said source program is to be compiled and a current list of global elements.

26. The apparatus of claim 16 , wherein a file produced from said source program by said compiler is analyzed by said linker.

27. The apparatus of claim 16 , further comprising:

means for determining which global elements may be safely converted to local elements because they are not used outside of the local file and which global elements may be disregarded because they are not used or are redundant.

28. The apparatus of claim 16 , wherein one or more global inline functions created for debugging purposes are converted to local information.

29. The apparatus of claim 16 , wherein redundant and unused global elements are disregarded.

Assignments (6)
CHANGE OF NAME Recorded Dec 20, 2021
From: FACEBOOK, INC.
To: META PLATFORMS, INC.
Reel/Frame 058961/0436 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 29, 2014
From: NEW AURORA CORPORATION
To: FACEBOOK, INC.
Reel/Frame 033847/0441 →
CHANGE OF NAME Recorded Jun 20, 2012
From: NETSCAPE COMMUNICATIONS CORPORATION
To: NEW AURORA CORPORATION
Reel/Frame 028450/0340 →
TERMINATION AND RELEASE OF SECURITY INTEREST IN PATENT RIGHTS Recorded Nov 16, 2010
From: BANK OF AMERICA, N A
To: AOL INC; AOL ADVERTISING INC; GOING INC; LIGHTNINGCAST LLC; MAPQUEST, INC; NETSCAPE COMMUNICATIONS CORPORATION; QUIGO TECHNOLOGIES LLC; SPHERE SOURCE, INC; TACODA LLC; TRUVEO, INC; YEDDA, INC
Reel/Frame 025323/0416 →
SECURITY AGREEMENT Recorded Dec 14, 2009
From: AOL INC.; AOL ADVERTISING INC.; BEBO, INC.; ICQ LLC; GOING, INC.; LIGHTNINGCAST LLC; MAPQUEST, INC.; NETSCAPE COMMUNICATIONS CORPORATION; QUIGO TECHNOLOGIES LLC; SPHERE SOURCE, INC.; TACODA LLC; TRUVEO, INC.; YEDDA, INC.
To: BANK OF AMERICAN, N.A. AS COLLATERAL AGENT
Reel/Frame 023649/0061 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 4, 1997
From: WILLIAMS, DAVID J.
To: NETSCAPE COMMUNICATIONS CORPORATION
Reel/Frame 008914/0975 →