From c450e092e5861a31b48c44bfb6d16e03b15668a4 Mon Sep 17 00:00:00 2001 From: Avik Chaudhuri Date: Wed, 28 Sep 2016 02:12:23 -0700 Subject: [PATCH] shared mem opts, part 4 Summary: Remove unnecessary field in info, which gets serialized / deserialized every time we access InfoHeap. Reviewed By: samwgoldman Differential Revision: D3918803 fbshipit-source-id: de9f48711bc64c5f55a5288c246809161bd298e0 --- src/services/inference/module_js.ml | 6 ++---- src/services/inference/module_js.mli | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/services/inference/module_js.ml b/src/services/inference/module_js.ml index 55bb8251996..328dc6eac05 100644 --- a/src/services/inference/module_js.ml +++ b/src/services/inference/module_js.ml @@ -43,7 +43,6 @@ module NameMap = MyMap.Make(Modulename) that's probably guessable. **) type info = { - file: filename; (* file name *) _module: Modulename.t; (* module name *) required: NameSet.t; (* required module names *) require_loc: Loc.t SMap.t; (* statement locations *) @@ -791,7 +790,6 @@ let info_of ~options cx = SMap.add (Modulename.to_string resolved_r) loc require_loc) (Context.require_loc cx) SMap.empty in { - file = Context.file cx; _module = Context.module_name cx; required; require_loc; @@ -806,7 +804,7 @@ let info_of ~options cx = Note that we wait to choose providers until inference is complete. *) let add_module_info ~audit ~options cx = let info = info_of ~options cx in - add_info ~audit info.file info + add_info ~audit (Context.file cx) info (* We need to track files that have failed to parse. This begins with adding tracking records for unparsed files to InfoHeap. They never @@ -824,7 +822,7 @@ let add_unparsed_info ~audit ~options file docblock = Docblock.is_flow docblock || Docblock.isDeclarationFile docblock in - let info = { file; _module; checked; parsed = false; + let info = { _module; checked; parsed = false; required = NameSet.empty; require_loc = SMap.empty; resolved_modules = SMap.empty; diff --git a/src/services/inference/module_js.mli b/src/services/inference/module_js.mli index 7c2b513d299..7b38c686001 100644 --- a/src/services/inference/module_js.mli +++ b/src/services/inference/module_js.mli @@ -14,7 +14,6 @@ module NameSet: Set.S with type elt = Modulename.t module NameMap: MyMap.S with type key = Modulename.t type info = { - file: filename; (* file name *) _module: Modulename.t; (* module name *) required: NameSet.t; (* required module names *) require_loc: Loc.t SMap.t; (* statement locations *)