Methods and apparatuses for a compiler server
First Claim
1. A computer implemented method, comprising:
- in response to receiving a compilation request from an application to compile a source code, the compilation request including a preference to compile the source code, searching a cache for a compiled code that satisfies the compilation request, wherein the compilation request comprises security settings associated with the application, wherein the security settings associated with the application comply with security metadata in the compiled code if the compiled code satisfies the compilation request; and
sending a particular reply message including the compiled code to the application in response to the compilation request if the compiled code that satisfies the compilation request is available from the cache,wherein if the compiled code that satisfies the compilation request is not found within the cache, performing;
selecting a compiler from a plurality of compilers based on the preference of the compilation request, wherein the compiler is configured to compile source codes from a plurality of independent client applications;
instructing the compiler to build the compiled code from the source code for the compilation request;
detecting if the compiler fails to build the compiled code for the compilation request or if the compiler has successfully built the compiled code;
sending a reply message to the application in response to the compilation request, wherein the reply message includes the compiled code if the compiled code is successfully built for the compilation request, wherein the reply message indicates failure of the compiler if the compiler fails to build the compiled code for the compilation request;
automatically receiving, in response to the reply message indicating the failure, an alternative compilation request including an alternative preference from the application to compile the source code, wherein the alternative compilation request comprises the security settings associated with the application, the alternative compilation request indicating an alternative compiler allowed to compile the source code;
selecting the alternative compiler from the compilers based on the alternative compilation request to build the compiled code according to the alternative preference, wherein the alternative compiler matches the security settings of the application;
compiling the source code using the alternative compiler;
providing the application with an alternative reply including the compiled code built for the alternative compilation request; and
storing a copy of the compiled code with the security metadata, wherein the compiled code is available for future compilation request.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and an apparatus that instructs a compiler server to build or otherwise obtain a compiled code corresponding to a compilation request received from an application are described. The compiler server may be configured to compile source codes for a plurality of independent applications, each running in a separate process, using a plurality of independent compilers, each running in a separate compiler process. A search may be performed in a cache for a compiled code that satisfies a compilation request received from an application. A reply message including the compiled code can be provided for the application, wherein the compiled code is compiled in direct response to the request, or is obtained from the cache if the search identifies in the cache the compiled code that satisfies the compilation request.
68 Citations
20 Claims
-
1. A computer implemented method, comprising:
-
in response to receiving a compilation request from an application to compile a source code, the compilation request including a preference to compile the source code, searching a cache for a compiled code that satisfies the compilation request, wherein the compilation request comprises security settings associated with the application, wherein the security settings associated with the application comply with security metadata in the compiled code if the compiled code satisfies the compilation request; and sending a particular reply message including the compiled code to the application in response to the compilation request if the compiled code that satisfies the compilation request is available from the cache, wherein if the compiled code that satisfies the compilation request is not found within the cache, performing; selecting a compiler from a plurality of compilers based on the preference of the compilation request, wherein the compiler is configured to compile source codes from a plurality of independent client applications; instructing the compiler to build the compiled code from the source code for the compilation request; detecting if the compiler fails to build the compiled code for the compilation request or if the compiler has successfully built the compiled code; sending a reply message to the application in response to the compilation request, wherein the reply message includes the compiled code if the compiled code is successfully built for the compilation request, wherein the reply message indicates failure of the compiler if the compiler fails to build the compiled code for the compilation request; automatically receiving, in response to the reply message indicating the failure, an alternative compilation request including an alternative preference from the application to compile the source code, wherein the alternative compilation request comprises the security settings associated with the application, the alternative compilation request indicating an alternative compiler allowed to compile the source code; selecting the alternative compiler from the compilers based on the alternative compilation request to build the compiled code according to the alternative preference, wherein the alternative compiler matches the security settings of the application; compiling the source code using the alternative compiler; providing the application with an alternative reply including the compiled code built for the alternative compilation request; and storing a copy of the compiled code with the security metadata, wherein the compiled code is available for future compilation request. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A machine-readable non-transitory storage medium having instructions, when executed by a machine, cause the machine to perform a method comprising:
-
in response to receiving a compilation request from an application to compile a source code, the compilation request including a preference to compile the source code, searching a cache for a compiled code that satisfies the compilation request, wherein the compilation request comprises security settings associated with the application, wherein the security settings associated with the application comply with security metadata in the compiled code if the compiled code satisfies the compilation request; and sending a particular reply message including the compiled code to the application in response to the compilation request if the compiled code that satisfies the compilation request is available from the cache, wherein if the compiled code that satisfies the compilation request is not found within the cache, performing; selecting a compiler from a plurality of compilers based on the preference of the compilation request, wherein the compiler is configured to compile source codes from a plurality of independent client applications; instructing the compiler to build the compiled code from the source code for the compilation request; detecting if the compiler fails to build the compiled code for the compilation request or if the compiler has successfully built the compiled code; sending a reply message to the application in response to the compilation request, wherein the reply message includes the compiled code if the compiled code is successfully built for the compilation request, wherein the reply message indicates failure of the compiler if the compiler fails to build the compiled code for the compilation request; automatically receiving, in response to the reply message indicating the failure, an alternative compilation request including an alternative preference from the application to compile the source code, wherein the alternative compilation request comprises the security settings associated with the application, the alternative compilation request indicating an alternative compiler allowed to compile the source code; selecting the alternative compiler from the compilers based on the alternative compilation request to build the compiled code according to the alternative preference, wherein the alternative compiler matches the security settings of the application; compiling the source code using the alternative compiler; providing the application with an alternative reply including the compiled code built for the alternative compilation request; and storing a copy of the compiled code with the security metadata, wherein the compiled code is available for future compilation request.
-
-
14. An apparatus, comprising:
-
a memory storing executable instructions; a cache storing one or more compiled codes indexed according representations of source codes respectively corresponding to the compiled codes; and a processor coupled to memory and the cache, the processor being configured to execute the executable instructions from the memory to; in response to receiving a compilation request from an application to compile a source code, the compilation request including a preference to compile the source code, search the cache for a compiled code that satisfies the compilation request, wherein the compilation request comprises security settings associated with the application, wherein the security settings associated with the application comply with security metadata in the compiled code if the compiled code satisfies the compilation request, and send a particular reply message including the compiled code to the application in response to the compilation request if the compiled code that satisfies the compilation request is available from the cache, wherein if the compiled code that satisfies the compilation request is not found within the cache, the processor is configured to perform; selecting a compiler from a plurality of compilers based on the preference of the compilation request, wherein the compiler is configured to compile source codes from a plurality of independent client applications, instructing the compiler to build the compiled code from the source code for the compilation request, detecting if the compiler fails to build the compiled code for the compilation request or if the compiler has successfully built the compiled code, sending a reply message to the application in response to the compilation request, wherein the reply message includes the compiled code if the compiled code is successfully built for the compilation request, automatically receiving, in response to the reply message indicating the failure, an alternative compilation request including an alternative preference from the application to compile the source code, wherein the alternative compilation request comprises the security settings associated with the application, the alternative compilation request indicating an alternative compiler allowed to compile the source code, selecting the alternative compiler from the compilers based on the alternative compilation request to build the compiled code according to the alternative preference, wherein the alternative compiler matches the security settings of the application, compiling the source code using the alternative compiler, providing the application with an alternative reply including the compiled code built for the alternative compilation request, and storing a copy of the compiled code with the security metadata, wherein the compiled code is available for future compilation request.
-
-
15. A computer implemented method, comprising:
-
in response to receiving a JIT (Just In Time) compilation request from an application to compile a source code, sending a particular reply message including a compiled code that satisfies the JIT compilation request to the application if the compiled code is available from a cache, the JIT compilation request comprising security settings associated with the application, wherein the security settings associated with the application comply with security metadata in the compiled code if the compiled code satisfies the JIT compilation request, wherein if the compiled code that satisfies the JIT compilation request is not available within the cache, performing; identifying a compiler to compile the source code for the application according to the JIT compilation request from the application; determining if the identified compiler is currently loaded in a memory; invoking the identified compiler into the memory, if the identified compiler is not yet loaded, the identified compiler corresponding to a process created uniquely for the identified compiler; sending the JIT compilation request to the process corresponding to the identified compiler to compile the source code; detecting if the identified compiler fails to build the compiled code for the JIT compilation request or if the compiler has successfully built the compiled code; sending a reply message to the application in response to the JIT compilation request, wherein the reply message includes the compiled code if the compiled code is successfully built for the JIT compilation request, wherein the reply message indicates failure of the compiler if the compiler fails to build the compiled code for the JIT compilation request; automatically receiving, in response to the reply message indicating the failure, an alternative compilation request from the application to compile the source code wherein the alternative compilation request comprises the security settings associated with the application, the alternative compilation request indicating an alternative compiler allowed to compiled the source code; identifying the alternative compiler according to the alternative compilation request to compile the source code, wherein the alternative compiler matches the security settings of the application; compiling the source code using the alternative compiler; providing the application with the alternative reply including the compiled code built for the alternative compilation request; and storing a copy of the compiled code with the security metadata, wherein the compiled code is available for future compilation request. - View Dependent Claims (16, 17, 18)
-
-
19. A machine-readable non-transitory storage medium having instructions, when executed by a machine, cause the machine to perform a method, the method comprising:
-
in response to receiving a JIT (Just In Time) compilation request from an application to compile a source code, sending a particular reply message including a compiled code that satisfies the JIT compilation request to the application if the compiled code is available from a cache, the JIT compilation request comprising security settings associated with the application, wherein the security settings associated with the application comply with security metadata in the compiled code if the compiled code satisfies the JIT compilation request, wherein if the compiled code that satisfies the JIT compilation request is not available within the cache, performing; identifying a compiler from a plurality of compilers to compile the source code according to a preference of the JIT compilation request received from the application; determining if the identified compiler is currently loaded in a memory; invoking the identified compiler into the memory, if the identified compiler is not yet loaded, the identified compiler corresponding to a process uniquely created for the identified compiler; sending the JIT compilation request to the process corresponding to the identified compiler to compiled the source code; detecting if the identified compiler fails to build the compiled code for the compilation request or if the compiler has successfully built the compiled code; sending a reply message to the application in response to the compilation request, wherein the reply message includes the compiled code if the compiled code is built successfully, wherein the reply message indicates failure of the compiler if the compiler fails to build the compiled code for the JIT compilation request; automatically receiving, in response to the reply message indicating the failure, an alternative compilation request from the application to compile the source code wherein the alternative compilation request comprises the security settings associated with the application, the alternative compilation request indicating an alternative compiler allowed to compiled the source code; identifying the alternative compiler according to the alternative compilation request to compile the source code, wherein the alternative compiler matches the security settings of the application; compiling the source code using the alternative compiler; providing the application with the alternative reply including the compiled code built for the alternative compilation request; and storing a copy of the compiled code with the security metadata, wherein the compiled code is available for future compilation request.
-
-
20. A machine-readable non-transitory storage medium having instructions, when executed by a machine, cause the machine to perform a method, method comprising:
-
receiving, at a compiler server, a first run time compilation request from a first application which is executing to compile a first source code that satisfies the first run time compilation request, the first run time compilation request including a first preference to compile the source code, wherein the first run time compilation request comprises security settings associated with the application and wherein the security settings associated with the application comply with security metadata of the compiled code if the compiled code satisfies the compilation request; and sending a particular reply message including the compiled code to the application in response to the first run time compilation request if the compiled code that satisfies the compilation request is available from a cache, wherein if the compiled code that satisfies the compilation request is not available within the cache, performing; selecting a first one of one or more compilers based on the first preference of the first run time compilation request, each compiler loaded in a separate process, each compiler capable of building compiled code from the first source code; storing the first compilation request in a queue for the first compiler to compile the first source code to build the compiled code, wherein the queue is capable of storing a second run time compilation request received from a second application which is executing to compile a second source code; detecting if the first compiler has been unloaded without building the compiled code for the first run time compilation request of if the first compiler has successfully built the compiled code; sending a reply to the first application in response to the first run time compilation request, wherein the reply includes the compiled code if the compiled code is successfully built for the first compilation request, wherein the reply indicates there is an error for the first preference of the first run time compilation request if the first compiler has been unloaded; automatically receiving, in response to the sending of the reply indicating the error, an alternative compilation request from the first application to compile the source code, wherein the alternative compilation request includes an alternative preference to compile the source code, wherein the alternative compilation request comprises the security settings associated with the application, the compilation request indicating an alternative compiler allowed to compile the source code; selecting the alternative compiler from the compilers based on the alternative compilation request to build the compiled code according to the alternative preference of the alternative compilation request; compiling the source code using the alternative compiler; providing the application with an alternative reply including the compiled code built for the alternative compilation request; storing a copy of the compiled code in the cache with security metadata, wherein the compiled code is available for future compilation request; determining, subsequent to the detection that the first compiler has been unloaded, if the queue associated with the first compiler is not empty including at least the second run time compilation request; and automatically reloading the first compiler to build compiled code from the second source code for the second run time compilation request if the queue is determined not empty.
-
Specification