Skip to content

Commit

Permalink
Also dump stats on display requests
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Mar 19, 2024
1 parent 65d97d1 commit 314e20c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/compiler/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ let compile ctx actx callbacks =
if is_compilation then Generate.check_auxiliary_output com actx;
enter_stage com CGenerationStart;
ServerMessage.compiler_stage com;
Generate.maybe_generate_dump ctx tctx;
Generate.maybe_generate_dump tctx;
if not actx.no_output then Generate.generate ctx tctx ext actx;
enter_stage com CGenerationDone;
ServerMessage.compiler_stage com;
Expand Down
8 changes: 5 additions & 3 deletions src/compiler/generate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ let parse_swf_header ctx h = match ExtString.String.nsplit h ":" with

let delete_file f = try Sys.remove f with _ -> ()

let maybe_generate_dump ctx tctx =
let maybe_generate_dump tctx =
let com = tctx.Typecore.com in
if Common.defined com Define.Dump then begin
Codegen.Dump.dump_types com;
Expand All @@ -115,8 +115,10 @@ let maybe_generate_dump ctx tctx =
if not com.is_macro_context then match tctx.Typecore.g.Typecore.macros with
| None -> ()
| Some(_,ctx) -> Codegen.Dump.dump_dependencies ~target_override:(Some "macro") ctx.Typecore.com
end;
if Common.defined ctx.com Define.DumpInvalidationStats then begin
end

let maybe_generate_stats_dump com =
if Common.defined com Define.DumpInvalidationStats then begin
Codegen.Dump.dump_invalidation_stats com;
Option.may Codegen.Dump.dump_invalidation_stats (com.get_macros())
end
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ let after_save sctx ctx =
maybe_cache_context sctx ctx.com

let after_compilation sctx ctx =
()
Generate.maybe_generate_stats_dump ctx.com

let mk_length_prefixed_communication allow_nonblock chin chout =
let sin = Unix.descr_of_in_channel chin in
Expand Down

0 comments on commit 314e20c

Please sign in to comment.