Member call declarative interception

By identifying and intercepting program call declarations in the compiler and replacing them with interceptor calls, the software runtime performance and security issues are solved, and the technical challenges of modifying software behavior at compile time are realized, improving runtime performance and security.

CN120476397APending Publication Date: 2025-08-12MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380090907.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-01-09
Filing Date
2023-12-29
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In the pursuit of software runtime performance improvement and security, prior art is difficult to modify software behavior at compile time, and runtime call changes are difficult to detect and optimize.

Method used

By enhancing the compiler to recognize and intercept call declarations in the program, replacing them with interceptor calls, the call changes are transferred from runtime to compile time, using the interceptor to modify the software behavior, and automatically perform the intercept declarations through the compiler.

Benefits of technology

Improves software runtime performance, enhances code comprehensibility and security, reduces runtime performance costs, and improves interception flexibility and code maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120476397A_ABST
    Figure CN120476397A_ABST
Patent Text Reader

Abstract

The improved compiler identifies an interception declaration in the source code and issues code that instead replaces a call to a specified article with a call to a specified interceptor. The source generator proactively modifies program behavior in any desired manner without introducing hidden security violations and without requiring edits required by program developers. The interception declaration is visible in source code and development tools. In some cases, different calls to a particular method at a respective location are intercepted by different alternate methods. Alternative methods have the same signature, or are otherwise compatible. Some interceptors specify selectable parameters. Method calls, field accesses, and attribute calls may be intercepted. Work for modifying program behavior is shifted from runtime to compilation in a program lifecycle, thereby improving runtime performance and eliminating JIT compilation security risks.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] Modern devices across a wide range of sectors have some form of computing power and operate based on software instructions executed using that computing power. A few examples of devices whose behavior relies on software include: cars, airplanes, ships, and other vehicles; robotic manufacturing tools and other industrial systems; medical equipment; cameras; inventory management and other retail or wholesale systems; and smartphones, tablets, servers, workstations, and other devices connected to the internet.

[0002] The firmware, operating systems, applications, and other software programs that direct the various behaviors of these and many other computing devices are developed by people who may be referred to as developers, programmers, engineers, or coders, for example, but who are collectively referred to herein as “developers.” Developers interact with source code editors, compilers, debuggers, profilers, and various other software development tools when developing software, which has a wide range of beneficial effects.

[0003] Despite the many advances that have been made, improvements in computer technology for software development or for software execution continue to be possible and worth pursuing. Summary of the Invention

[0004] Some embodiments described herein address technical challenges in computer technology, and more specifically, address technical challenges that arise when pursuing improved software runtime performance and when pursuing safe but powerful functions to modify software behavior. Some embodiments described herein include an enhanced compiler that recognizes declarations for interception of member calls and then implements the interception by issuing appropriate instructions. The declaration occurs in the source code of the program and specifies both an interceptor and an artifact to be intercepted. The implementation includes an interceptor or a reference to an interceptor and specifies one or more calls to be intercepted so that when the compiled program runs, the interceptor is called instead of the artifact to be intercepted. The benefit of this enhancement is that software runtime performance is improved by transferring call changes from runtime to compile time. Because the interception is declared in source code that can be checked at compile time, another benefit is that the enhancement provides a safe but powerful function to modify software behavior.

[0005] Other technical activities and features related to the description herein will also become apparent to those skilled in the art. The examples given are illustrative only. This summary is not intended to identify the key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. On the contrary, this summary is provided to introduce some technical concepts in a simplified form, which will be further described in the specific embodiments below. The present invention is defined by the claims as properly understood, and in the event of a conflict between this summary and the claims, the claims shall prevail. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] A more detailed description will be given with reference to the accompanying drawings, which depict only selected aspects and are therefore not intended to be exhaustive in their coverage or scope.

[0007] Figure 1 is a schematic diagram illustrating aspects of a computer system and also illustrating configured storage media, including aspects of a system generally adapted to provide member call declarative interception functionality;

[0008] Figure 2 is a block diagram illustrating an enhanced system configured with member call declarative interception functionality;

[0009] Figure 3 is a block diagram illustrating various aspects of a system enhanced with various aspects of member call declarative interception functionality;

[0010] Figure 4 is a block diagram illustrating some additional aspects of the member call declarative interception functionality;

[0011] Figure 5 is a flowchart illustrating steps in the process of declarative interception support for some member invocations; and

[0012] Figure 6 It is a combination Figure 5 The flowchart further illustrates some steps in the process of member call declarative interception. DETAILED DESCRIPTION

[0013] Overview

[0014] Innovations can extend beyond their origins, but understanding their origins can help people understand them more fully. In the present context, some of the explanations described in this article were driven by the technical challenges faced by Microsoft innovators who were working on improving techniques for replacing method calls in programs.

[0015] The innovators noted that some techniques for replacing method calls within a program operate at runtime and are external to the program itself. Some techniques use external programs to manipulate existing computations at runtime to replace method calls; others involve rewriting the program's intermediate language before runtime, but after compilation. Furthermore, some techniques rely on the program's developer to modify the program's source code in order to change method calls. The innovators also observed that familiar source generators can add source code to a program at compile time, but these source generators do not modify the program's existing source code or existing method calls.

[0016] The innovators hypothesized that the compiler could be enhanced to recognize declarations of changes to method calls in the source code, without requiring the developer who wrote the original call to modify the program's source code itself. This would have several benefits. One benefit is that it would relieve the developer of the work required to allow changes in method call invocations—the changes could be performed proactively and automatically by appropriately enhanced source code generators and compilers. Another benefit is that network security is improved by the presence of declarations in the source code rather than by making less annotated and difficult-to-detect call changes at runtime. In fact, the declared interception is inspectable by enhanced development tools, for example, the enhanced tools could highlight the intercepted method in a different color, or hover the cursor over the method call to pop up the actual target of the call. A third benefit is that runtime performance is improved by shifting the call changes and associated performance costs to compile time rather than runtime.

[0017] Therefore, innovators face the technical challenge of how to specify call changes in the source code. This challenge includes some component challenges, such as determining which calls will be intercepted and which calls will not be intercepted and why, and determining how to minimize the impact of call changes on compiler performance.

[0018] Some embodiments utilize or provide a compiler that performs compilation of source code containing declarations of interception implemented by an interceptor of the artifact to be intercepted. The compiler issues instructions (i.e., one or more instructions) that implement a call change from a non-intercepted call of the artifact to be intercepted to a call to the interceptor. This technically has the benefit of annotating the call change in the source code, which enhances code understandability, code maintainability, and code security. This technically also has the benefit of improving runtime performance by shifting the call change to compile time rather than runtime, for example by setting the call change once when the program is compiled rather than each time the program is run.

[0019] Some embodiments collect the list of interceptions before issuing instructions that implement the listed interceptions. This has the technical benefit of reducing the impact of interceptions on compiler performance. For example, by pre-computing the list of intercepted methods, the compiler avoids performing an extra pass through the generated source code to check for interceptions every time a method call is reached during compilation.

[0020] Some embodiments intercept a method's call site at a first call site location and avoid intercepting the method's second call site at a second call site location, thereby limiting interception of the method based on the method's call site location(s) specified by the interception declaration(s). This technically has the benefit of increasing interception flexibility by allowing specific calls to the method to be intercepted rather than forcing interception of every call to the method.

[0021] In some embodiments, the artifact to be intercepted includes at least one of the following: a method, a field of a data structure, a property of an object, or a member of an object. This has the technical benefit of increasing the flexibility of interception by allowing more interceptions than method calls and by allowing the interceptor and the artifact to be intercepted to be members of different types. For example, the result of the interception in some embodiments is that the read of field A is intercepted by a method call. In other words, instead of reading field A, method B is called, and then the return value from the method B call is used to replace the contents of field A during program execution.

[0022] In some cases, embodiments provide functionality for performing aspect-oriented programming, such as injecting pre / post code for tracing, logging, or diagnostics. Some embodiments provide safe yet powerful functionality for modifying software behavior while still allowing dynamic creation of interceptors, for example by plugging into a compiler's source generator. In some embodiments and some cases, interceptors are created directly by the developer; in other cases, interceptors are generated by tools that have the same access rights as the compiler.

[0023] These and other benefits will be apparent to those skilled in the art from the description provided herein.

[0024] Operating Environment

[0025] refer to Figure 1, an operating environment 100 for an embodiment includes at least one computer system 102. Computer system 102 may or may not be a multi-processor computer system. The operating environment may include one or more machines in a given computer system, which may be clustered, client-server networked, and / or peer-to-peer networked within a cloud 136. Individual machines are computer systems, and other groups of networked or collaborating machines are also computer systems. A given computer system 102 may be configured for end users (e.g., with applications), for administrators, as a server, as a distributed processing node, and / or configured in other ways.

[0026] Human users 104 sometimes interact with a user interface 130 of computer system 102 via typed text, touch, voice, movement, computer vision, gestures, and / or other forms of I / O using display 126, keyboard 106, and other peripherals 106. In some embodiments, system 102 provides virtual reality or augmented reality functionality, or both. Screen 126 is a removable peripheral 106 in some embodiments and is an integral part of system 102 in some embodiments. User interface 130 supports interaction between an embodiment and one or more human users. In some embodiments, user interface 130 includes one or more of a command line interface, a graphical user interface (GUI), a natural user interface (NUI), a voice command interface, or other user interfaces (UIs) presented or integrated as different options.

[0027] System administrators, network administrators, cloud administrators, security analysts and other security personnel, operations personnel, developers, testers, engineers, auditors, and end users are all specific types of human users 104. In some embodiments, automated agents, scripts, playback software, devices, and the like that run or otherwise serve on behalf of one or more humans also have user accounts, such as service accounts. Sometimes, a user account is created or otherwise provided as a human user account, but is actually used primarily or solely by one or more services; such an account is a de facto service account. Although a distinction can be made, "service account" and "machine-driven account" are used interchangeably herein and are not limited to any particular vendor.

[0028] Storage devices or networking devices, or both, may be considered peripheral devices in some embodiments and considered part of system 102 in other embodiments, depending on their removability from processor 110. In some embodiments, for example, Figure 1 Other computer systems not shown in the drawings interact with the computer system 102 or another system embodiment in a technical manner using one or more connections to the cloud 136 and / or other networks 108 via network interface devices.

[0029] Each computer system 102 includes at least one processor 110. As with other suitable systems, the computer system 102 also includes one or more computer-readable storage media 112, also referred to as computer-readable storage devices 112. In some embodiments, the tools 124 include security tools or software applications on the mobile device 102, workstation 102, or server 102, compilers 122 and other software development tools, as well as APIs, browsers or web pages, and corresponding software for protocols such as HTTPS. Files, APIs, endpoints, and other resources can be accessed by an account or collection of accounts, a user 104 or group of users 104, an IP address or group of IP addresses, or other entities. Access attempts can present a password, digital certificate, token, or other type of authentication credential.

[0030] Storage media 112 comes in different physical types, with some examples of storage media 112 being volatile memory, non-volatile memory, media that is fixed in place, removable media, magnetic media, optical media, solid-state media, and other types of physically durable storage media (as opposed to merely propagating signals or energy). Specifically, in some embodiments, a configured storage medium 114, such as a portable (i.e., external) hard drive, CD, DVD, memory stick, or other removable non-volatile storage medium, functionally becomes a part of the computer system when inserted or otherwise installed, making its contents accessible for interaction with and use by processor 110. Removable configured storage media 114 is an example of computer-readable storage media 112. Some other examples of computer-readable storage media 112 include built-in RAM, ROM, hard drives, and other memory storage devices that are not readily removable by user 104. For purposes of current U.S. patent requirements, under any pending or issued U.S. claim, computer-readable media, computer-readable storage media, and computer-readable memory are not signals per se, nor are they merely energy.

[0031] Storage device 114 is configured with binary instructions 116 executable by processor 110; "executable" is used herein in a broad sense to include, for example, machine code, interpretable code, bytecode, and / or code executed on a virtual machine. Storage media 114 is also configured with data 118 that is created, modified, referenced, and / or otherwise used for technical effects by the execution of instructions 116. Instructions 116 and data 118 configure the memory or other storage medium 114 in which they reside; when such memory or other computer-readable storage medium is a functional part of a given computer system, instructions 116 and data 118 also configure that computer system. In some embodiments, a portion of data 118 represents real-world items, such as events, product characteristics, inventory, physical measurements, settings, images, readings, volumes, etc., as manifested in the system 102 hardware. This data is also transformed through backup, restore, commit, abort, reformat, and / or other technical operations.

[0032] Although the embodiments are described as being implemented as software instructions executed by one or more processors in a computing device (e.g., a general-purpose computer, a server, or a cluster), such description is not intended to be exhaustive of all possible embodiments. It will be understood by those skilled in the art that the same or similar functions may also be directly implemented in hardware logic, in whole or in part, to provide the same or similar technical effects. As an alternative or supplement to software implementation, the technical functions described herein may be performed at least in part by one or more hardware logic components. For example, and without excluding other implementations, some embodiments include one or more of the following: hardware logic components 110, 128, such as field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-chip components (SOCs), complex programmable logic devices (CPLDs), and similar components. In some embodiments, for example, components are grouped into interactive functional modules based on their inputs, outputs, or their technical effects.

