Skip to content

Commit e61082a

Browse files
rahul-kamatcopybara-github
authored andcommitted
Stop serializing inputSourceMaps in CompilerState via Java serialization
TypedAst objects will hold this information after cl/512173472 PiperOrigin-RevId: 516339388
1 parent 1a9a200 commit e61082a

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/com/google/javascript/jscomp/Compiler.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
import java.util.List;
112112
import java.util.Map;
113113
import java.util.Set;
114-
import java.util.TreeMap;
115114
import java.util.concurrent.Callable;
116115
import java.util.concurrent.ConcurrentHashMap;
117116
import java.util.concurrent.ConcurrentMap;
@@ -3921,9 +3920,6 @@ protected static class CompilerState implements Serializable {
39213920
private final String idGeneratorMap;
39223921
private final IdGenerator crossModuleIdGenerator;
39233922
private final boolean runJ2clPasses;
3924-
// TODO(b/235404079): Stop serializing input source maps here since we serialize them in
3925-
// TypedAsts
3926-
private final ImmutableMap<String, SourceMapInput> inputSourceMaps;
39273923
private final ImmutableList<InputId> externs;
39283924
private final ImmutableListMultimap<JSChunk, InputId> moduleToInputList;
39293925
private final LinkedHashSet<String> injectedLibraries;
@@ -3944,7 +3940,6 @@ protected static class CompilerState implements Serializable {
39443940
this.idGeneratorMap = compiler.idGeneratorMap;
39453941
this.crossModuleIdGenerator = compiler.crossModuleIdGenerator;
39463942
this.runJ2clPasses = compiler.runJ2clPasses;
3947-
this.inputSourceMaps = ImmutableMap.copyOf(new TreeMap<>(compiler.inputSourceMaps));
39483943
this.externs =
39493944
compiler.externs.stream().map(CompilerInput::getInputId).collect(toImmutableList());
39503945
this.moduleToInputList = mapJSModulesToInputIds(compiler.moduleGraph.getAllChunks());
@@ -3994,19 +3989,6 @@ protected void restoreFromState(CompilerState compilerState) {
39943989
changeStamp = 1;
39953990

39963991
accessorSummary = compilerState.accessorSummary;
3997-
inputSourceMaps = new ConcurrentHashMap<>(compilerState.inputSourceMaps);
3998-
if (options.shouldGatherSourceMapInfo()
3999-
&& options.sourceMapIncludeSourcesContent
4000-
&& options.applyInputSourceMaps) {
4001-
// The inline source maps found by the parser in stage one will be in the restored
4002-
// inputSourceMaps field.
4003-
// addSourceMapSourceFiles() is invoked by the parser during stage one.
4004-
// When restoring state, we need to do it again to get the source content from
4005-
// the inline source maps into our current source map object.
4006-
for (SourceMapInput inputSourceMap : inputSourceMaps.values()) {
4007-
addSourceMapSourceFiles(inputSourceMap);
4008-
}
4009-
}
40103992
}
40113993

40123994
private static final ImmutableListMultimap<JSChunk, InputId> mapJSModulesToInputIds(

0 commit comments

Comments
 (0)