diff --git a/ets2panda/public/es2panda_lib.cpp b/ets2panda/public/es2panda_lib.cpp index 81b369462330b35829cc53c73e1945778f69c393..097c74aae1027c42931824c4198fbe81a92731b3 100644 --- a/ets2panda/public/es2panda_lib.cpp +++ b/ets2panda/public/es2panda_lib.cpp @@ -578,6 +578,7 @@ __attribute__((unused)) static Context *Bind(Context *ctx) if (phase->Name() == "plugins-after-bind") { break; } + ES2PANDA_PERF_EVENT_SCOPE("@phases-bind/" + std::string(phase->Name())); phase->Apply(ctx, ctx->parserProgram); } ctx->state = ES2PANDA_STATE_BOUND; @@ -599,6 +600,7 @@ __attribute__((unused)) static Context *Check(Context *ctx) if (phase->Name() == "plugins-after-check") { break; } + ES2PANDA_PERF_EVENT_SCOPE("@phases-check/" + std::string(phase->Name())); phase->Apply(ctx, ctx->parserProgram); } ctx->phaseManager->SetCurrentPhaseIdToAfterCheck(); @@ -639,6 +641,7 @@ __attribute__((unused)) static Context *Lower(Context *ctx) ES2PANDA_ASSERT(ctx->state == ES2PANDA_STATE_CHECKED); while (auto phase = ctx->phaseManager->NextPhase()) { + ES2PANDA_PERF_EVENT_SCOPE("@phases-lower/" + std::string(phase->Name())); phase->Apply(ctx, ctx->parserProgram); } ctx->state = !ctx->diagnosticEngine->IsAnyError() ? ES2PANDA_STATE_LOWERED : ES2PANDA_STATE_ERROR; @@ -741,6 +744,7 @@ extern "C" __attribute__((unused)) es2panda_Context *ProceedToState(es2panda_Con ctx->state = ES2PANDA_STATE_ERROR; break; } + util::DumpPerfMetrics(); return reinterpret_cast(ctx); }