General Macros
ASSERTE
, this is used to define facilities called out for individual configurability when tracing.
, these macros dereference a pointer and fetch a value, even if the pointer is not a naturally-aligned pointer. Natural alignment is defined as ((UINT_PTR)p & (sizeof(p)-1)) == 0.
, this is used in debug-enabled builds to issue a logging message. See also DEFINE_LOG_FACILITY.
libfoo.dylib on Mac OS X, libfoo.so on FreeBSD, and foo.dll contains all opcode definitions for Rotor, and is shared by the C# compiler, the assembler and disassembler, and the execution engine.
should be changed to a matching ASSERT. To find regions of code that are platform-specific, use your favorite search or indexing utility to find these macros .
, these store a value into a pointer, even if the pointer is not naturally aligned. For platforms that automatically handle mis-aligned memory references, these macros expand to a simple dereferenced assignment. See also GET_UNALIGNED.
, these are used to simplify writing code to run on both big-endian and little-endian processors. They are no-ops on little-endian platforms, but byte-swapped on big-endian platforms. Given a value composed of 16, 32, or 64 bits in little-endian format, they return the value in the native format.
Execution Engine Macros
, these macros bracket code in which garbage collection is forbidden. They are activated in debug-enabled builds only.
code.
family of macros with additional code that maintains internal execution engine data structures. In particular, these protect the integrity of the frame chain. They are defined in clr/src/vm/exceptmacros.h.
supports both catch and finally clauses.) It is defined in clr/src/vm/exceptmacros.h.
, are used to declare and implement FCalls. Platform-to-platform differences in FCall calling conventions are encapsulated inside these macros.
would be used to throw exceptions if a helper frame were erected.) It is defined in clr/src/vm/frames.h.
are visible to the garbage collector, and the objects that they reference can be promoted safely. These macros are defined in clr/src/vm/frames.h.
are used to erect a helper frame within an FCall implementation. These helper frames must exist when an FCall wishes to call other parts of the execution engine that might trigger garbage collection or cause nonlocal changes. Simple FCalls do not need helper frames. Some flavors of HELPER_METHOD_FRAME expose a simplified version of GC_PROTECT, to reduce the number of frames pushed in the FCall.
, is used to mark code blocks that can throw exceptions. This is used only in debug-enabled builds.
and is augmented by platform-specific redefinition files that can be found in subdirectories named after their processor targets:
also contains macros used to emit code for manipulating the stack and calling helper functions:
, saves the a map of the evaluation stack and associates it with the current IL offset so that the garbage collector will be able to find roots on the stack. This macro is used before calls to JIT helper functions that may trigger garbage collection.
contains the API definitions for the PAL, as well as these macros, which result in calls against the PAL's exception-handling mechanism.
macros in that it doesn't take an expression as an argument. It is a printf-style logger plus an optional debug breakpoint. This is a no-op in the "free" build.
Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=1531737JIT Compiler Macros
PAL & Platform Macros