Skip to content

Commit

Permalink
JIT: refactor instrumentation code (#47509)
Browse files Browse the repository at this point in the history
Refactor `fgInstrument` and related methods and classes, so that the strategies
for block and class instrumentation are clearly separated out, and can be
varied.
  • Loading branch information
AndyAyersMS authored Jan 28, 2021
1 parent e4dc8ee commit ba6fb5d
Show file tree
Hide file tree
Showing 4 changed files with 560 additions and 311 deletions.
12 changes: 10 additions & 2 deletions src/coreclr/jit/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,16 @@ struct BasicBlock : private LIR::Range
};

#define NO_BASE_TMP UINT_MAX // base# to use when we have none
unsigned bbStkTempsIn; // base# for input stack temps
unsigned bbStkTempsOut; // base# for output stack temps

union {
unsigned bbStkTempsIn; // base# for input stack temps
int bbCountSchemaIndex; // schema index for count instrumentation
};

union {
unsigned bbStkTempsOut; // base# for output stack temps
int bbClassSchemaIndex; // schema index for class instrumentation
};

#define MAX_XCPTN_INDEX (USHRT_MAX - 1)

Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5586,15 +5586,14 @@ class Compiler
#endif

public:
Statement* fgNewStmtAtBeg(BasicBlock* block, GenTree* tree);
void fgInsertStmtAtEnd(BasicBlock* block, Statement* stmt);
Statement* fgNewStmtAtEnd(BasicBlock* block, GenTree* tree);
Statement* fgNewStmtNearEnd(BasicBlock* block, GenTree* tree);

private:
void fgInsertStmtNearEnd(BasicBlock* block, Statement* stmt);
void fgInsertStmtAtBeg(BasicBlock* block, Statement* stmt);
Statement* fgNewStmtAtBeg(BasicBlock* block, GenTree* tree);

void fgInsertStmtAfter(BasicBlock* block, Statement* insertionPoint, Statement* stmt);

public:
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/compmemkind.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ CompMemKindMacro(ClassLayout)
CompMemKindMacro(TailMergeThrows)
CompMemKindMacro(EarlyProp)
CompMemKindMacro(ZeroInit)
CompMemKindMacro(Pgo)
//clang-format on

#undef CompMemKindMacro
Loading

0 comments on commit ba6fb5d

Please sign in to comment.