Skip to content

Commit

Permalink
Rename completeCompilation and make it run after serialization.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157532917
  • Loading branch information
rluble authored and brad4d committed May 31, 2017
1 parent 99f5e46 commit e19dfa6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Expand Up @@ -1158,8 +1158,8 @@ private Result performStage1andSave(String filename) {
compiler.parseForCompilation(); compiler.parseForCompilation();
if (!compiler.hasErrors()) { if (!compiler.hasErrors()) {
compiler.stage1Passes(); compiler.stage1Passes();
compiler.completeCompilation();
compiler.saveState(serializedOutputStream); compiler.saveState(serializedOutputStream);
compiler.performPostCompilationTasks();
} }
} catch (IOException e) { } catch (IOException e) {
compiler.report(JSError.make(COULD_NOT_SERIALIZE_AST, filename)); compiler.report(JSError.make(COULD_NOT_SERIALIZE_AST, filename));
Expand All @@ -1179,7 +1179,7 @@ private Result restoreAndPerformStage2(String filename) {
if (!compiler.hasErrors()) { if (!compiler.hasErrors()) {
compiler.stage2Passes(); compiler.stage2Passes();
} }
compiler.completeCompilation(); compiler.performPostCompilationTasks();
} catch (IOException e) { } catch (IOException e) {
compiler.report(JSError.make(COULD_NOT_DESERIALIZE_AST, filename)); compiler.report(JSError.make(COULD_NOT_DESERIALIZE_AST, filename));
} finally { } finally {
Expand All @@ -1200,7 +1200,7 @@ private Result performFullCompilation() {
if (!compiler.hasErrors()) { if (!compiler.hasErrors()) {
compiler.stage2Passes(); compiler.stage2Passes();
} }
compiler.completeCompilation(); compiler.performPostCompilationTasks();
} }
} finally { } finally {
// Make sure we generate a report of errors and warnings even if the compiler throws an // Make sure we generate a report of errors and warnings even if the compiler throws an
Expand Down
10 changes: 5 additions & 5 deletions src/com/google/javascript/jscomp/Compiler.java
Expand Up @@ -746,7 +746,7 @@ public <T1 extends SourceFile, T2 extends SourceFile> Result compile(
stage2Passes(); stage2Passes();
} }
} }
completeCompilation(); performPostCompilationTasks();
} }
} finally { } finally {
generateReport(); generateReport();
Expand Down Expand Up @@ -801,7 +801,7 @@ public <T extends SourceFile> Result compileModules(
stage2Passes(); stage2Passes();
} }
} }
completeCompilation(); performPostCompilationTasks();
} }
} finally { } finally {
generateReport(); generateReport();
Expand Down Expand Up @@ -905,12 +905,12 @@ private void performChecksAndTranspilation() {
* <p> DON'T call it if the compiler threw an exception. * <p> DON'T call it if the compiler threw an exception.
* <p> DO call it even when {@code hasErrors()} returns true. * <p> DO call it even when {@code hasErrors()} returns true.
*/ */
public void completeCompilation() { public void performPostCompilationTasks() {
runInCompilerThread(new Callable<Void>() { runInCompilerThread(new Callable<Void>() {


@Override @Override
public Void call() throws Exception { public Void call() throws Exception {
completeCompilationInternal(); performPostCompilationTasksInternal();
return null; return null;
} }


Expand All @@ -920,7 +920,7 @@ public Void call() throws Exception {
/** /**
* Performs all the bookkeeping required at the end of a compilation. * Performs all the bookkeeping required at the end of a compilation.
*/ */
private void completeCompilationInternal() { private void performPostCompilationTasksInternal() {
if (options.recordFunctionInformation) { if (options.recordFunctionInformation) {
recordFunctionInformation(); recordFunctionInformation();
} }
Expand Down

0 comments on commit e19dfa6

Please sign in to comment.