High performance PHP

US9753697B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9753697-B2
Application numberUS-201414202809-A
CountryUS
Kind codeB2
Filing dateMar 10, 2014
Priority dateSep 30, 2009
Publication dateSep 5, 2017
Grant dateSep 5, 2017

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Markup language documents including server side scripting code using PHP syntax are executed efficiently in response to requests received by a server. The processing of the markup language document results in generation of a transformed markup language document that is returned in response to the request. The server side script code is input to a compiler that generates C++ code (or code in any object-based language based on C language) implementing the functionality of the server side script code. The C++ code is compiled to generated object code which is executed in order to process the markup language document. The generated C++ code includes functionality supported by PHP language including redeclaration of functions, dynamic variables, global variables, and the like. The generated C++ code invokes memory allocation code that allocates and deallocates objects obtained by instantiating the generated C++ classes.

First claim

Opening claim text (preview).

What is claimed is: 1. A computer-implemented method comprising: retrieving a markup language document including server side script code specified using personal home page (PHP) syntax, wherein the server side script code is for execution on a server in response to a request for the markup language document, the server side code specifying statements using one or more untyped variables; generating C++ code from the server side script code, wherein the generated C++ code comprises one or more C++ classes comprising code corresponding to the server side script code, the generating comprising: associating the untyped variable with a first type based on a first usage of the untyped variable in the script code, associating the untyped variable with a second type based on a second usage of the untyped variable in the script code, and inferring a type of the untyped variable to be an ancestor of both the first type and the second type in a hierarchy of types of variables; and compiling the generated C++ code to object code, wherein the object code is invoked for processing the markup language document. 2. The computer-implemented method of claim 1 , wherein the type of the untyped variable is inferred to be the least common ancestor of the first type and the second type in the hierarchy of types. 3. The computer-implemented method of claim 1 , wherein generating C++ code further comprises: mapping the type of the untyped variable to a C++ type; and defining a variable in the generated C++ code corresponding to the untyped variable, the defined variable having the mapped C++ type. 4. The computer-implemented method of claim 3 , wherein a primitive type of PHP is mapped to a primitive type of C++. 5. The computer-implemented method of claim 1 , wherein the generating comprises executing multiple passes through the script code, each pass inferring types of variables based on variable types inferred in a previous pass. 6. The computer-implemented method of claim 5 , wherein the generating further comprises stopping the execution of passes through the script code responsive to determining that a current pass inferred no new types compared to a previous pass. 7. The computer-implemented method of claim 1 , wherein the first usage comprises assigning the untyped variable to a constant, wherein the first type is determined to be the type of the constant. 8. The computer-implemented method of claim 1 , wherein the first usage comprises assigning the untyped variable to variable of a known type, wherein the first type is determined to be the known type. 9. The computer-implemented method of claim 1 , wherein the untyped variable is a parameter of a function and the first usage comprises an invocation of the function, wherein the type of the untyped variable is inferred to be a type of an argument passed to the function corresponding to the parameter. 10. The computer-implemented method of claim 1 , wherein the hierarchy of types organizes the types such that a least common ancestor of a numeric type and a string type is a variant type. 11. The computer-implemented method of claim 1 , wherein the hierarchy of types organizes the types such that a least common ancestor of an array type and an object type is a variant type. 12. A computer program product for storing object code on a non-transitory computer readable medium, the computer program product implementing functionality for efficiently executing server side script code, the computer program product comprising instructions for: retrieving a markup language document including server side script code specified using personal home page (PHP) syntax, wherein the server side script code is for execution on a server in response to a request for the markup language document, the server side code specifying statements using one or more untyped variables; generating C++ code from the server side script code, wherein the generated C++ code comprises one or more C++ classes comprising code corresponding to the server side script code, the generating comprising: associating the untyped variable with a first type based on a first usage of the untyped variable in the script code, associating the untyped variable with a second type based on a second usage of the untyped variable in the script code, and inferring a type of the untyped variable to be an ancestor of both the first type and the second type in a hierarchy of types of variables; and compiling the generated C++ code to object code, wherein the object code is invoked for processing the markup language document. 13. The computer program product of claim 12 , wherein the type of the untyped variable is inferred to be the least common ancestor of the first type and the second type in the hierarchy of types. 14. The computer program product of claim 12 , wherein instructions for generating C++ code further comprise instructions for: mapping the type of the untyped variable to a C++ type; and defining a variable in the generated C++ code corresponding to the untyped variable, the defined variable having the mapped C++ type. 15. The computer program product of claim 14 , wherein a primitive type of PHP is mapped to a primitive type of C++. 16. The computer program product of claim 12 , wherein the generating comprises executing multiple passes through the script code, each pass inferring types of variables based on variable types inferred in a previous pass. 17. The computer program product of claim 16 , wherein the generating further comprises stopping the execution of passes through the script code responsive to determining that a current pass inferred no new types compared to a previous pass. 18. The computer program product of claim 12 , wherein the first usage comprises assigning the untyped variable to a constant, wherein the first type is determined to be the type of the constant. 19. The computer program product of claim 12 , wherein the first usage comprises assigning the untyped variable to variable of a known type, wherein the first type is determined to be the known type. 20. The computer program product of claim 12 , wherein the untyped variable is a parameter of a function and the first usage comprises an invocation of the function, wherein the type of the untyped variable is inferred to be a type of an argument passed to the function corresponding to the parameter.

Assignees

Inventors

Classifications

  • Source to source · CPC title

  • Physics · mapped topic

  • G06F8/31Primary

    Programming languages or programming paradigms · CPC title

  • G06F40/143Primary

    Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD] · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9753697B2 cover?
Markup language documents including server side scripting code using PHP syntax are executed efficiently in response to requests received by a server. The processing of the markup language document results in generation of a transformed markup language document that is returned in response to the request. The server side script code is input to a compiler that generates C++ code (or code in any…
Who is the assignee on this patent?
Facebook Inc
What technology area does this patent fall under?
Primary CPC classification G06F8/31. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Sep 05 2017 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).