发明名称 Multiversioned functions
摘要 Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for receiving source code that contains a hot function that calls a multiversioned function, where a function definition of the multiversioned function specifies a first version and an alternative second version, and generating compiled code that includes a first and a second clone of the hot function, and a first and a second version of the multiversioned function. In the compiled code, the first clone of the hot function includes a direct call to the first version of the multiversioned function, and the second clone of the hot function includes a direct call to the second version of the multiversioned function.
申请公布号 US9081587(B1) 申请公布日期 2015.07.14
申请号 US201313775984 申请日期 2013.02.25
申请人 Google Inc. 发明人 Li Xinliang David;Tallam Sriraman
分类号 G06F9/45 主分类号 G06F9/45
代理机构 Fish & Richardson P.C. 代理人 Fish & Richardson P.C.
主权项 1. A computer-implemented method comprising: receiving source code that contains a cold function and a hot function, the hot function calls a multiversioned function, wherein a function definition of the multiversioned function specifies a first version and an alternative second version; conducting a dispatch check, wherein the dispatch check is hoisted from the hot function to the cold function for initiation; generating compiled code that includes: (1) a first clone of the hot function and a first version of the multiversioned function, wherein the first clone of the hot function includes a direct call to the first version of the multiversioned function, and (2) a second clone of the hot function and a second version of the multiversioned function, wherein the second clone of the hot function includes a direct call to the second version of the multiversioned function, wherein the cold function, the hot function, the first clone, the first version, the second clone, and the second version are distinct from each other; determining whether to use the first version of the multiversioned function or the second version of the multiversioned function, the determination based at least in part on the dispatch check; and selecting, based on the determination, either the first clone and first version of the multiversioned function or the second clone and the second version of the multiversioned function.
地址 Mountain View CA US