[0033] In addition to the processor 110 (e.g., CPU, ALU, FPU, TPU, GPU and / or quantum processor), memory / storage media 112, peripheral devices 106, and display 126, some operating environments also include other hardware 128, such as batteries, buses, power supplies, wired and wireless network interface cards. The terms "screen" and "display" are used interchangeably herein. In some embodiments, the display 126 includes one or more touch screens, a screen that responds to input from a pen or tablet, or a screen that operates only for output. In some embodiments, peripheral devices 106, such as human user I / O devices (screen, keyboard, mouse, tablet, microphone, speaker, motion sensor, etc.), will be in operable communication with the one or more processors 110 and memory 112.

[0034] In some embodiments, the system includes multiple computers connected via a wired and / or wireless network 108. The network interface device 128 can provide access to the network 108 using, for example, network components present in some computer systems (such as packet-switched network interface cards, wireless transceivers, or telephone network interfaces). In some embodiments, for example, in a software-defined network or sandbox or other secure cloud computing environment, there is also virtualization of the networking interface device and other network components (such as switches or routers or firewalls). In some embodiments, one or more computers are partially or completely "air-gapped" due to being disconnected or only intermittently connected to another networked device or remote cloud. Specifically, the member call declarative interception function 204 can be installed on the air-gapped network and then updated periodically or occasionally, or not at all, using removable media 114. Some embodiments also transmit technical data or technical instructions or both via direct memory access, removable or non-removable volatile or non-volatile storage media, or other information storage-retrieval and / or transmission methods.

[0035] Those skilled in the art will appreciate that the foregoing and other aspects presented herein in the context of an "operating environment" form part of some embodiments. The headings herein are not intended to provide a strict classification of features into embodiment and non-embodiment feature sets.

[0036] One or more items are shown in outline form in the figures, or listed in parentheses, to emphasize that they are not necessarily part of the operating environment or all embodiments shown, but are interoperable with the operating environment or items in some embodiments as discussed herein. Therefore, any item that is not in outline or parentheses in any figure or any embodiment is not required. Specifically, for convenience, the following are provided. Figure 1 ; Items included in Figure 1 There is no representation that the item or the described use of the item was known prior to the current innovation.

[0037] In any subsequent application claiming priority from the present application, reference numerals may be added to designate items disclosed in the present application. Such items may include, for example, software, hardware, steps, processes, systems, functions, mechanisms, data structures, resources, intercepts or other algorithmic implementations, or other items in a computing environment that are disclosed herein but are not associated with specific reference numerals herein. Corresponding figures may also be added.

[0038] Detailed information about the system

[0039] Figure 2A computing system 102 is shown configured with one or more of the member call declarative interception enhancements described herein, resulting in an enhanced system 202. In some embodiments, the enhanced system 202 includes a single machine, a local network of machines, machines in a particular building, machines used by a particular entity, machines in a particular data center, machines in a particular cloud, or another computing environment 100 that is suitably enhanced. Figure 2 Items of are discussed at various points herein, and additional details regarding them are provided in the discussion of the list of reference numerals later in this disclosure document.

[0040] Figure 3 Some aspects of some enhancement systems 202 are shown. This is not a comprehensive overview of all aspects of the enhancement system 202 or all aspects of the member call declarative interception functionality 204. Nor is it a comprehensive overview of all aspects of the environment 100 or system 202 or other contexts of the enhancement system 202, or a comprehensive overview of all member call declarative interception mechanisms 204 that are potentially used in or with the system 102. Figure 3 Items of are discussed at various points herein, and additional details regarding them are provided in the discussion of the list of reference numerals later in this disclosure document.

[0041] Figure 4 Some additional aspects of some enhancement systems 202 are shown. This is not a comprehensive overview of all additional aspects of the enhancement system 202 or all aspects of the member call declarative interception functionality 204. Figure 4 Items of are discussed at various points herein, and additional details regarding them are provided in the discussion of the list of reference numerals later in this disclosure document.

[0042] Other figures are also related to the system 202. Specifically, Figure 5 and Figure 6 The process of operation of system 202 is shown.

[0043] In some embodiments, enhancement system 202 is networked through interface 324. In some embodiments, interface 324 includes hardware such as a network interface card, software such as a network stack, API or sockets, a combination of items such as a network connection, or a combination thereof.

[0044] Some embodiments include a computing system 202 comprising: a digital memory 112 and a processor set 110 comprising at least one processor, the processor set being in operable communication with the digital memory. A system configured to support declarative interception 212 of member calls also includes a compiler 122 that, when executed by the processor set, performs 504 compilation of source code 134. The source code includes a declaration 214 of an interception 212 of an artifact 304 to be intercepted by an interceptor 218. The source code also specifies 604 the artifact to be intercepted. The artifact to be intercepted has a non-intercepted call 306, 210. During compilation, the compiler issues 506 an instruction 116 to implement 606 a call change 508 from a non-intercepted call 306, 210 to a call 308, 210 to an interceptor 218 within a call statement 444. The compiler 122 also issues 506 an instruction 116 to implement 606 a reference 220 to the interceptor or an instruction 116 to implement 606 the interceptor 218, or both. Thus, when executing the compiler 122 , the system 202 configures an executable program 310 based on the source code 134 , and execution 602 of the executable program calls 210 the interceptor 218 instead of calling 210 the artifact to be intercepted 304 .

[0045] In some embodiments, the source code 134 includes instructions 214 about what members should be intercepted and by what; these instructions may have been explicitly written by the developer, or they may have been automatically generated by a source code generator 438 called by the compiler. When the compiler emits 506 the output of the compilation (e.g., IL, asm, etc.), it outputs the call but with the target of the interception. Thus, if A is to be replaced by B, the enhanced compiler does not emit "call A" but instead emits 506 "call B", as if the original source code already contained a call for B. The compiler does not necessarily emit instructions about changing the call, for example, it does not necessarily indicate in the emitted code that the instruction to "call A" is replaced with "call intercept A". Inspection of the resulting emitted IL / asm will show the result as if the developer had explicitly called the interceptor. In these embodiments, the only way to tell that the interception mechanism was involved by looking at the resulting IL / asm is if a) the compiler explicitly leaves a clue that it did so, such as by adding an attribute in the metadata, e.g., [assembly:CompilerReplaced("A","B")], or b) by inspecting code built into the assembly that includes the original interception instruction.

[0046] Some embodiments include a compiler 122 that compiles the interception along with the intercepted code. As an example, assume that source code 134 includes a method foo() and also includes a statement 214 that calls 210, 448 to foo() should be intercepted and instead call bar(). In this example, bar() is the interceptor 218 and foo() is the artifact 304 to be intercepted. The address 432 of the code of foo() is a non-intercepted address, the address 432 of bar() is the address of the interceptor, and the access statement 444 is a call to foo().

[0047] In some cases, the compiled code will contain code for foo(), will contain code for bar(), and will contain code for the call to foo() modified to be a call to bar(). In some cases, method foo() is implemented in library 446, which is referenced by the current program. In some cases, method foo() exists in compiled binary form on machine 101 where compilation 504 occurs; the source code for method foo() may not necessarily exist on the machine where compilation occurs. Similarly, bar() may also be implemented in library 446.

[0048] In some embodiments, only method 404 is interceptable, while in other embodiments, other members 208 can also be intercepted via declaration 214 and compiler enhancements. In some embodiments, artifact 304 to be intercepted includes at least one of the following: method 404, field 422 of data structure 424, property 428 of object 426, or member 208 of object 426.

[0049] However, in at least some embodiments, artifact to be intercepted 304 excludes any exception vector table because the compiler cannot access the vector table. In some embodiments, artifact to be intercepted 304 excludes any of the following due to lack of available information, complexity of checking compatibility of replacement artifact 218, or both: an exception, an exception try block, an exception catch block, or an exception handler; a compound statement; a statement marked with a jump label to a go statement; an interrupt handler; or a vector in a vector table.

[0050] In some embodiments, the address 432 of call 210 can be altered by interception. In some embodiments, non-intercepted call 306 includes at least one of the following: subroutine 430 address 432, base address 434 of data structure 424, or offset address 436 into data structure 436. A method is an example of a subroutine 430; some other examples include co-routines and handlers. Depending on the embodiment and the particular declaration 214, interception can accordingly produce a change 508 where program 310 executes 602 to perform one or more of the following: (a) access (read or write) subroutine X instead of performing a originally programmed access to subroutine Y; (b) access an object or other data structure at base address A instead of performing a originally programmed access to another object or data structure at base address B; (c) access field FR at offset address R of a data structure instead of performing a originally programmed access to field FS at offset address S of the data structure. Furthermore, depending on the embodiment and declaration 214, interception 212 can replace an access to field 422 with an access to subroutine 430, or vice versa. In some embodiments, interception replaces a call to one target 208 with a call to a different target 208 of a compatible signature (eg, by replacing a memory address for a method call).

[0051] Some embodiments use an IDE (stand-alone source code editor) or other development tools to enable developers to examine declarations 214. In some embodiments, a developer can right-click on an intercepted method 404, 304, select "Go to Definition" or equivalent, and be displayed the intercepted method 404, 218 instead of any original definition of the method, or together with the original definition of the method. Some embodiments display the intercepted method in different ways, such as in a color different from the normal color used for method calls, and some embodiments display decorations or icons next to the line where the call has been intercepted. Some embodiments receive a selection of a method 404 and, in response, enumerate all relevant intercept declarations 214, intercepted (or other) call sites 408, and interception location identifiers 314.

[0052] In some embodiments, interception is not limited to intercepting method calls. For example, consider this C# code:

[0053] Action a=Foo;

[0054] Bar(a); ...

[0056] static void Bar(Action a)=>a();

[0057] This code creates a delegate (function pointer) to method Foo and passes the Action delegate. When Action is subsequently called, the original method Foo will be called. In some embodiments, this is interceptable, so that if the developer has a method Zoo that is an interceptor for Foo, the example code will compile as if it were written as: Action a = Zoo;

[0058] Bar(a);

[0059] Some embodiments include a software development tool 124 having a user interface 130 , and when executed by the set of processors 110 , the user interface displays 608 a declaration 214 for interception and also displays 610 a source code specification of the artifact 304 to be intercepted.

[0060] In some embodiments, interception declarations and interceptors are created by a source generator 438. Some embodiments include a source generator 438, and the declarations 214 for interceptions are output of the source generator.

[0061] Other system embodiments are also described herein, either directly or as system versions of the media of the described processes or configurations, suitably informed by the extensive discussion of computing hardware herein.

[0062] Although specific examples of member call declarative interception architectures are shown in the figures, embodiments may deviate from those examples. For example, in embodiments, items shown in different figures may be included together, items shown in figures may be omitted, functions shown in different items may be combined into fewer items or into a single item, items may be renamed, or items may be connected to each other in different ways.

[0063] Examples are provided in this disclosure to help illustrate various aspects of the technology, but the examples given herein do not describe all possible embodiments. A given embodiment may include, for example, additional or different types of member call declarative interception functionality, as well as different technical features, aspects, mechanisms, software, expressions, operation sequences, data structures, environments or system characteristics, or other functionality consistent with the description provided herein, and may otherwise depart from the specific examples provided.

[0064] Process (also called method)

[0065] Processes (also referred to as "methods" in the legal sense of the word) are illustrated herein in various ways in the text and drawings. Figure 5 and Figure 6Each shows a process family 500 and 600, respectively, which are performed or assisted by some enhancement system, such as some system 202 or another member call declarative interception enhancement system as described herein. Process family 500 is a proper subset of process family 600.

[0066] Figures 1 to 4 The architecture of a member call declarative interception system 202 is shown with implicit or explicit actions, such as parsing source code to identify declarations 214, creating or accessing internal compiler data structures (such as abstract syntax trees, symbol tables, and intermediate representations), lexical analysis, static analysis, and other compilation 504 activities that do not necessarily involve call interception, or otherwise processing data 118, where the data 118 includes, for example, source code 134, location identifiers 314, optional parameters 316, and virtual methods 322, as well as other examples disclosed herein.

[0067] Unless otherwise indicated, the technical processes shown in the figures or otherwise disclosed are performed automatically, for example, by augmentation system 202. To the extent that human action is involved, for example, in some cases, human 104 typing source code 134, the related unclaimed processes may also be performed partially automatically and partially manually. However, the processes contemplated herein as innovative are not entirely manual or purely mental; none of the claimed methods can be performed solely in a human mind or on paper. Any claim interpretation to the contrary is completely inconsistent with this disclosure.

