发明名称 Optimizing intermediate representation of script code by eliminating redundant reference count operations
摘要 Disclosed here are methods, systems, paradigms and structures for optimizing generation of intermediate representation (IR) for a script code by eliminating redundant object reference count operations from the IR. An IR of the script includes (a) a set of first code that increments a reference count of an object when a programming construct refers to the object, and (b) an associated set of second code which decrements the reference count of the object when a reference to the object is removed. The IR is analyzed to identify a subset of the set of second code which, upon execution, does not decrement the reference count of the object to a zero value. The subset of second code and the first code corresponding to the subset is removed from the IR to generate an optimized IR. The optimized IR is further converted to an executable code.
申请公布号 US9383979(B2) 申请公布日期 2016.07.05
申请号 US201514614263 申请日期 2015.02.04
申请人 Facebook, Inc. 发明人 Adl-Tabatabai Ali-Reza;de Lima Ottoni Guilherme;Paleczny Michael
分类号 G06F9/45;G06F12/02 主分类号 G06F9/45
代理机构 Perkins Coie LLP 代理人 Perkins Coie LLP
主权项 1. A method comprising: generating, at a computer in a computer system, an intermediate representation of a script code, the intermediate representation being a form of the script code configured to be converted to an executable code for execution, the generating the intermediate representation including: generating, for an object allocated in a memory of the computer, a set of first code, at least some of the set of first code incrementing a reference count of the object when a programming construct refers to the object, the reference count indicating a number of references to the object, andgenerating a set of second code, at least some of the set of second code decrementing the reference count of the object when a reference of the programming construct referring to the object is removed; identifying, by the computer and in the intermediate representation, a second code of the set of second code which, upon execution, does not decrement the reference count of the object to a zero value; replacing the second code with a third code, the third code decrementing the reference count of the object when a reference of the programming construct referring to the object is removed, the third code indicative of a non-zero value yielding function; identifying, by the computer and in the intermediate representation, a first code of the set of first code corresponding to the third code; and removing, by the computer and from the intermediate representation, the first code and the third code.
地址 Menlo Park CA US