Skip to content

Commit

Permalink
Stop serializing inputSourceMaps in CompilerState via Java serialization
Browse files Browse the repository at this point in the history
TypedAst objects will hold this information after cl/512173472

PiperOrigin-RevId: 516339388
  • Loading branch information
rahul-kamat authored and copybara-github committed Mar 13, 2023
1 parent 1a9a200 commit e61082a
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/com/google/javascript/jscomp/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
Expand Down Expand Up @@ -3921,9 +3920,6 @@ protected static class CompilerState implements Serializable {
private final String idGeneratorMap;
private final IdGenerator crossModuleIdGenerator;
private final boolean runJ2clPasses;
// TODO(b/235404079): Stop serializing input source maps here since we serialize them in
// TypedAsts
private final ImmutableMap<String, SourceMapInput> inputSourceMaps;
private final ImmutableList<InputId> externs;
private final ImmutableListMultimap<JSChunk, InputId> moduleToInputList;
private final LinkedHashSet<String> injectedLibraries;
Expand All @@ -3944,7 +3940,6 @@ protected static class CompilerState implements Serializable {
this.idGeneratorMap = compiler.idGeneratorMap;
this.crossModuleIdGenerator = compiler.crossModuleIdGenerator;
this.runJ2clPasses = compiler.runJ2clPasses;
this.inputSourceMaps = ImmutableMap.copyOf(new TreeMap<>(compiler.inputSourceMaps));
this.externs =
compiler.externs.stream().map(CompilerInput::getInputId).collect(toImmutableList());
this.moduleToInputList = mapJSModulesToInputIds(compiler.moduleGraph.getAllChunks());
Expand Down Expand Up @@ -3994,19 +3989,6 @@ protected void restoreFromState(CompilerState compilerState) {
changeStamp = 1;

accessorSummary = compilerState.accessorSummary;
inputSourceMaps = new ConcurrentHashMap<>(compilerState.inputSourceMaps);
if (options.shouldGatherSourceMapInfo()
&& options.sourceMapIncludeSourcesContent
&& options.applyInputSourceMaps) {
// The inline source maps found by the parser in stage one will be in the restored
// inputSourceMaps field.
// addSourceMapSourceFiles() is invoked by the parser during stage one.
// When restoring state, we need to do it again to get the source content from
// the inline source maps into our current source map object.
for (SourceMapInput inputSourceMap : inputSourceMaps.values()) {
addSourceMapSourceFiles(inputSourceMap);
}
}
}

private static final ImmutableListMultimap<JSChunk, InputId> mapJSModulesToInputIds(
Expand Down

0 comments on commit e61082a

Please sign in to comment.