[0068] In a given embodiment, zero or more of the illustrated steps of a process may be repeated, possibly using different parameters or data to perform the operation. The steps in the embodiments may also be repeated in the same manner as in the examples. Figure 6 The order in which the layout is done is different from the order from top to bottom. Figure 6 It is a supplement to the text examples of the embodiments provided herein and the text description of the embodiments provided herein. Figure 6 In the event of any alleged inconsistency, lack of clarity, or excessive breadth arising from any aspect or interpretation of the present disclosure, the text of the present disclosure shall take precedence over Figure 6 that aspect or explanation of.

[0069] Arrows in a process or data flow diagram indicate permissible flows; arrows pointing in more than one direction thus indicate that flow can proceed in more than one direction. Steps may be performed serially, in a partially overlapping manner, or completely in parallel within a given process. Specifically, the order in which the flowchart 600 action items are traversed to indicate the steps performed during a process may vary from one execution of the process to another. The flowchart traversal order may also vary from one process embodiment to another. Steps may also be omitted, combined, renamed, regrouped, performed on one or more machines, or otherwise depart from the process shown if the process performed is operable and complies with at least one claim of an application or patent that includes or claims priority to the present disclosure. To the best of the knowledge of a skilled artisan Figure 6 To the extent that a given sequence of steps S is not operable in accordance with the present disclosure, the sequence S is not within the scope of any claim. Any assertion in any other manner is contrary to the present disclosure.

[0070] Some embodiments provide or utilize a process 600 performed by a computing system 202 to support declarative interception of member calls. The process includes identifying 502 a declaration 214 of interception of an artifact to be intercepted by an interceptor in source code, the source code further specifying 604 the artifact to be intercepted, the artifact to be intercepted having a non-intercepted member call; during compilation 504 of the source code, issuing 506 instructions to implement a member call change 508 within the call statement from the non-intercepted member call to a call to the interceptor; wherein the process generates 630 an executable program based on the source code and configured to call the interceptor instead of calling the artifact to be intercepted.

[0071] In some embodiments, the intercept has a location identifier 314. Some examples of intercept location identifiers are:

