Skip to content

Commit

Permalink
Modify DeviritualizePrototypeMethods to be run under `OptimizeCalls…
Browse files Browse the repository at this point in the history
…` and leverage that implementation of property/method usage identification.

This is a step towards supporting ES6 in `DevirtualizePrototypeMethods`.

`OptimizeCalls` is also updated to support clearly mapping potential definition sites to definition functions.

Closes #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=224361231
  • Loading branch information
nreid260 authored and brad4d committed Dec 7, 2018
1 parent bd189e5 commit 09eb7af
Show file tree
Hide file tree
Showing 7 changed files with 504 additions and 350 deletions.
4 changes: 3 additions & 1 deletion src/com/google/javascript/jscomp/DefaultPassConfig.java
Expand Up @@ -2429,7 +2429,9 @@ protected FeatureSet featureSet() {
new PassFactory(PassNames.DEVIRTUALIZE_PROTOTYPE_METHODS, true) { new PassFactory(PassNames.DEVIRTUALIZE_PROTOTYPE_METHODS, true) {
@Override @Override
protected CompilerPass create(AbstractCompiler compiler) { protected CompilerPass create(AbstractCompiler compiler) {
return new DevirtualizePrototypeMethods(compiler); OptimizeCalls passes = new OptimizeCalls(compiler);
passes.addPass(new DevirtualizePrototypeMethods(compiler));
return passes;
} }


@Override @Override
Expand Down

0 comments on commit 09eb7af

Please sign in to comment.