Skip to content

Commit c9c62b1

Browse files
authored
Merge branch 'gwtproject:main' into math
2 parents 92c79a9 + 8d9a7f0 commit c9c62b1

File tree

17 files changed

+68
-29
lines changed

17 files changed

+68
-29
lines changed

dev/codeserver/java/com/google/gwt/dev/codeserver/OutboxDir.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.gwt.core.ext.TreeLogger.Type;
2121
import com.google.gwt.core.ext.UnableToCompleteException;
2222
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
23+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
2324

2425
import java.io.File;
2526
import java.io.IOException;
@@ -87,7 +88,7 @@ static OutboxDir create(File dir, TreeLogger logger) throws IOException {
8788
// (This is not guaranteed to delete all directories on Windows if a directory is locked.)
8889
for (File candidate : children) {
8990
if (candidate.getName().startsWith(COMPILE_DIR_PREFIX)) {
90-
MoreFiles.deleteRecursively(candidate.toPath());
91+
MoreFiles.deleteRecursively(candidate.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
9192
if (candidate.exists()) {
9293
logger.log(Type.WARN, "unable to delete '" + candidate + "' (skipped)");
9394
}

dev/core/src/com/google/gwt/dev/CompileTaskOptionsImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.gwt.core.ext.UnableToCompleteException;
2121
import com.google.gwt.dev.cfg.Properties;
2222
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
23+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
2324

2425
import java.io.File;
2526
import java.io.IOException;
@@ -61,7 +62,8 @@ public File createCompilerWorkDir(TreeLogger logger, String moduleName)
6162
File compilerWorkDir = getCompilerWorkDir(moduleName);
6263
if (compilerWorkDir.exists()) {
6364
try {
64-
MoreFiles.deleteDirectoryContents(compilerWorkDir.toPath());
65+
MoreFiles.deleteDirectoryContents(compilerWorkDir.toPath(),
66+
RecursiveDeleteOption.ALLOW_INSECURE);
6567
} catch (IOException e) {
6668
logger.log(TreeLogger.ERROR, "Unable to delete contents of " + compilerWorkDir, e);
6769
throw new UnableToCompleteException();

dev/core/src/com/google/gwt/dev/Compiler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
4141
import com.google.gwt.thirdparty.guava.common.collect.Sets;
4242
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
43+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
4344

4445
import java.io.File;
4546
import java.io.IOException;
@@ -247,7 +248,8 @@ public static boolean compile(
247248
} finally {
248249
if (tempWorkDir) {
249250
try {
250-
MoreFiles.deleteRecursively(options.getWorkDir().toPath());
251+
MoreFiles.deleteRecursively(options.getWorkDir().toPath(),
252+
RecursiveDeleteOption.ALLOW_INSECURE);
251253
} catch (IOException e) {
252254
logger.log(TreeLogger.WARN, "Unable to delete temporary work directory: "
253255
+ options.getWorkDir(), e);

dev/core/src/com/google/gwt/dev/DevMode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger;
5151
import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
5252
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
53+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
5354
import com.google.gwt.util.tools.ArgHandlerFlag;
5455
import com.google.gwt.util.tools.ArgHandlerString;
5556

@@ -494,7 +495,8 @@ protected void doShutDownServer() {
494495

495496
if (tempWorkDir) {
496497
try {
497-
MoreFiles.deleteRecursively(options.getWorkDir().toPath());
498+
MoreFiles.deleteRecursively(options.getWorkDir().toPath(),
499+
RecursiveDeleteOption.ALLOW_INSECURE);
498500
} catch (IOException e) {
499501
getTopLogger().log(TreeLogger.ERROR,
500502
"Unable to delete temporary work directory " + options.getWorkDir().getAbsolutePath(),

dev/core/src/com/google/gwt/dev/Link.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
5757
import com.google.gwt.thirdparty.guava.common.collect.Sets;
5858
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
59+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
5960

6061
import java.io.BufferedInputStream;
6162
import java.io.File;
@@ -345,7 +346,7 @@ static OutputFileSet chooseOutputFileSet(File dirOrJar,
345346
} else {
346347
File target = new File(dirOrJar, pathPrefix);
347348
if (target.exists()) {
348-
MoreFiles.deleteDirectoryContents(target.toPath());
349+
MoreFiles.deleteDirectoryContents(target.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
349350
}
350351
return new OutputFileSetOnDirectory(dirOrJar, pathPrefix);
351352
}

dev/core/src/com/google/gwt/dev/jjs/impl/MethodInliner.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ public void endVisit(JMethodCall x, Context ctx) {
134134
return;
135135
}
136136

137+
JMethod.Specialization specialization = getCurrentMethod().getSpecialization();
138+
// If we have a specialization, don't inline that away - specializations must be called
139+
// so they aren't pruned or type tightened into uselessness.
140+
if (specialization != null) {
141+
if (specialization.getTargetMethod() == method) {
142+
return;
143+
}
144+
// We might have had a static impl that in turn will have a specialization - ensure we
145+
// also don't inline that specialization away. Note that this check looks for it "backwards"
146+
// by checking if the inlinable method has an instance method, since current method might
147+
// have once had a static method, but it was already removed.
148+
if (specialization.getTargetMethod() == program.instanceMethodForStaticImpl(method)) {
149+
return;
150+
}
151+
}
152+
137153
if (tryInlineMethodCall(x, ctx) == InlineResult.BLACKLIST) {
138154
// Do not try to inline this method again
139155
cannotInline.add(method);

dev/core/test/com/google/gwt/core/ext/linker/SourceMapTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.google.gwt.thirdparty.guava.common.collect.Maps;
3333
import com.google.gwt.thirdparty.guava.common.collect.Sets;
3434
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
35+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
3536
import com.google.gwt.thirdparty.guava.common.primitives.Ints;
3637
import com.google.gwt.thirdparty.json.JSONArray;
3738
import com.google.gwt.thirdparty.json.JSONException;
@@ -528,7 +529,7 @@ public void testSourceMap() throws Exception {
528529
testSoycCorrespondence(new File(parentDir + "/soycReport/"));
529530

530531
} finally {
531-
MoreFiles.deleteRecursively(work.toPath());
532+
MoreFiles.deleteRecursively(work.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
532533
}
533534
}
534535
}

dev/core/test/com/google/gwt/core/ext/linker/SymbolMapTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.google.gwt.thirdparty.guava.common.collect.Maps;
2727
import com.google.gwt.thirdparty.guava.common.collect.Multimap;
2828
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
29+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
2930

3031
import junit.framework.TestCase;
3132

@@ -242,7 +243,7 @@ private void assertSymbolMapSanity(int optimizeLevel) throws Exception {
242243
assertSymbolUniquenessForMethods(symbolDataByJsniIdentifier);
243244
}
244245
} finally {
245-
MoreFiles.deleteRecursively(work.toPath());
246+
MoreFiles.deleteRecursively(work.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
246247
}
247248
}
248249

dev/core/test/com/google/gwt/dev/CompilerTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.google.gwt.thirdparty.guava.common.collect.Lists;
3838
import com.google.gwt.thirdparty.guava.common.collect.Sets;
3939
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
40+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
4041

4142
import java.io.File;
4243
import java.io.IOException;
@@ -2505,7 +2506,7 @@ private void assertCompileSucceeds(CompilerOptions options, String moduleName,
25052506
// is clean to avoid confusion when returning the output JS.
25062507
File outputDir = new File(applicationDir.getPath() + File.separator + moduleName);
25072508
if (outputDir.exists()) {
2508-
MoreFiles.deleteDirectoryContents(outputDir.toPath());
2509+
MoreFiles.deleteDirectoryContents(outputDir.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
25092510
}
25102511

25112512
// Fake out the resource loader to read resources both from the normal classpath as well as
@@ -2537,7 +2538,7 @@ private void assertCompileSucceeds(CompilerOptions options, String moduleName,
25372538
// Run the compiler once here.
25382539
Compiler.compile(logger, options);
25392540
} finally {
2540-
MoreFiles.deleteRecursively(compileWorkDir.toPath());
2541+
MoreFiles.deleteRecursively(compileWorkDir.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
25412542
if (oldPersistentUnitCacheValue == null) {
25422543
System.clearProperty(UnitCacheSingleton.GWT_PERSISTENTUNITCACHE);
25432544
} else {
@@ -2584,8 +2585,8 @@ private void assertDeterministicBuild(String topLevelModule, int optimizationLev
25842585
} else {
25852586
System.setProperty(UnitCacheSingleton.GWT_PERSISTENTUNITCACHE, oldPersistentUnitCacheValue);
25862587
}
2587-
MoreFiles.deleteRecursively(firstCompileWorkDir.toPath());
2588-
MoreFiles.deleteRecursively(secondCompileWorkDir.toPath());
2588+
MoreFiles.deleteRecursively(firstCompileWorkDir.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
2589+
MoreFiles.deleteRecursively(secondCompileWorkDir.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
25892590
}
25902591
}
25912592

@@ -2689,7 +2690,7 @@ private String compileToJs(TreeLogger logger, CompilerOptions compilerOptions, F
26892690
// clean to avoid confusion when returning the output JS.
26902691
File outputDir = new File(applicationDir.getPath() + File.separator + moduleName);
26912692
if (outputDir.exists()) {
2692-
MoreFiles.deleteDirectoryContents(outputDir.toPath());
2693+
MoreFiles.deleteDirectoryContents(outputDir.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
26932694
}
26942695

26952696
// Fake out the resource loader to read resources both from the normal classpath as well as this

dev/core/test/com/google/gwt/dev/SoycTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.google.gwt.core.ext.UnableToCompleteException;
2020
import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
2121
import com.google.gwt.thirdparty.guava.common.io.MoreFiles;
22+
import com.google.gwt.thirdparty.guava.common.io.RecursiveDeleteOption;
2223

2324
import junit.framework.TestCase;
2425

@@ -52,7 +53,7 @@ public void testSoyc() throws UnableToCompleteException, IOException {
5253

5354
assertFalse(new File(options.getExtraDir() + "/hello/soycReport/compile-report/index2.html").exists());
5455
} finally {
55-
MoreFiles.deleteRecursively(work.toPath());
56+
MoreFiles.deleteRecursively(work.toPath(), RecursiveDeleteOption.ALLOW_INSECURE);
5657
}
5758
}
5859
}

0 commit comments

Comments
 (0)