发明名称 Optimizing intermediate representation of script code for atomic execution
摘要 Disclosed here are methods, systems, paradigms and structures for optimizing intermediate representation (IR) of a script code for atomic execution. Atomic execution of the script is achieved by generating portions of the IR as an atomic transaction. In an atomic transaction, a series of operations either all execute, or none executes. The IR includes checkpoints that evaluate to one of two possible values. The checkpoint evaluates to a first value when there is no error during execution, and evaluates to a second value when an error occurs. The IR is optimized for atomic execution by regenerating a portion of the IR including the checkpoint and code associated with the checkpoint as a transaction. When an error occurs during the execution of the transaction, the transaction is aborted and a state of execution of the script code is reverted to a state prior to the beginning of the transaction.
申请公布号 US9317265(B2) 申请公布日期 2016.04.19
申请号 US201313850238 申请日期 2013.03.25
申请人 Facebook, Inc. 发明人 Adl-Tabatabai Ali-Reza;de Lima Ottoni Guilherme;Paleczny Michael
分类号 G06F9/45 主分类号 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 having intermediate code representing the script code; identifying, at the computer, a unit of intermediate code, the unit of intermediate code including (i) a checkpoint that evaluates to a first value or a second value and (ii) the intermediate code associated with the checkpoint, the intermediate code associated with the checkpoint including: a first set of code associated with a variable on which the checkpoint is operating, the first set of code causing the variable to evaluate to the first value or the second value and executing prior to execution of the checkpoint, anda second set of code that is dependent on a value of the variable; and regenerating, by the computer and in the intermediate representation, the unit of intermediate code as a transaction, the regenerating as a transaction including: causing, upon execution of the intermediate representation, to abort execution of the unit of intermediate code when the checkpoint evaluates to the second value, andcausing, upon abortion of the execution of the unit of intermediate code, a current state of execution of the intermediate representation to revert to a state that existed before the beginning of execution of the unit of intermediate code.
地址 Menlo Park CA US