Skip to content

Commit

Permalink
Disable deprecated fragment merge, deprecates unused final props
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Sep 26, 2024
1 parent b7a2d67 commit 39218db
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public PrecompileTaskArgProcessor(PrecompileTaskOptions options) {
registerHandler(new ArgHandlerDumpSignatures());
registerHandler(new ArgHandlerEnableAssertions(options));
registerHandler(new ArgHandlerFragmentCount(options));
registerHandler(new ArgHandlerFragmentMerge(options));
registerHandler(new ArgHandlerFragmentMerge());
registerHandler(new ArgHandlerGenDir(options));
registerHandler(new ArgHandlerGenerateJsInteropExports(options));
registerHandler(new ArgHandlerFilterJsInteropExports(options));
Expand Down
4 changes: 1 addition & 3 deletions dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class JJSOptionsImpl implements JJSOptions, Serializable {
private boolean disableClassMetadata = false;
private boolean enableAssertions;
private int fragmentCount = -1;
private int fragmentsMerge = -1;
private boolean inlineLiteralParameters = true;
private boolean jsonSoycEnabled = false;
private JsNamespaceOption namespace = JsNamespaceOption.NONE;
Expand Down Expand Up @@ -97,7 +96,7 @@ public int getFragmentCount() {

@Override
public int getFragmentsMerge() {
return fragmentsMerge;
return -1;
}

@Override
Expand Down Expand Up @@ -210,7 +209,6 @@ public void setFragmentCount(int numFragments) {

@Override
public void setFragmentsMerge(int numFragments) {
this.fragmentsMerge = numFragments;
}

@Override
Expand Down
12 changes: 0 additions & 12 deletions dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,6 @@ private Pair<SyntheticArtifact, MultipleDependencyGraphRecorder> splitJsIntoFrag
ByteArrayOutputStream baos = new ByteArrayOutputStream();

int expectedFragmentCount = options.getFragmentCount();
// -1 is the default value, we trap 0 just in case (0 is not a legal value in any case)
if (expectedFragmentCount <= 0) {
// Fragment count not set check fragments merge.
int numberOfMerges = options.getFragmentsMerge();
if (numberOfMerges > 0) {
// + 1 for left over, + 1 for initial gave us the total number
// of fragments without splitting.
expectedFragmentCount =
Math.max(0, jprogram.getRunAsyncs().size() + 2 - numberOfMerges);
}
}

int minFragmentSize = properties.getConfigurationProperties()
.getInteger(CodeSplitters.MIN_FRAGMENT_SIZE, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,14 @@
*/
package com.google.gwt.dev.util.arg;

import com.google.gwt.util.tools.ArgHandlerInt;
import com.google.gwt.util.tools.ArgHandlerNoopDeprecatedFlag;

/**
* An ArgHandler to provide the -XfragmentMerge flag.
*/
public class ArgHandlerFragmentMerge extends ArgHandlerInt {

private final OptionFragmentsMerge option;

public ArgHandlerFragmentMerge(OptionFragmentsMerge option) {
this.option = option;
}

@Override
public String getPurpose() {
return "DEPRECATED (use -XfragmentCount instead): " +
"Enables Fragment merging code splitter.";
}

@Override
public String getTag() {
return "-XfragmentMerge";
}

@Override
public String[] getTagArgs() {
return new String[] {"numFragments"};
}

@Override
public void setInt(int value) {
option.setFragmentsMerge(value);
@Deprecated
public class ArgHandlerFragmentMerge extends ArgHandlerNoopDeprecatedFlag {
public ArgHandlerFragmentMerge() {
super(1, "numFragments");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
import com.google.gwt.dev.cfg.Properties;

/**
* Option providing a set of properties representing the final property state that will be reached
* at the root of a library compile tree.
* <p>
* Library compilation uses this as a guide for how long it must delay generator execution to avoid
* having to rerun the same generator again later when properties it depends on change.
* Deprecated for removal, no longer read by the compiler since the remainder of the
* library feature was removed.
*/
@Deprecated
public interface OptionFinalProperties {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/**
* Enable the new code splitter that auto-partitions.
*/
@Deprecated
public interface OptionFragmentsMerge {
// TODO(acleung): Delete this in favor of -XfragmentCount

Expand Down

0 comments on commit 39218db

Please sign in to comment.