[0072] [InterceptsLocation("Program.cs",startLine:20,endLine:31)] / / Code block [InterceptsLocation(CallSite("Program.cs",35)] / / The 35th call site from top to bottom in Program.cs [InterceptsLocation(CallSite(3248)] / / The 3248th call site in the executable file [InterceptsLocation(CallSite("mySite")] / / The call site is marked as "mySite" in the executable file

[0073] In some embodiments, the process 600 includes annotating 614 the interception location identifier in the intercepted statement. Subsequently, the instructions issued 506 are customized to match the identified location 312.

[0074] Some embodiments pre-compute the list of blocked artifacts for more efficient compilation.In some embodiments, process 600 includes collecting 616 the interception list before issuing 506 instructions to implement the listed interceptions.

[0075] In some embodiments, process 600 includes emitting 506 during compilation instructions configured to intercept virtual method 322 calls 448 by replacing 212 virtual method 322 calls 448 with non-virtual static method 320 calls 448 .

[0076] In some embodiments, interceptor 218 includes a method with optional parameters 316. In some embodiments, the optional parameters are not present on the item being intercepted, but are populated by the compiler using additional information about the item being intercepted, such as source code location.

[0077] In some embodiments, process 600 includes re-evaluating 622 an interception after receiving 612 an edit 406 to source code during a debugging session 442. In some cases, the interception interacts with debugging 440, for example, by changing interceptors 218 during the edit and continuing debugging. Thus, in some embodiments, re-evaluating 622 includes re-running 602 source generator 438.

[0078] In some embodiments, the interceptor includes a static interceptor method, the artifact to be intercepted includes the artifact method to be intercepted, and the signature 416 of the static interceptor method matches 632 the signature 416 of the artifact method to be intercepted. For example, in some embodiments, the static method is checked 632 to confirm that it has a signature that matches the intercepted method.

[0079] In some embodiments, interception is limited to method calls at a specified location 626. The code 134 and compiler 122 limit the call sites where interception occurs by including an [InterceptsLocation] attribute or similar indicator 314. Such an indicator 314 can specify a file path and optionally a line and column range. The compiler will then only intercept calls that occur at that location. In some embodiments, [InterceptsLocation] or another intercept location identifier 314 is associated with the interceptor 218 rather than the interceptee 304 because the interceptor is only used when the call site matches the location 312 in the identifier.

[0080] In some embodiments, the article to be intercepted includes a method, the process 600 intercepts the first method call site 408 of the method at the first method call site location 312, and the process 600 avoids 626 intercepting the second method call site 408 of the method at the second method call site 408 location, thereby limiting 626 the interception 212 of the method based on the method call site location 312.

[0081] In some embodiments, process 600 includes at least one of issuing 506 an instruction to implement 606 an interceptor, or issuing 506 an instruction to implement an artifact to be intercepted.

[0082] Some embodiments map M interceptors to N artifacts to be intercepted. Specifically, this allows methods generated by M source generators to intercept methods written by N developers. In some embodiments, process 600 includes issuing 506 an instruction to map 636 M interceptors to N artifacts to be intercepted, where M and N are both integers greater than 1. This mapping capability provides significant flexibility. For example, the get data method 304 can be mapped to a public cloud get data method for some calls, to a local network get data method for some other calls, and to a default value for the rest of the calls, while the set data method can similarly be mapped to a public cloud, local network, or default value version.

[0083] Configured storage media

[0084] Some embodiments include a configured computer-readable storage medium 112. Some examples of storage media 112 include disks (disks, optical disks or other), RAM, EEPROM or other ROMs, and other configurable memories, particularly including computer-readable storage media (which are not only propagation signals). In some embodiments, the configured storage medium is particularly a removable storage medium 114, such as a CD, DVD or flash memory. Depending on the embodiment, the general-purpose memory can be removable or non-removable and volatile or non-volatile, and in an embodiment, items such as user interface 130 instructions 116, compiler 122 instructions 116 and data structures 424, interception declarations 214 in source code 134, interception location identifiers 314 in source code 134, and interception lists 318 can be used to configure in the form of data 118 and instructions 116 read from removable storage media 114 and / or another source such as a network connection to form a configured storage medium. As disclosed herein, the configured storage medium 112 enables a computer system 202 to perform a technical process step for providing or utilizing a member call declarative interception function 204. Thus, the accompanying drawings help illustrate configured storage medium embodiments and process (also referred to as method) embodiments, as well as system and process embodiments. Specifically, Figure 5 or Figure 6Any process steps shown in or otherwise described herein may be used to help configure a storage medium to form a configured storage medium embodiment.

[0085] Some embodiments use or provide a computer-readable storage device 112, 114 configured with data 118 and instructions 116 that, when executed by a processor 110, cause a computing system 202 to perform a process 600 to support declarative interception of member calls. The process includes identifying 502 a declaration of interception 212 of an artifact 304 to be intercepted by an interceptor 218 in source code, the source code further specifying 604 the artifact to be intercepted, the artifact to be intercepted having a non-intercepted address 432; during compilation 504 of the source code, issuing 506 instructions to implement an address change 508 within an access statement 452 from the non-intercepted address 432 to the interceptor's address 432; wherein the process 600 generates 630 an executable program 310 that is based on the source code and is configured to access 450 the interceptor instead of accessing 450 the artifact to be intercepted.

[0086] In some embodiments, process 600 includes issuing 506 an instruction to implement 216 an interceptor, and issuing 506 an instruction to implement 634 an artifact to be intercepted.

[0087] In some embodiments, process 600 includes calculating 620 parameter values 454 for optional parameters 316 of the interceptor.

[0088] In some embodiments, declaration 214 occurs in attribute 418 .

[0089] In some embodiments, process 600 replaces 628 a call to a member with a compatible expression 402, i.e., an expression that is equivalent to method 404 in type 414 and all unbound variables 410 in the compatible expression are equivalent in name 412 and type 414 to the unbound variables 410 in the replaced call 210.

[0090] Other comments

[0091] Additional support for the discussion of the member call declarative interception functionality 204 herein is provided under various headings. However, all are intended to be understood as an integrated and integral part of the present disclosure's discussion of contemplated embodiments.

[0092] Those skilled in the art will recognize that not every part of this disclosure, or any specific detail therein, must meet legal standards such as enablement, written description, best mode, novelty, non-obviousness, inventive step, or industrial applicability. Any apparent conflict with any other patent disclosure, even from the owner of the present invention, has no effect in interpreting the claims presented in this patent disclosure. With this understanding in mind, all parts of this disclosure are presented, and examples and observations are provided herein.

[0093] Some embodiments provide a mechanism by which a program can declaratively intercept method calls and their parameters from other parts of the program. Other ways of doing this rely on mechanisms external to the program. Using function 204, the program can rewrite itself to intercept calls. This solves the problems discussed herein, such as forcing developer involvement, avoiding reliance on JIT compilation, surreptitious changes to program behavior at runtime, and limiting conventional source generators to simply augmenting program source code.

[0094] In some embodiments, a "memory access target" can be, for example, a method, property, field, or member of an object (these examples overlap in some programming languages). A method is a memory access target that is distinguished from other methods by an address in a call statement; if method A and method B have the same signature, then a call to method A can be changed to a call to method B by changing the address in the call statement from method A's address to method B's address. A field is a memory access target that is distinguished from other fields by an address (e.g., a base address and an offset) in a memory read or write statement (the base address can be implicit or set in another statement); if field A and field B have the same data type (integer, string, etc.), then a read or write to field A can be changed to a read or write to field B by changing the address in the memory read or write statement from field A's address to field B's address.

[0095] In some embodiments, the interceptor 218 and its intercepted objects 304 may differ in data type. For example, consider two types A and B, where B is derived from A:

[0096] class A{}

[0097] class B:A{}

[0098] Then the code can have a field of type A:

[0099] private A_value:

[0100] And for reading, it can be intercepted by a field of type B:

[0101] private B_value;

[0102] This works because every B is an A. This only applies to reads, but the reverse applies to writes. Similarly, different embodiments have different tolerances for the additional code that will be injected, either to smooth out differences or to increase the range that is considered compatible. In some scenarios and some embodiments, 32-bit integer fields and 64-bit integer fields are compatible, allowing one to intercept the other if the compiler inserts the appropriate conversion.

[0103] In some embodiments, if an interceptor is defined to apply to a given member access based on [InterceptsLocation] or other criteria, the embodiment proceeds with the binding as if the interceptor was the selected member rather than the intercepted member. The compiler, or code emitted by the compiler, performs the conversion based on the member type (e.g., property, method, field) and related information such as return type and parameter types. If the replacement does not result in a successful compilation, the compiler reports an appropriate error as to why the use of the intercepted member is invalid, including in some embodiments an indicator that the error occurred after the interception. An example error is a line like "InterceptedThing() is a field of type integer, which may not be called" when the original InterceptedThing was a method with the appropriate signature until the interception occurred and it was replaced with an invalid artifact.

[0104] Some embodiments include enhancements that allow a program to declaratively intercept method calls and all their parameters from other parts of the program. For example, source code may include declarations to the compiler of appropriate enhancements, such as

[0105] [Intercepts(typeof(Job),"Submit")]

[0106] static voidInterceptSubmit(string args){...}

[0107] This declaration means that all calls to Job.Submit within the program will be routed through this InterceptSubmit method instead of Job.Submit. This feature allows for declarative interception of calls within a program, meaning that interceptions can be declared in the source code before compilation, rather than relying on interceptions to be performed at runtime without any prior warning in the source code. Furthermore, in some embodiments, no annotation, selection, or confirmation of interception is required at the call site.

[0108] In some embodiments, these interceptions can be fine-grained. In some embodiments, all calls within the program are intercepted by default, but interception can alternatively be limited to all calls 448 within a specific file 456, a specific line range in the file 456, or a specific call site 408 in the file, or a combination thereof. In the case where call site interception is not needed, this declarative interception allows additional external generator 438 scenarios. The source generator 438 can now modify program behavior without modifying the code 134 written by the user. This technology allows the program to rewrite itself to intercept these calls. Except for function 204, no external process or technology is needed. The target program can effectively modify its calls carried out in a declarative manner.

[0109] Specifically, function 204 enables code generator 438 to automatically modify a program without modifying the code written by the user. This solves several design time and build time issues, such as the time required for the original program developer, the original developer's continued access to the program's source code, and the requirements of a more complex software life cycle, particularly regarding design, development, testing, release, and deployment. Specifically, function 204 enables techniques such as debug edit and continue to work with call site modifications.

[0110] Edit and continue is a feature of some debuggers 124 that allows a developer to make changes to a program while it is being debugged; the new code written or changed by the developer is used for the remainder of the program's execution without requiring the program to be restarted. Although the developer directs the edit by editing higher-level language code, it is actually the program's in-memory assembly code that is edited while it is being debugged. Some systems provide similar hot reload capabilities. In some embodiments, edit and continue debugging is facilitated because intercepts 212 keep line numbers unchanged. In some embodiments, during edit and continue debugging, intercepts are re-evaluated after an edit to determine any updates made to intercepts 212 by the edit.

[0111] In some embodiments, functionality 204 also allows for enhanced code inspection. Developers of program 310 can intercept calls to problematic APIs and inspect their parameters 454 for diagnostic purposes.

[0112] In certain embodiments, function 204 does not need to call site modification or choose to join to allow interception.In this sense, calling site 408 and intercepting to calling are completely separated code paths.

[0113] In some embodiments, functionality 204 supports compile-time generation in scenarios that traditionally require runtime code generation. This enables greater ahead-of-time (AOT) compilation, which has corresponding advantages, such as less disruption to production environments, reduced runtime rotation overhead, and better code maintainability.

[0114] In some embodiments, functionality 204 enables interception at a specific call site or a series of call sites in a program. This allows system 202 to have the advantages described above without the disadvantages caused by undesirable interception.

[0115] In some embodiments, functionality 204 enables a domain-specific compiler plugin to use knowledge of the program to intercept calls, generate more efficient code patterns, and leverage them during execution. This knowledge includes internal representations generated by the compiler through static analysis, flow analysis, security reviews, and intermediate language generation. Other knowledge can also be used. For example, in some scenarios, the source generator calls a web service to find information and uses this information to determine what code to emit.

[0116] Some embodiments have technical features that distinguish them from less powerful, less flexible, or less secure approaches. Unlike macros, member call declarative interception is not limited to text replacement; the interceptor need not be a text expansion of the interception artifact. In some embodiments, except for the call instruction jump target address, the binary at the intercepted call site looks the same with or without the interception 212, while the binary for the expanded macro looks very different due to the macro expansion. In addition, macro expansion text replacement does not have access to the internal representation of the program built by the compiler (e.g., IL, AST, object model), while the source generator or other function 204 mechanism does have such access because such mechanism 204 operates during compilation after the lexical analysis phase that includes or follows the macro expansion. Unlike macro expansion, member call declarative interception can change different instances of the change target (e.g., different call sites) in different ways.

[0117] In some embodiments, function 204 provides an extended form of metaprogramming, which has similarities and differences with some versions of macros and aspect-oriented programming. Unlike macros, rewriting is not grammatical, and function 204 can also access semantic information from the program because the source generator or the compiler or both provide semantic information. In some embodiments, function 204 is different from some aspect-oriented programming in that existing methods will not be modified ("weaving"). Instead, new methods are introduced and the various call sites 304, 408 in the original program are redirected 212 to the methods 218, 404 generated by the source.

[0118] In some embodiments, developer code or source generator code can analyze the program and determine what to replace 508 a particular call site with, for example, determine how to enhance the program, and can pass location information or static analysis results or other information from the call site to an enhancement mechanism such as a source generator 438.

[0119] As an example, consider the technical problem of implementing a regular expression as code in a program. A simple but illustrative regular expression is one that matches the string "abc." In other words, when given a string, the code that implements the regular expression "abc" either returns a value indicating the location of instances of "abc" within the string, or returns a value indicating that the string does not contain "abc," depending on the string. A developer includes a line such as this in the program:

[0120] boolisMatch=Regex.IsMatch("abc",possibleMatch)

[0121] To implement this regular expression code, the non-enhanced source generator generates source along the following lines:

[0122] [GeneratedRegex("abc")]

[0123] static partial Regex AbcMatcher();…

[0124] However, to take advantage of the generated regular expression code, the developer changes the code to call it:

[0125] boolisMatch=AbcMatcher().IsMatch(possibleMatch)

[0126] This approach enables the source generator to provide a customized implementation specific to the "abc" pattern, but still requires the developer's time and effort to modify the original program source code in order to call the generated regular expression code.

[0127] A better approach utilizes functionality 204 to automatically and proactively update a developer's code efficiently by rerouting the original IsMatch method to the generated IsMatch method at compile time using a statement 214 such as the following in conjunction with an enhanced compiler:

[0128] [Intercepts(typeof(Regex),“IsMatch”)]

[0129] static bool SourceGeneratedIsMatch(string pattern,string input){…}

[0130] In some embodiments, interception 212 results in a noticeable but very minor change to the binary (which method is called), especially when two methods have the same signature 416. In some embodiments, the original methods 304, 404 are still compiled into the binary 310. In some embodiments, the developer does not need to edit the method names in the source.

[0131] In some embodiments, the file name and line number of the call are the same before and after the interception 212. Thus, during debugging 440, the step command behaves the same after the interception, except that the execution steps into or through the interceptor function 218 instead of the original function 304.

[0132] In some embodiments, the runtime performance impact of interception is simply the change in performance caused by running the interceptor 602 instead of the intercepted code. There is some compilation overhead, but this can be kept small according to the teachings herein, such as using properties 418 to store declarations 214 and interception lists 318. If the original code is modified or overwritten by the injected code, interception 212 is more efficient than the alternative of throwing compiler or other tool work at the original code.

[0133] Some embodiments utilize function 204 to transfer computing resource costs from runtime to compile time, thereby reducing the startup cost of the container. In some scenarios involving web servers or other programs implemented using containers, the runtime customization of the program results in the cost of using just-in-time (JIT) compilation to create working sets and obtain libraries. However, in microservices and some other environments, containers are frequently started, stopped, and then restarted, for example, several times an hour or even more frequently. Therefore, the startup costs associated with JIT compilation are repeatedly generated. In contrast, function 204 transfers those costs or corresponding costs to ahead-of-time (AOT) compilation time 504, so they occur less frequently, or may even occur only once. Unless otherwise specified, "compilation" herein refers to ahead-of-time compilation before runtime, rather than JIT compilation that occurs during runtime of the executable file 310 built in advance by AOT compilation.

[0134] In addition, AOT compilation of function 204 is safer than JIT compilation. In fact, some environments prohibit JIT compilation in order to enhance their security - write-execute memory pages are not allowed. But AOT compilation of function 204 can be safely employed with code 310 running in such non-JIT environments. Although AOT compilation of function 204 modifies program 310 behavior in an arbitrary manner (unlike methods that only provide enhancements to existing code), AOT compilation of function 204 is not a security vulnerability because the reason for the overwrite or other program behavior change to function 204 is annotated in the source code. The interceptor 218 and intercept declaration 214 are visible in the source code in an IDE or other tool, and the modified call or other change 508 appears in the binary compilation output, rather than being transparently injected at runtime.

[0135] Some embodiments support interception of or by methods that have one or more optional parameters 316. While a distinction can be made between parameters in a method signature and parameters in a method call, the usage differs and parameters are referred to herein as arguments. For example, in Foo(string?s=null), the parameter s is an optional parameter.

[0136] In some embodiments, the intercept 212 involving the optional parameter 316 looks like this: Regex r = Regex.Generated("abc");

[0137] static Regex Generated(string pattern,[OptionalFromSourceGenerator]Regex? r=null){return r;}

[0138] Regex r=Regex.Generated("abc",new ABCSourceGenerated());

[0139] In this example code, the first two lines are part of the original program, and the compiler effectively replaces the first line with the third line.

[0140] In some embodiments, the compiler's internal object model, which represents various aspects of the program being compiled, can be changed by a source generator. In practice, such a source generator has write access rights to internal representations that can normally only be written to by the compiler. However, allowing a source generator to modify compiler internal data structures can degrade compiler performance by causing re-evaluation of internal data structures (such as the object model) involving potential or actual modifications.

[0141] In some embodiments, a similar but different interception artifact 304 corresponds to an interceptor 218 that includes a switch statement. For example,

[0142] bool IsMatch=Regex.IsMatch1("abc",possibleMatch)

[0143] bool IsMatch=Regex.IsMatch2("def",possibleMatch)

[0144] corresponding to an interceptor 218containing a switch statement:

[0145] static bool SourceGeneratedMatch(string pattern,string input){

[0146] switch(pattern){

[0147] case "abc":…

[0148] case "def": ...

[0149] }

[0150] }

[0151] However, this swap statement adds runtime overhead. Some embodiments support a more runtime efficient approach that marks the call site with a corresponding location attribute value, such as:

[0152] [InterceptsLocation(“c:\file\path\my1.cs”,247)]

[0153] [InterceptsLocation(“c:\file\path\my2.cs”,16)]

[0154] The system 202 then generates corresponding methods, such as SourceGeneratedMatchabc(), SourceGeneratedMatchdef(), etc.; more generally, some embodiments map 636 the M generated methods to N call sites.

[0155] Some embodiments provide or utilize improvements to the flexibility of the generator 438. Some embodiments provide a set of features that allow the generator to move code that would normally require reflection to source code in a user application.

[0156] As an example scenario, in some environments, routing processes map the original query string to a delegate that handles the request. This involves parsing the query string, mapping query elements to parameters, and coercing types from strings to the corresponding parameter types. In one approach, the code used to do this is generated at runtime and dispatched via reflection. However, information available at compile time can be used to generate the parsing and dispatching handlers. Utilizing some embodiments of function 204, a mechanism for connecting these calls and an efficient way to issue them from the generator are provided.

[0157] In some embodiments, the enhanced compiler intercepts method calls in the code. This allows for a number of features, including simplified logging, debugging, and method specialization. The latter is useful for source generators to generate specific code for call sites, as an alternative to mutant generators with their attendant problems for ecosystems and toolsets. Call site specialization via function 204 does not suffer from those issues.

[0158] To intercept the call, in some embodiments, the code will provide a static method with a signature that matches 632 the intercepted method. The binding uses the original method 304. The signature match is evaluated as if it were an override. In the case of an instance method being intercepted, the "this" parameter is provided as the first parameter, as is done with extension methods.

[0159] In some embodiments, the code is decorated with a new attribute: InterceptsAttribute. This attribute takes the type of the method being intercepted and the name of the method.

[0160] In some embodiments, the compiler 122 will determine the signature of the method being intercepted by examining the signature of the method to which the InterceptsAttribute is applied. The isStatic parameter is used to determine whether the first parameter is part of the signature.

[0161] For example, suppose the compiler is given this declaration 214:

[0162] [Intercepts(typeof(EndpointRouteBuilderExtensions),"MapGet",isStatic:true)]

[0163] static IEndpointConventionBuilderInterceptMapGet(

[0164] IEndpointRouteBuilder endpoints,

[0165] string pattern,

[0166] RequestDelegate requestDelegate)

[0167] {

[0168]

[0169] }

[0170] The compiler will then intercept all calls to MapGet in the application and route them to InterceptMapGet instead.

[0171] In some embodiments, code can restrict the call locations where interception occurs by adding the [InterceptsLocation] attribute. This can specify a file path and optionally a line and column range. The compiler 122 will then only intercept calls that occur at that location. The InterceptsLocationAttribute can appear multiple times on a method, and interception will occur for any such match.

[0172] For example, to limit the interception of InterceptMapGet to lines 20 to 30 in Program.cs, the code would be added:

[0173] [InterceptsLocation("Program.cs",startLine:20,endLine:31)]

[0174] Depending on the embodiment, paths may be relative or fully qualified.

[0175] In some embodiments, method calls cannot be intercepted inside the [Intercepts] method of that method (or any local functions or lambda functions inside it). This may lead to infinite recursion.

[0176] In some embodiments, a method can be intercepted multiple times, but a call site can only be mapped to a single intercept. If a call site is mapped to multiple intercept methods, it constitutes an error.

[0177] In some embodiments, the intercepted method can be intercepted (intercept-intercept).

[0178] In some embodiments, the file path provided to the InterceptsLocation is rewritten through the / path mapping when it is bound and emitted to the metadata.

[0179] In some embodiments, it is a compile error if the [Intercepts] method cannot be bound to a method at compile time based on the information provided.

[0180] In some embodiments, the status from the call site may be passed to the intercept method 218. In some embodiments, the interceptor 218 may capture values via additional parameters.

[0181] In some embodiments, one or more of the following restrictions are placed on interception: (a) the interceptor method 218 and the intercepted method 304 must have the same signature, (b) the interceptor method 218 and the intercepted method 304 must have the same signature except with respect to the "this" parameter, (c) the interceptor method 218 and the intercepted method 304 must have the same signature except with respect to optional parameters, (d) the interceptor 218 and the intercepted artifact 304 must be the same kind of artifact, e.g., both are methods or both are fields, or (e) the intercepted artifact 304 must explicitly allow interception, e.g., via the [Interceptable] attribute.

[0182] In another approach involving optional parameters, a method call that requires additional compile-time code C provides an overload that accepts code C as a parameter. For example, in this method, MapGet adds a parameter to the delegate that does all the query string processing into parameters. This is then marked as optional code intended to be provided by generator 438:

[0183] static IEndpointConventionBuilder MapGet(

[0184] IEndpointRouteBuilder endpoints,

[0185] string pattern,

[0186] RequestDelegate requestDelegate,

[0187] [GeneratorProvided]HandlerDelegate handler)

[0188] {

[0189]

[0190] }

[0191] The code then provides values for these optional parameters by defining [Intercepts]-like methods that are used to create the values:

[0192] [Provides(typeof(EndpointRouteBuilderExtensions),"MapGet")]

[0193] static HandlerDelegate CreateOptionalParameter()

[0194] {

[0195]

[0196] }

[0197] The compiler then uses these methods to populate the optional handler parameter at the MapGet call site. This approach has many of the same trade-offs as the intercept 2121 method design presented herein as function 204, but function 204 using intercept declarations 214 in the manner described elsewhere herein satisfies more scenarios and is therefore currently preferred.

[0198] Another alternative involves mutating generators, which are source generators that mutate the call site directly. This provides all the capabilities of method interception, among other things. However, this mutating generator approach has substantial negative side effects associated with it.

[0199] One downside is that it's very difficult to impose restrictions on mutating generators. Even a well-behaved mutating generator might unintentionally but meaningfully change the behavior of the code it touches. This can lead to a loss of confidence in the ecosystem, as the generator might be perceived as attempting to change what the developer has written. In contrast, conventional generators simply perform enhancements, and the program is fully described by the totality of the outputted code.

[0200] The second negative impact is that mutating generators present a number of significant engineering challenges. The generator state needs to be passed from the initial compilation phase to the IDE in some way. Mutating generators also present significant challenges for debugging, edit and continue, and how the IDE displays code (for example, how mutations are exposed).

[0201] Some embodiments use or provide generator API support. In some embodiments, interception declaration 214 can be manually coded. However, one use case contemplated herein is that the source generator will automate the method's proactive interception. Therefore, some embodiments provide an efficient API to enable generator 438 to find the call site for the mapping.

[0202] Some of the cases for this feature revolve around generators, focusing on a limited set of names. Thus, in some embodiments, the compiler will provide the following methods:

[0203] public IncrementalValuesProvider <t>

[0204] ForMethodInvocationWithName <t>(

[0205] string methodName,Func< SyntaxNode ,CancellationToken,bool>predicate,

[0206] Func< GeneratorAttributeSyntaxContext ,CancellationToken,T>transform)

[0207] This will have the same efficiency that the compiler provides in methods like ForAttributeWithShortName and ForAttributeWithMetadataName. For IDE scenarios, this will significantly reduce the CPU time spent in these paths.

[0208] Some embodiments include overloads that allow the full method signature to be specified or a parameter count to be specified. This allows embodiments to utilize additional caching.

[0209] Some embodiments include overloading of static methods. This allows for significant caching benefits.

[0210] In some embodiments, the source code includes a declaration 214, such as [Intercepts(typeof(Job), "Submit")] static void InterceptSubmit(string args) { ...}. This declaration 214 is written in source code that is compiled into the same compilation unit or program as the intercepted method. While in some embodiments it can be written manually by a developer, an important use case for function 204 is for a source generator to emit this code 214.

[0211] As an example, suppose your app has the code:

[0212] File1.cs:

[0213] -----------Console.WriteLine("Hello");

[0214] The source generator 438 connected to the compiler 122 emits 624 the following content into File2.cs which is compiled into the same compilation:

[0215] File2.cs:

[0216] -----------

[0217] [Intercepts(typeof(Console),"WriteLine")]

[0218] static void WriteLineWithAdornments(string text)

[0219] {

[0220] Console.Write("***");

[0221] Console.Write(text);

[0222] Console.WriteLine("***");

[0223] }

[0224] Later, when the compiler emits the code for Console.WriteLine("Hello"), it will actually emit 506 calls to:

[0225] WriteLineWithAdornments("Hello");

[0226] So that instead of just printing:

[0227] "Hello"

[0228] Instead it will print:

[0229] "***Hello***"

[0230] In some embodiments, the compiler is enhanced to include method interception code in the compiled binary. For example, in the example above, when the compiler issues a method call for Console.WriteLine, it actually issues a call for the WriteLineWithAdornments method. The resulting binary will contain a call to the latter method, not the former.

[0231] This technique 204 allows a program to rewrite itself to intercept these calls. No external process or technology is required. The program can effectively modify the calls it makes declaratively. This is because the enhanced compiler places the method interception code in the compiled code as part of the binary executable. It is the program itself (the source code in the program) that causes the method to be intercepted. There is no external entity that rewrites the program; instead, some source code 134 in the program specifies that a call to method A in the same program should be replaced by a call to method B. This source code may be injected into the program via a source generator, but all sources generated by the source generator are logically considered to be part of the program and can be inspected as part of the program, for example in an IDE.

[0232] In some embodiments, methods are intercepted at compile time, causing calls to method A in the source code to be emitted to the binary as calls to method B. The call to method A no longer exists in the binary, nor does any mechanism for intercepting method calls; the interception is done entirely at compile time. The resulting binary appears as if the original source code had used a call to method B instead of a call to method A.

[0233] It is anticipated that in some (possibly many) cases, some (possibly many or even all) methods in a given compiled program will not be intercepted. The only intercepted methods are calls to method A in the source being compiled, where the source being compiled also includes an intercept declaration 214, for example, a method with the attribute [Intercepts(typeof(...), "A")] in the source code.

[0234] Regarding binary storage efficiency, the purely hypothetical increase in binary code size due to intercepted code is not a real factor, since the binary resulting from interception appears as if the original source code had used a call to method B instead of method A.

[0235] Regarding compilation efficiency, the compilation time spent on generating interception code can be minimized, for example, by the compiler discovering all intercepted actions. To enhance the compiler so that the compiler inserts declarative method call interception code into the binary file as part of compilation, a skilled compiler author can implement a mechanism for expressing declarations 214 in the source code of the compiled language (e.g., the [Intercepts(...)] attribute), define the semantics of the interception (e.g., signature matching 632 or the degree of variation allowed for cross-category interception such as fields intercepted by properties), and incorporate the semantics into the intermediate representation used by the compiler to represent the source being compiled, and emit 506 rewrite code based on the specified interception.

[0236] In some embodiments, feature 204 is designed to pay special attention to how the compiler discovers all interceptions in order to avoid computationally expensive discovery. For example, annotations 214, 314 are specified via attributes 418, which allow the compiler and IDE to statically know each intercepted method when the method is intercepted. When the list of methods opened for interception is not known in advance, computationally expensive alternatives occur. Specifically, by knowing the name of the intercepted method, the compiler can perform a simple "string contains" check to find the method name and exclude the vast majority of methods without actually performing deep semantic analysis (called "binding" in compiler terminology). In the absence of advance specifications for interception, or if most methods in the program are intercepted, the overhead of this feature may increase compilation time by up to 2 times, basically forcing the compiler to compile everything twice.

[0237] In some embodiments, the intercepted method can be intercepted (interception-interception). In the above example where WriteLineWithAdornments intercepts Console.WriteLine, interception-interception occurs when writing another method [Intercept(typeof(MyMethods),"WriteLineWithAdornments")]static voidActualReplacement(string text), causing the enhanced compiler 122 to issue 506 calls to ActualReplacement instead of issuing 506 calls to WriteLineWithAdornments. In other words, for Console.WriteLine("hello"), the compiler will issue a call to ActualReplacement("hello") because WriteLineWithAdornments replaces WriteLine via interception, and then ActualReplacement replaces WriteLineWithAdornments via interception.

[0238] Those skilled in the art recognize that method calls do not necessarily target a fixed memory code address. A method may have no code address (e.g., a virtual method), one code address (the most typical method in many programs), or many code addresses (e.g., an override of a virtual method). In some embodiments, interception is used to intercept virtual method calls by replacing virtual method calls with non-virtual static method calls. In some embodiments, interception changes the mechanism of how method calls are performed; it is not always just replacing one code address with a different code address. In this case, method A and method B have different signatures. The original method takes a "this" pointer as an implicit parameter, and the interceptor takes the same parameter as an explicit parameter. This is possible because the interception occurs in the program representation in the compiler before the method code and method call are assigned a memory code address.

[0239] In some embodiments, member access is a generalization of method access. Some embodiments perform expression replacement. In the semantics of the C# and Visual Basic languages, an example of expression replacement is replacing an existing method call expression with a new method call expression. Some embodiments replace a method call with another compatible expression 402, where "compatible" means that the type is equivalent and has an equal set of free variables (this means that all unbound variables in the replacement expression are equivalent in name and type to the unbound variables in the original expression).

[0240] Some embodiments relate to human-computer interaction in the IDE 124. In some embodiments, a developer can right-click on an intercepted method, select "Go to Definition" or equivalent, and navigate to the intercepted method rather than any original definition that may have existed for the method. In some embodiments, the source generator 438 runs as part of the development experience (e.g., design-time build), and the IDE consults the compiler 122 for information about the actual target to which the navigation will go, which enables the compiler's knowledge of the interception to feed the IDE with the correct target information.

[0241] In some embodiments, methods are allowed to have optional arguments 316 that will be filled in by the source generator 438, e.g., Foo([FilledInBySourceGenerator]Something s=null), rather than the compiler changing the target of the call. In some embodiments, the use of optional parameters results in an artifact having a compatible signature relative to another artifact, even if the two artifacts do not have the same signature due to having different numbers of parameters. For example, method Foo() is compatible with method Bar([CallerLineNumber]intlineNumber=0), where lineNumber is an optional argument that can be filled in by the compiler, so a call to Foo can be replaced with Bar because a call to Bar can be made without a developer-provided argument, and the compiler can then fill in the optional argument (in this case, by replacing the line number where the call occurs). In some embodiments, there are one or more optional parameters 316, and when the developer has not provided them in the source, the actual parameters 454 passed to those parameters are provided by the compiler, e.g., via default values. The compiler computes 620 the parameters of the optional values, e.g., by filling in the parameters based on the file name, line number, the text of an expression passed as another argument, etc.

[0242] Technical features

[0243] The technical features of the embodiments described herein will be apparent to those skilled in the art and will also be apparent to a broadly attentive reader in several ways. Some embodiments are directed to technical activities such as lexically analyzing and parsing source code 134 to locate intercept declarations 214, lexically analyzing and parsing source code 134 to locate intercept location identifiers 314, issuing 506 instructions 116 from the compiler 122 during compilation 504, running 624 a source generator 438 that actively and automatically generates source code 134 that modifies program 310 behavior via interception of artifacts to be intercepted, without relying on edits 406 directed by a human developer of the artifacts to be intercepted 304, and the compiler 122 that automatically and actively collects 616 a list 318 of interceptions by lexically analyzing and parsing source code, the list 318 of interceptions being activities that are deeply rooted in computing technology. Some of the technical mechanisms discussed include, for example, the compiler 122, the IDE 124, the user interface 130, the interception statement 214 and the associated compiler function 204, the interception location identifier 314 and the associated compiler function 204, and the optional parameter 316 and the associated compiler function 204. Some of the technical effects discussed include, for example, the modification of the behavior of the program 310, which is recorded in the source code 134 of the program and which replaces the call 210 to a member 208 with a call to a different member during compilation 504, rather than performing a method replacement at runtime that is not obvious in the program source code, the transfer of the software lifecycle of the program behavior change 508 from runtime to AOT compilation time, the M to N mapping 636 of the interceptor 218 to the artifact 304 to be intercepted. Different interceptions 212 at different call sites 408 of the same method based on the location 312 of each call site, and other enhancements to the compiler 122 technology. Therefore, purely mental processes and activities limited to paper and pencil are obviously excluded. Based on the provided description, other advantages of the technical features based on this description will also be apparent to the skilled person.

[0244] Compiling 504 is a technical activity that produces lower-level software code from higher-level software code, wherein "lower" means closer to the architecture in terms of versatility, portability and / or executability on hardware with hardware architecture. For example, compiling high-level code such as source code written in C#, PHP or Python to produce low-level code such as assembly language code, intermediate language code, p-code, or some binary codes such as executable code. It is understood by those skilled in the art that software is not executed before being compiled (although it can be distinguished, for the purpose of whether an activity or item is qualified as a part of computing technology, an interpreter is a compiler of a specific type). Software such as source code input to a compiler, software produced by other software (such as compiler production of intermediate language code or binary code) and the software execution of the code produced by the compiler are all parts of computing technology. Therefore, a compiler is a part of computing technology, and the improvement to compiler 122 described herein is an improvement to computing technology.

[0245] Different embodiments provide different technical benefits or other advantages in different situations, but those skilled in the art who are aware of the present disclosure will recognize that specific technical advantages may result from specific innovative features or combinations of features, as indicated at various points herein. Any general or abstract aspects are integrated into practical applications, such as compiler 122, stand-alone source code editing tool 124, source generator 438, or integrated development environment 124.

[0246] Some of the embodiments described herein may be viewed by some in a broader context. For example, concepts such as efficiency, reliability, user satisfaction, or waste may be considered relevant to a particular embodiment. However, it does not follow from the availability of a broad context that exclusive rights are sought in this document to abstract concepts; they are not. Instead, the present disclosure focuses on providing appropriate specific embodiments whose technical effects fully or partially solve specific technical problems, such as how to automatically modify program behavior without relying on JIT compilation or source code editing by program developers, how to support arbitrary changes to program behavior but require documentation of those changes in the source code in order to prevent security vulnerabilities, and how to modify different calls to a single method in different ways. Storage media, systems, and processes involving other configurations of efficiency, reliability, user satisfaction, or waste are outside the scope of this disclosure. Therefore, with a proper understanding of the present disclosure, ambiguity, mere abstractness, lack of technical specificity, and the attendant proof problems are also avoided.

[0247] Additional combinations and variations

[0248] Any of these combinations of software code, data structures, logic, components, communications, and / or their functional equivalents may also be combined with any of the systems described above and variations thereof. The process may include any of the steps described herein in any subset or combination or order that is operable. Each variation may occur alone or in combination with any one or more other variations. Each variation may occur with any process, and each process may be combined with any one or more other processes. Each process or combination of processes (including variations) may be combined with any combination of storage media and variations of any configuration described above.

[0249] More generally, skilled artisans will recognize that not every part of this disclosure, or any specific detail therein, must satisfy legal standards, such as implementation, written specification, or best mode. Furthermore, embodiments are not limited to the specific scenarios, motivational examples, operating environments, tools, peripherals, software process flows, identifiers, data structures, data selections, naming conventions, symbols, control flows, or other implementation choices described herein. Any apparent conflict with any other patent disclosure, even from the owner of the present invention, shall not play a role in interpreting the claims presented in this patent disclosure.

[0250] Acronyms, abbreviations, names and symbols

[0251] Some acronyms, abbreviations, names and symbols are defined below. Others are defined elsewhere herein or do not require definition here in order to be understood by those skilled in the art.

[0252] ALU: Arithmetic and Logic Unit

[0253] API: Application Programming Interface

[0254] AST: Abstract Syntax Tree

[0255] BIOS: Basic Input / Output System

[0256] CD: compact disc

[0257] CPU: Central Processing Unit

[0258] DVD: Digital Versatile Disc or Digital Video Disc

[0259] FPGA: Field Programmable Gate Array

[0260] FPU: Floating Point Processing Unit

[0261] GDPR: General Data Protection Regulation

[0262] GPU: Graphics Processing Unit

[0263] GUI: Graphical User Interface

[0264] HTTPS: Hypertext Transfer Protocol Secure

[0265] IaaS or IAAS: Infrastructure as a Service

[0266] ID: identification or identity

[0267] IDE: Integrated Development Environment

[0268] IL: Intermediate Language

[0269] LAN: Local Area Network

[0270] OS: operating system

[0271] PaaS or PAAS: Platform as a Service

[0272] RAM: Random Access Memory

[0273] ROM: Read-Only Memory

[0274] TPU: Tensor Processing Unit

[0275] UEFI: Unified Extensible Firmware Interface

[0276] UI: User Interface

[0277] WAN: Wide Area Network

[0278] Some additional terms

[0279] Reference is made herein to exemplary embodiments such as those shown in the accompanying drawings, and specific language is used herein to describe these exemplary embodiments. However, changes and further modifications of the features illustrated herein, as well as additional technical applications of the abstract principles illustrated in the specific embodiments herein, will occur to those skilled in the relevant art and in possession of this disclosure and should be considered to be within the scope of the claims.

[0280] The meaning of the terms is clarified in this disclosure, and therefore the claims should be read with careful attention to these clarifications. Specific examples are given, but it will be understood by those skilled in the relevant art that other examples may also fall within the meaning of the terms used and are within the scope of one or more claims. Terms herein may not necessarily have the same meaning as they have in general use (particularly in non-technical use), or in the use of a specific industry, or in a specific dictionary or dictionary collection. Figure numerals may be used together with various wordings to help show the breadth of the terms. Omitting a figure numeral from a given text does not necessarily mean that the text does not discuss the content of the drawings. This disclosure declares and exercises the right to compile specific and selected dictionaries. Referenced terms are clearly defined, but terms may also be implicitly defined without using quotation marks. Terms may be defined explicitly or implicitly in the specific embodiments and / or elsewhere in the application documents.

[0281] A "computer system" (also referred to as a "computing system") may include, for example, one or more servers, motherboards, processing nodes, laptop computers, tablet computers, personal computers (portable or non-portable), personal digital assistants, smartphones, smart watches, smart bracelets, cellular or portable phones, other portable devices having at least a processor and memory, video game systems, augmented reality systems, holographic projection systems, televisions, wearable computing systems, and / or other devices that provide one or more processors controlled at least in part by instructions. The instructions may be in the form of firmware or other software in memory and / or dedicated circuitry.

[0282] A "multi-threaded" computer system is a computer system that supports multiple threads of execution. The term "thread" should be understood to include code that can be or is subject to scheduling and may be subject to synchronization. Outside of this disclosure, a thread may also be referred to by another name, such as, for example, a "task," a "procedure," or a "coroutine." However, a distinction is made here between threads and processes because a thread defines an execution path within a process. In addition, the threads of a process share a given address space, while different processes have different corresponding address spaces. The threads of a process can run in parallel, sequentially, or a combination of parallel and sequential execution (e.g., time slicing).

[0283] A "processor" is a thread-processing unit, such as a core in a simultaneous multithreading implementation. A processor comprises hardware. A given chip can hold one or more processors. Processors can be general-purpose, or they can be customized for specific uses, such as vector processing, graphics processing, signal processing, floating-point arithmetic processing, encryption, I / O processing, machine learning, and so on.

[0284] The "kernel" includes the operating system, hypervisor, virtual machine, BIOS or UEFI code, and similar hardware interface software.

[0285] "Code" means processor instructions, data (which includes constants, variables, and data structures), or both instructions and data. "Code" and "software" are used interchangeably herein. Executable code, interpreted code, and firmware are some examples of code.

[0286] "Program" is used broadly herein to include applications, kernels, drivers, interrupt handlers, firmware, state machines, libraries, and other code written by programmers (also called developers) and / or automatically generated.

[0287] A "routine" is a callable piece of code that typically returns control to the instruction immediately following the point in program execution where the routine was called. Depending on the terminology used, a distinction is sometimes made between "functions" and "procedures": functions typically return a value, while procedures do not. As used herein, "routine" includes both functions and procedures. A routine may have code that returns a value (e.g., sin(x)), or it may simply return without providing a value (e.g., a void function).

[0288] "Service" means a consumable program offering in a cloud computing environment or other network or computing system environment that provides resources to or access to resources for multiple programs, or both. The service implementation itself may include multiple applications or other programs.

[0289] "Cloud" means pooled resources for computing, storage, and networking that are elastically available for measured, on-demand services. Clouds can be private, public, community, or hybrid, and cloud services can be provided as Infrastructure as a Service (IaaS), Platform as a Service (PaaS), Software as a Service (SaaS), or another service. Unless otherwise specified, any discussion of reading from or writing to a file includes reading / writing local files or reading / writing over a network, which can be a cloud network or other network, or both (local and networked read / write). A cloud may also be referred to as a "cloud environment" or a "cloud computing environment."

[0290] "Access" to a computing resource includes using permissions or other capabilities to read, modify, write, execute, transfer, delete, create, or otherwise exploit the resource. Attempted access can be clearly distinguished from actual access, but "access" without the "attempted" qualifier includes both attempted access and access actually performed or provided.

[0291] As used herein, activity by a user refers to activity by a user's device or user account, or activity by software acting on behalf of the user, or activity by hardware acting on behalf of the user. Activity is represented by digital data or machine operations in a computing system, or both. Activity within the scope of any claim based on this disclosure excludes human action per se. Thus, software or hardware activity "on behalf of a user" refers to software or hardware activity acting on behalf of a user's device, or on behalf of a user account, or on behalf of another computing mechanism or article of manufacture, and therefore does not bring human action per se within the scope of any embodiment or claim.

[0292] "Digital data" means data in a computing system, as opposed to, for example, data written on paper or thoughts in a person's head. Similarly, "digital memory" refers to non-living devices, such as computing storage hardware, as opposed to human or other biological memory.

[0293] As used herein, "comprising" allows for additional elements (ie, comprising means including) unless stated otherwise.

[0294] "Optimization" means improvement, not necessarily perfection. For example, an already optimized program or algorithm can be further improved.

[0295] "Process" is sometimes used herein as a term from the field of computing science and in this technical sense encompasses a user of computing resources, which may also include or be referred to as, for example, a co-routine, a thread, a task, an interrupt handler, an application procedure, a kernel procedure, a procedure, or an object method. In practice, a "process" is a computing entity recognized by system utilities, such as task manager, ps or other similar utilities in an operating system environment (trademarks of Linus Torvalds, Microsoft Corporation, respectively). "Process" is also used herein as a patent law term, for example, when describing a process claim as opposed to a system claim or an article of manufacture (configured storage medium) claim. Similarly, "method" is sometimes used herein as a technical term in the field of computer science (a "routine") and also as a patent law term ("process"). "Process" and "method" in the patent law sense are used interchangeably herein. Those skilled in the art will understand what is intended in a particular instance, and will also understand that a given claimed process or method (in the patent law sense) may sometimes be implemented using one or more processes or methods (in the computer science sense).

[0296] "Automatically" means through the use of automation (e.g., general-purpose computing hardware configured by software for the specific operations and technical effects discussed herein), rather than without automation. Specifically, the steps performed "automatically" are not manually performed on paper or in a person's mind, although they may be initiated by a human or interactively directed by a human. The automated steps are performed by a machine to achieve one or more technical effects that would not be achieved without the technical interaction provided thereby. It is assumed that the automatically performed steps include at least one operation that is actively performed.

[0297] It is understood by those skilled in the art that a technical effect is a hypothetical purpose of a technical embodiment. For example, the mere fact that a calculation is involved in an embodiment and that some calculations can also be performed without a technical component (e.g., by paper and pencil, or even as a mental step) does not eliminate the existence of a technical effect or change the specific and technical nature of the embodiment, particularly in the implementation of the embodiment in the real world. Member call declarative interception operations (such as parsing and analyzing code to create a compiler internal data structure 424 representation of the program 310 for subsequent use in code generation 506, issuing 506 instructions to implement call interception 212, calculating 620 the values of optional parameters, running 624 source generator software 438, and many other operations discussed herein) are understood to be inherently digital. Even in a hypothetical prototype, the human mind cannot directly interface with a CPU or other processor or with RAM or other digital storage device to read and write the necessary data to execute the member call declarative interception step 600 described herein, let alone in the real world large-scale computing environment of the embodiment. In view of this disclosure, those skilled in the art will understand all of this well.

[0298] "Computationally" also means that a computing device (at least a processor plus memory) is being used, and excludes obtaining a result through mere human thought or mere human action. For example, performing arithmetic with paper and pencil is not computationally performing arithmetic as understood herein. The computational results are faster, broader, deeper, more accurate, more consistent, more comprehensive, and / or otherwise provide a technical effect beyond the scope of human performance alone. A "computational step" is a step performed computationally. Neither "automatically" nor "computationally" necessarily means "immediately." "Computationally" and "automatically" are used interchangeably herein.

[0299] "Actively" means without a direct request from the user. In fact, the user may not even be aware that an active step of an embodiment is possible until the results of that step have been presented to the user. Unless otherwise stated, any calculation and / or automatic steps described herein may also be completed actively.

[0300] “Based on” means at least based on, but not exclusively based on. Thus, a calculation based on X depends at least on X, and may also depend on Y.

[0301] Throughout this document, the use of the optional plural form ("s", "es", or "ies") means that there are one or more of the indicated features. For example, "processor" means "one or more processors" or equivalently "at least one processor".

[0302] "At least one of" in a list of items means one of the items, or two of the items, or three of the items, and so on, up to and including all N of the items, where the list is a list of N items. In one embodiment, the presence of an item in the list does not require the presence of (or checking for) the item. For example, if an embodiment of a system is described herein as including at least one of A, B, C, or D, then a system that includes A but does not check for B or C or D is an embodiment, and a system that includes A and also includes B but does not include or check for C or D is also an embodiment. A similar understanding relates to items that are steps or parts of steps or options in a method embodiment. This is not a complete list of all possibilities; it is provided merely to aid understanding of the scope of "at least one" as intended herein.

[0303] For purposes of U.S. law and practice, use of the word "step" herein, in the claims, or elsewhere is not intended to invoke means-plus-function, step-plus-function, or claim interpretation under 112 U.S.C., sixth paragraph / 112(f). Any presumption to that effect is hereby expressly rebutted.

[0304] For purposes of U.S. law and practice, claims are not intended to invoke means-plus-function interpretation unless they use the phrase “means for.” Claim language, if any, that is intended to be interpreted as means-plus-function language will expressly recite that intent through the use of the phrase “means for.” When means-plus-function interpretation applies, whether through the use of “means for” and / or through the court’s legal construction of the claim language, means recited in the specification for a given noun or a given verb should be understood to be linked to the claim language and linked together herein by any of the following: appearance within the same block in a block diagram of the accompanying drawings, representation by the same or similar name, representation by the same figure numeral, a functional relationship depicted in any drawing, or a functional relationship mentioned in the text of the disclosure. For example, if a claim limitation recites a "zac widget" and that claim limitation changes the subject matter to a device-plus-function interpretation, then all structure identified in at least any figure box, paragraph, or example that refers to the "zac widget," or bound together by any figure numerals assigned to the zac widget, or disclosed as having a functional relationship to the structure or operation of the zac widget anywhere in the specification will be considered part of the structure identified in the application for the zac widget and will help define the set of equivalents of the zac widget structure.

[0305] Those skilled in the art will recognize that the present disclosure discusses various data values and data structures, and recognizes that these items reside in memory (RAM, disk, etc.), thereby configuring the memory. Those skilled in the art will also recognize that the present disclosure discusses various algorithmic steps embodied in executable code in a given implementation, and that such code also resides in memory, and that it effectively configures any general-purpose processor that executes it, thereby converting it from a general-purpose processor to a dedicated processor that is functionally dedicated hardware.

[0306] Therefore, a skilled person would not make the mistake of treating (a) the memory recited in the claims and (b) the data structures or data values or code recited in the claims as non-overlapping items. The data structures and data values and the code are understood to be resident in the memory even when the claims do not explicitly recite the residency for each data structure or data value or code segment mentioned. Therefore, an explicit recitation of such residency is not required. However, they are not prohibited, and one or two optional recitations may be present for emphasis without thereby excluding all other data values and data structures and code from being resident. Similarly, the code function recited in the claims is understood to configure the processor, regardless of whether the configuration quality is explicitly recited in the claims.

[0307] Throughout this document, unless otherwise expressly stated, any reference to a step in a process assumes that the step can be performed directly by the interested party and / or indirectly by that party through intervening mechanisms and / or intervening entities and still be within the scope of the step. In other words, unless direct performance is an explicitly stated requirement, the step need not be performed directly by the interested party. For example, computational steps on behalf of the interested party, such as accessing, calling, changing, compiling, declaring, displaying, issuing, executing, collecting, generating, implementing, intercepting, calling, restricting, mapping, matching, annotating, generating, receiving, identifying, replacing, running, specifying (as well as accessing, being accessed, calling, being called, etc.) with respect to a destination or other object, may involve intervening actions, such as those described above or such as forwarding, copying, uploading, downloading, encoding, decoding, compressing, decompressing, encrypting, decrypting, authenticating, calling, etc., which include any actions stated in this document, but are still understood to be performed directly by or on behalf of the interested party.

[0308] Whenever reference is made to data or instructions, it should be understood that these items configure the computer-readable memory and / or computer-readable storage medium, thereby converting it into a specific article of manufacture, rather than simply existing on paper, in a person's mind, or merely as a signal propagating on a wire. For purposes of U.S. patent protection, a memory or other storage device or other computer-readable storage medium is not a propagating signal or carrier wave or merely energy outside the scope of patentable subject matter under the U.S. Patent and Trademark Office's (USPTO) interpretation of In re Nuijten. In the United States, no claim covers a signal per se or pure energy, and any claim construction asserting otherwise is unreasonable on its face in light of this disclosure. Unless expressly stated otherwise in a claim issued outside the United States, a claim does not cover a signal per se or merely energy.

[0309] Furthermore, despite anything apparent to the contrary elsewhere herein, a clear distinction will be understood between (a) computer-readable storage media and computer-readable memory, on the one hand, and (b) transmission media (also known as signal media), on the other hand. Transmission media are propagating signals or carrier wave computer-readable media. In contrast, computer-readable storage media and computer-readable memory and storage devices are not propagating signals or carrier wave computer-readable media. Unless explicitly stated otherwise in the claims, "computer-readable medium" refers to computer-readable storage media, not propagating signals per se, nor even energy.

[0310] The "embodiments" herein are examples. The terms "embodiments" and "invention" are not interchangeable. The embodiments may freely share or borrow aspects to create other embodiments (assuming the result is operable), even if the resulting combination of aspects is not itself explicitly described herein. Requiring explicit and individual description of each and every permissible combination would be unnecessary for one skilled in the art and would be contrary to the policy of recognizing that patent specifications are written for readers of skill in the art. Formal combinatorial calculations and informal common intuition about the number of possible combinations resulting from even a small number of combinable features would indicate that there are a large number of combinations of aspects for the aspects described herein. Therefore, requiring explicit recitation of every combination would be contrary to the policy of requiring patent specifications to be concise and for readers to have knowledge in the relevant art.

[0311] Reference Signs List

[0312] The following list is provided for convenience and to support the accompanying drawings and is part of the specification text, which describes the innovation by reference to multiple items. Nevertheless, items not listed here may also be part of a given embodiment. For better readability of the text, references to some, but not all, of the items are used to describe the given reference numerals in the text. The same reference numerals may be used to refer to different examples or instances of a given item.

[0313] The reference numerals are as follows: 100 operating environment, also known as computing environment; including one or more systems 102

[0314] 101 A machine in system 102, for example, any device having at least a processor 110 and a memory 112 and also having a distinct identifier such as an IP address or a MAC (Media Access Control) address; it may be a physical machine or a virtual machine implemented on physical hardware.

[0315] 102 Computer systems, also called "computing systems" or "computing systems", and when in a network may be called "nodes"

[0316] 104 users, such as users of the enhanced system 202

[0317] 106 peripheral devices

[0318] 108 Network, typically including, for example, LAN, WAN, software-defined network, cloud, and other wired or wireless networks

[0319] 110 Processor or collection of processors; including hardware

[0320] 112 Computer-readable storage media, such as RAM, hard disk

[0321] 114 Removable computer readable storage medium

[0322] 116 utilizes processor-executable instructions; may be on removable storage media or in other memory (volatile or non-volatile or both)

[0323] 118 Digital data in system 102; this article discusses data structures, values, source code, and other examples

[0324] 120(multiple) cores, such as operating system(s), BIOS, UEFI, device drivers

[0325] 122 Compiler tools or compilation services; services are examples of tools

[0326] 124 Tools in computing systems, such as software development tools, security tools, communication tools, etc.; computational and therefore non-human

[0327] 126 Display screen, also known as "display"

[0328] 128 Computing hardware not otherwise associated with reference numerals 106, 108, 110, 112, 114

[0329] 130 User interface; Computational

[0330] 132 Articles of manufacture in computing systems; digital or computational or both

[0331] 134 Source code as represented in computing system 102

[0332] 136 Cloud, also known as cloud environment or cloud computing environment

[0333] 202 Enhanced computing system, ie, system 102 enhanced with member call declarative interception functionality as described herein

[0334] 204 Member call declarative interception functionality, such as software or specialized hardware that performs or is configured to perform steps 502 and 506, or step 608, or step 614, or step 622, or step 626, or step 636, or any software or hardware that performs or is configured to perform the novel method 600 first disclosed herein or compute member call declarative interception activity.

[0335] 206 supports functionality 204, for example, by performing supporting computational steps such as analyzing or parsing source code to locate interception declarations 214, reading or writing source code files having interception declarations 214, detecting syntax or semantic errors in interception declarations 214, or performing Figure 5 or Figure 6 Any steps identified in

[0336] 208 members, such as methods 404, fields 422, properties 428, or members of objects 426; members are examples of artifacts 132

[0337] 210 calls or members, such as method calls, read or write access to fields, read access to properties; computed

[0338] 212 Interception, which is a compile-time change from a call to one member to a call to a different member or to a call with different parameters (which is actually a change to a different member if the member is considered a set of members parameterized by parameter values); may also be referred to using terms such as replacement, substitution, or rerouting of calls to members; also refers to the results of such computational activity, such as reduced container startup latency due to interception

[0339] 214 interception statement, that is, the text in source code 134 that declares interception 212

[0340] 216 interceptor implementation, such as the source code of the interceptor defined in statement 214; the code of the method static voidWriteLineWithAdornments(string text) is an example of this article

[0341] 218 interceptor, i.e., the member to be called instead of the unintercepted artifact 304, as represented in the system 202

[0342] 220 A pointer, index, identifier, or other reference to an interceptor; dereferencing it points to the interceptor itself, so when we talk about interceptors in this article, we implicitly refer to interceptor references.

[0343] 304 An artifact that will be called 210 in the absence of any contrary statement 214; may also be referred to as an artifact to be intercepted or an intercepted artifact.

[0344] 306 Non-intercepted call, that is, a call that was not intercepted or would have occurred without interception

[0345] 308 interceptor call, that is, the call is generated by interception; due to interception, the interceptor call 308 replaces the non-intercepted call 306

[0346] 310 contains the executable program of the product 304 to be intercepted; reference numeral 310 may also refer to the source code 134 of the program.

[0347] 312 Interception location, that is, the location within the program of the instance of the artifact to be intercepted, rather than other actual or potential instances of the artifact

[0348] 314 Identifier of the interception location in text form in the source code

[0349] Optional parameters or arguments for 316 method 404

[0350] 318 A list of call interceptions occurring in the source code (one or more files); this list is generated from the source code declarations 214, but may itself be binary, such as a table, array, list, set, or other data structure in the compiler's internal representation of the program 310

[0351] 320 non-virtual method, i.e., a method that is not a virtual method, as represented in system 202

[0352] 322 virtual method, as represented by system 202; a method declared without an accompanying body that implements the method

[0353] 324 General interface; hardware and software

[0354] 402 Compatible Expression, for example, a first member that, when accessed or otherwise called, returns a value of the same type as or convertible to the type of a second member; the first member is a compatible expression for the second member

[0355] 404 A method in a computational sense rather than a legal sense; it may also be called a routine, procedure, or function.

[0356] 406 Editing of source code, as represented in system 202

[0357] 408 method call site, as represented in system 202

[0358] 410 variables, as represented in system 202

[0359] 412 variable name

[0360] 414 Variable data type

[0361] 416 Method signature, as represented in system 202

[0362] 418 attributes of the member, as specified in the source code and represented in the system 202

[0363] 422 Fields in object 426 or other data structure, as represented in system 202

[0364] 424 data structure, as represented in system 202

[0365] 426 Objects in the sense of object-oriented programming, as represented in system 202

[0366] 428 Attributes of object 426 or other data structures, e.g., corresponding to fields but implemented as functions, as represented in system 202

[0367] 430 subroutine, as represented in system 202

[0368] 432 memory 112 address, as represented in system 202

[0369] 434 Base address 432 of an object or other data structure, as represented in system 202; usually the lowest address, but sometimes objects have hidden data below the base, such as for garbage collection

[0370] 436 into an offset address 432 in an object or other data structure, such as a field 422 address, as represented in system 202

[0371] 438 Source Generator, e.g., a component that plugs into a compiler and adds additional code to the compilation; computational; Source Generator 438 is an explicit non-human generator of source code

[0372] 440 Debug; Computing Activity

[0373] 442 Debug Session; a collection of debugging activities related to a particular program 310

[0374] 444 Call statements, such as method calls, property calls, field reads, or field writes in a program

[0375] 446 software, as represented in system 202

[0376] 448 method call

[0377] 450 access to data

[0378] 452 Access statements that access 450 data, such as reading or writing fields

[0379] 454 parameter value passed in calling 448

[0380] 456 files, such as files in a file system containing source code 134

[0381] 500 flow chart; 500 also refers to Figure 5 As shown in the flowchart or with Figure 5 Process Figure 1 The member call declarative interception process

[0382] 502 computationally identifying intercept declarations 214 during compilation, such as through lexical analysis and parsing of source code

[0383] 504 Compiling source code computationally; those skilled in the art recognize that compilation is performed by software, not by humans mentally or with pencil and paper; humans clearly lack the speed, accuracy, memory capacity, and specialized processing power required to perform compilation, as is evident, for example, from decades of technological advances in compiler technology; a classic achievement in computing is to write compiler source code for a compiler in a given programming language, and then compile that source code to produce the compiler—this is called a self-hosting compiler, and would be meaningless and unappreciated if compilation were typically done solely by mental processes

[0384] 506 issues instructions in a computational manner, for example, low-level code such as assembly language code, intermediate language code, p-code, or some binary code such as executable code

[0385] 508 Computationally replacing one call with another

[0386] 600 flow chart; 600 also refers to Figure 6 As shown in the flowchart or with Figure 6 Process Figure 1 The member call declarative interception process is Figure 5 Combined with the flowchart and other steps described in this article

[0387] 602 Executing software in a computing manner, also known as running software

[0388] 604 specifies the artifact to be intercepted in a computational manner, such as using attributes in the source code

[0389] 606 implements the interceptor or a reference to the interceptor computationally, for example by providing a body in the source code

[0390] 608 Displaying interception declarations in a computational manner, such as by configuring a user interface

[0391] 610 displays the product to be intercepted in a computational manner, such as by configuring a user interface

[0392] 612 receives a command in a computing manner via a user interface

[0393] 614 computationally annotate intercept location identifiers, such as by parsing

[0394] 616 Computationally collect intercepted lists, such as by scanning and parsing

[0395] 618 replaces virtual method calls with computational methods; changes to the example of 508

[0396] 620 Calculate the value of the optional parameter by calculation

[0397] 622 computationally re-evaluate interception, e.g. after editing

[0398] 624 runs the source generator computationally, e.g., actively

[0399] 626 computationally restricting the intercept change(s) to the specified location 312, such as by not performing the change(s) at other locations involving the same member(s)

[0400] 628 uses compatible expressions 402 to replace the call to

[0401] 630 Computing to generate executable file 310

[0402] 632 Computationally determine whether two signatures sufficiently match to allow interception

[0403] 634 implements the product to be implemented in a computational manner, for example by emitting binary code for the body of method 304

[0404] 636 Computationally map M interceptors 218 to N artifacts 304

[0405] 638 Any step or item discussed in this disclosure that is not already assigned some other figure label; 638 may therefore be explicitly shown (in this disclosure or any subsequent patent application claiming priority to this disclosure) as a figure label for various steps or items or both, and may be added as a figure label for various steps or items or both, thereby adding no new matter.

[0406] in conclusion

[0407] In some embodiments, the compiler 122 recognizes 502 an interception declaration 214 in the source code 134 and emits 506 code 116 that replaces the call 306, 210 to the specified artifact 304, 132 with a call 308, 210 to the specified interceptor 218. The source generator 438 actively modifies 508 the behavior of the program 310 in any desired manner without introducing hidden security violations and without requiring editing 406 by the program developer. The interception declaration 214 is visible in the source code 134 and development tools 124 (such as IDEs, editors, and debuggers). In some cases, different calls 210 to a particular method 404, 304 at a corresponding location 312 are intercepted 626, 636 by different replacement methods 218. The replacement method 218 and the replacement method 304 have the same signature 416, or are otherwise compatible as determined 632 by the particular embodiment. Some interceptors 218 specify optional parameters 316. Method 404 calls 448, field 422 accesses 450, and property 428 calls 448 may be intercepted. The work of modifying the behavior of program 310 is moved from runtime to compile time in the program lifecycle, thereby improving runtime performance and eliminating JIT compilation security risks.

[0408] The embodiments are understood to also inherently include or benefit from tested and appropriate security controls and privacy controls, such as the General Data Protection Regulation (GDPR). The use of the tools and techniques described herein is compatible with the use of such controls.

[0409] Although Microsoft technologies are used in some of the motivational examples, the teachings herein are not limited to use with technologies provided or managed by Microsoft. For example, under appropriate licenses, the teachings may be embodied in software or services provided by other cloud service providers.

[0410] Although specific embodiments are explicitly shown and described herein as processes, configured storage media, or systems, it should be understood that discussions of one type of embodiment generally extend to other types of embodiments. For example, a description of a process in conjunction with the accompanying drawings also helps describe the configured storage media and helps describe the technical effects and operations of systems and manufacturing as discussed in conjunction with other figures. It does not follow that any limitations from one embodiment must be interpreted into another embodiment. Specifically, a process is not necessarily limited to the data structures and arrangements presented when discussing systems or manufacturing, such as configured storage.

[0411] Those skilled in the art will appreciate that implementation details may involve specific code, such as specific thresholds, comparisons, specific types of platforms or programming languages or architectures, specific scripts or other tasks, and specific computing environments, and therefore need not appear in every embodiment. Those skilled in the art will also appreciate that program identifiers and some other terms used when discussing details are implementation-specific and therefore need not relate to every embodiment. However, while they may not necessarily be present here, such details may help some readers by providing context and / or may illustrate some of the many possible implementations of the techniques discussed herein.

[0412] With due regard to the terms provided herein, including illustrative but not comprehensive technical processes, technical effects, technical mechanisms, and technical details of all claimed or claimable embodiments, it will be understood by those skilled in the art that the present disclosure and embodiments described herein do not relate to subject matter outside the technical field, or to any idea per se, such as a primary or original cause or motive, or only a result per se, or a mental process or mental step, or a business method or prevailing economic practice, or only a method of organizing human activity, or to a law of nature per se, or to a naturally occurring thing or process, or to an organism or part of an organism, or to a mathematical formula per se, or to isolated software per se, or to a conventional computer alone, or to anything completely imperceptible or any abstract concept per se, or to an insignificant post-solution activity, or to any method implemented entirely on an unspecified device, or to any method that fails to produce a useful and concrete result, or to any preemption of all fields of use, or to any other subject matter that is not eligible for patent protection under the laws of the jurisdiction in which such protection is sought, is being granted, or is being enforced.

[0413] References herein to an embodiment having some feature X and references elsewhere herein to an embodiment having some feature Y do not exclude from the present disclosure an embodiment having both feature X and feature Y, unless such exclusion is expressly stated herein. All possible negative claim limitations are within the scope of the present disclosure, as any feature stated as part of an embodiment may also be expressly removed from inclusion in another embodiment, even if that specific exclusion is not given in any example herein. The term "embodiment" is used herein merely as a more convenient form of "process, system, article, configured computer-readable storage medium, and / or other examples described herein," as applied in a manner consistent with applicable law. Thus, a given "embodiment" may include any combination of the features disclosed herein, so long as the embodiment is consistent with at least one claim.

[0414] Not every item shown in the accompanying drawings needs to be present in every embodiment. On the contrary, an embodiment may include items that are not explicitly shown in the accompanying drawings. Although some possibilities are shown in the text and drawings by specific examples, an embodiment may deviate from these examples. For example, a specific technical effect or technical feature of an example may be omitted, renamed, grouped differently, repeated, instantiated differently in hardware and / or software, or may be a mixture of effects or features that appear in two or more examples. In some embodiments, a function shown in one location may also be provided at a different location; those skilled in the art recognize that functional modules can be defined in various ways in a given implementation without omitting the desired technical effect from a set of interactive modules that are considered as a whole. Due to space limitations or for convenience, different steps may be shown together in a single box in the accompanying drawings, but can still be performed separately, for example, in a given execution of the method, one may be performed without the other.

[0415] Reference has been made to the drawings by reference numerals throughout the drawings. Any apparent inconsistency in the wording associated with a given reference numeral in the drawings or text should be understood to simply broaden the scope of the reference by that reference numeral. Even when the same reference numeral is used, different instances of a given reference numeral may refer to different embodiments. Similarly, a given reference numeral may be used to refer to a verb, a noun, and / or corresponding instances of each, e.g., a processor 110 may process 110 instructions by executing the instructions.

[0416] As used herein, terms such as "a," "an," and "the" include one or more of the indicated items or steps. Specifically, in the claims, reference to an item generally implies the presence of at least one such item, and reference to a step implies at least one instance of performing that step. Similarly, when the context permits, "is" and other singular verb forms should be understood to encompass the possibility of "are" and other plural forms to avoid grammatical errors or misunderstandings.

[0417] Headings are for convenience only; information about a given topic may be found outside the section whose heading indicates that topic.

[0418] All claims and the abstract, as filed, are part of the specification. The abstract is provided for convenience and to comply with patent office requirements; it is not a substitute for the claims and does not govern claim interpretation in the event of any apparent conflict with the rest of the specification. Similarly, the summary is provided for convenience and does not govern in the event of any conflict with the claims or with the rest of the specification. As understood by those skilled in the art, the claims should be interpreted in light of the specification; innovators are not required to recite every nuance within the claims themselves as if no other disclosure were provided herein.

[0419] Where any term used herein refers to or otherwise refers to an industry standard, and where applicable law requires identification of a particular version of such a standard, this disclosure should be understood to refer to the latest version of that standard as published under applicable patent law, at least in draft form (and, if later, in final form) as of the earliest priority date of this disclosure.

[0420] Although exemplary embodiments have been shown in the drawings and described above, it will be apparent to those skilled in the art that many modifications may be made without departing from the principles and concepts set forth in the claims, and that these modifications need not encompass the entire abstract concept. Although the subject matter has been described in language specific to structural features and / or procedural actions, it will be understood that the subject matter defined in the appended claims is not necessarily limited to the specific technical features or actions described above in the claims. Each device or aspect or technical effect identified in a given definition or example does not necessarily need to be present or used in every embodiment. Instead, the specific features and actions and effects described are disclosed as examples for consideration in implementing the claims.

[0421] All changes that do not encompass the entire abstract concept but come within the meaning and range of equivalency of the claims are to be embraced within their scope to the full extent permitted by law.< / t> < / t>

Claims

1. A computing system configured to support declarative interception of member calls, the computing system comprising: digital memory; a processor assembly comprising at least one processor in operable communication with the digital memory; a compiler that, when executed by the set of processors, performs compilation of source code, the source code including a declaration of interception of an artifact to be intercepted by a to-be-intercepted artifact interceptor, the source code further specifying the artifact to be intercepted, the artifact to be intercepted having a non-intercepted call, and wherein during the compilation, the compiler issues instructions to implement a call change from the non-intercepted call to a call to the interceptor within a call statement, the compiler issues instructions to implement a reference to the interceptor or instructions to implement the interceptor, or both; When the compiler is executed, the system configures an executable program based on the source code, and the execution of the executable program calls the interceptor instead of calling the product to be intercepted.

2. The computing system of claim 1 , wherein the artifact to be intercepted comprises at least one of the following: method; Fields of the data structure; a property of an object; or Members of an object.

3. The computing system of claim 1 , wherein the non-intercepting call comprises at least one of: Subroutine address; The base address of the data structure; or The offset address into the data structure.

4. The computing system of claim 1 , further comprising: A software development tool having a user interface, and wherein the user interface, when executed by the set of processors, displays the declaration for the interception and also displays a source code specification specifying the artifact to be intercepted.

5. The computing system of claim 1, further comprising a source generator, and wherein the declaration of the intercept is an output of the source generator.

6. A process executed by a computing system to support declarative interception of member calls, the process comprising: identifying, in source code, a declaration of interception of an artifact to be intercepted by a to-be-intercepted artifact interceptor, the source code further specifying the to-be-intercepted artifact, the to-be-intercepted artifact having a non-intercepted member call; During compilation of the source code, issuing instructions to implement a member call change from the non-intercepting member call to a call to the interceptor within a call statement; The process generates an executable program that is based on the source code and is configured to call the interceptor instead of calling the artifact to be intercepted.

7. The process of claim 6, further comprising: An interception location identifier is annotated in the declaration of the interception.

8. The process of claim 6, further comprising: A list of interceptions is collected before issuing instructions to implement the listed interceptions.

9. The process of claim 6, comprising: Instructions are emitted during compilation, the instructions configured to intercept virtual method calls by replacing the virtual method calls with non-virtual static method calls.

10. The process of claim 6, wherein the interceptor comprises a method having optional parameters.

11. The process of claim 6, further comprising: The interception is re-evaluated after receiving edits to the source code during the debugging session.

12. The process of claim 6, wherein the interceptor comprises a static interceptor method, the artifact to be intercepted comprises an artifact to be intercepted method, and a signature of the static interceptor method matches a signature of the artifact to be intercepted method.

13. A process according to claim 6, wherein the product to be intercepted includes a method, the process intercepts a first method call site of the method at a first method call site location, and the process avoids intercepting a second method call site of the method at a second method call site location, thereby limiting the interception of the method based on the method call site location.

14. The method of claim 6, further comprising at least one of the following: issuing instructions to implement the interceptor; or An instruction is issued to implement the product to be intercepted.

15. The process of claim 6, further comprising: An instruction is issued to map M interceptors to N artifacts to be intercepted, where M and N are each integers greater than 1.

16. A computer-readable storage device configured with data and instructions that, when executed by a processor, cause a computing system to perform a process for supporting declarative interception of member calls, the process comprising: identifying, in source code, a declaration of interception of an artifact to be intercepted by a to-be-intercepted artifact interceptor, the source code further specifying the artifact to be intercepted, the artifact to be intercepted having a non-intercept address; During compilation of the source code, issuing instructions to implement an address change within an access statement, the address change being from the non-intercepting address to the interceptor's address; The process generates an executable program that is based on the source code and is configured to access the interceptor instead of accessing the artifact to be intercepted.

17. The storage device of claim 16, wherein the process further comprises: An instruction to implement the interceptor is issued, and an instruction to implement the product to be intercepted is issued.

18. The storage device of claim 16, wherein the process further comprises: Computes parameter values for optional parameters of the interceptor. The storage device of claim 16 , wherein the declaration occurs in an attribute.

20. The storage device of claim 16 , wherein the process replaces a call to a member with a compatible expression, i.e., the compatible expression is type-equivalent to a method and all unbound variables in the compatible expression are equal in name and type to the unbound variables in the replaced call for the compatible expression.