Track initializer's loaded event per file

Proposed implementation of tracking load initializers for  #12745

@xaviershay, you may cherry-pick this commit if you needed it for your implementation.