发明名称 Flexible and run-time-modifiable inclusion of functionality in computer code
摘要 The current application is directed to flexible and run-time-modifiable implementation of crosscutting functionalities, including code instrumentation, error logging, and other such crosscutting functionalities. These crosscutting functionalities generally violate, or run counter to, modern code-development strategies and programming-language features that seek to partition logic into hierarchically organized compartments and modules with related functionalities, attribute values, and other common features. One feature of the methods and systems for implementing crosscutting functionalities to which the current application is directed is an intelligent switch that can be controlled, at run time, to alter invocation and behavior of crosscutting-functionality implementations, including data-collection instrumentation, error logging, and other crosscutting-functionality implementations.
申请公布号 US8997042(B2) 申请公布日期 2015.03.31
申请号 US201213652351 申请日期 2012.10.15
申请人 Pivotal Software, Inc. 发明人 Kew John Victor;Travis Jonathan
分类号 G06F9/44;G06F9/45;G06F9/455 主分类号 G06F9/44
代理机构 Fish & Richardson P.C. 代理人 Fish & Richardson P.C.
主权项 1. A method comprising: receiving, by a computing device, source code for compiling into executable processor instructions; receiving an aspect, the aspect comprising an advice and a pointcut, the advice including bytecode for collecting execution information of the executable processor instructions at run time, the pointcut specifying a location in the executable processor instructions to insert advice executable code generated from the advice; receiving an advice switch, the advice switch including bytecode of a conditional statement associated with a parameter and specifying that the advice executable code is to be invoked only if a condition specified by the parameter is satisfied; generating the executable processor instructions by weaving the source code, the aspect, and the advice switch together, wherein the weaving includes looping recursively through bytecode of each routine in the source code, each loop comprising: receiving a bytecode pointer pointing to a beginning or an end of a routine in the source code;determining that a current execution point corresponding to the beginning of the routine or the end of the routine corresponds to a point of execution defined by the pointcut;in respond to the determining, appending the bytecode of the advice and the bytecode of the advice switch to the bytecode of the routine at the current execution point andtranslating the appended bytecode into machine executable code, wherein the bytecode of the advice switch is translated into advice-switching code, and the bytecode of the advice is translated into advice executable code, the advice-switching code operable to invoke the advice executable code upon determining, by the advice-switching code and at the run time, that the condition is satisfied; and storing the executable processor instructions in a non-transitory storage device.
地址 Palo Alto CA US