Skip to content

Commit

Permalink
Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
Browse files Browse the repository at this point in the history
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and commit-bot@chromium.org committed Aug 29, 2018
1 parent a4b3a85 commit 1f52372
Show file tree
Hide file tree
Showing 233 changed files with 1,140 additions and 17,598 deletions.
6 changes: 0 additions & 6 deletions pkg/analysis_server/benchmark/benchmarks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ class RunCommand extends Command {
help: 'Run a quick version of the benchmark. This is not useful for '
'gathering accurate times,\nbut can be used to validate that the '
'benchmark works.');
argParser.addFlag('use-cfe',
negatable: false,
help: 'Benchmark against the Dart 2.0 front end implementation.');
argParser.addOption('repeat',
defaultsTo: '10', help: 'The number of times to repeat the benchmark.');
argParser.addFlag('verbose',
Expand All @@ -98,7 +95,6 @@ class RunCommand extends Command {
final String benchmarkId = argResults.rest.first;
final int repeatCount = int.parse(argResults['repeat'] as String);
final bool quick = argResults['quick'];
final bool useCFE = argResults['use-cfe'];
final bool verbose = argResults['verbose'];

final Benchmark benchmark =
Expand Down Expand Up @@ -127,7 +123,6 @@ class RunCommand extends Command {
for (int iteration = 0; iteration < actualIterations; iteration++) {
BenchMarkResult newResult = await benchmark.run(
quick: quick,
useCFE: useCFE,
verbose: verbose,
);
print(' $newResult');
Expand Down Expand Up @@ -166,7 +161,6 @@ abstract class Benchmark {

Future<BenchMarkResult> run({
bool quick: false,
bool useCFE: false,
bool verbose: false,
});

Expand Down
6 changes: 2 additions & 4 deletions pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class ColdAnalysisBenchmark extends Benchmark {
@override
Future<BenchMarkResult> run({
bool quick: false,
bool useCFE: false,
bool verbose: false,
}) async {
if (!quick) {
Expand All @@ -38,7 +37,7 @@ class ColdAnalysisBenchmark extends Benchmark {
Stopwatch stopwatch = new Stopwatch()..start();

AnalysisServerMemoryUsageTest test = new AnalysisServerMemoryUsageTest();
await test.setUp(useCFE: useCFE);
await test.setUp();
await test.subscribeToStatusNotifications();
await test.sendAnalysisSetAnalysisRoots(getProjectRoots(quick: quick), []);
await test.analysisFinished;
Expand Down Expand Up @@ -73,7 +72,6 @@ class AnalysisBenchmark extends Benchmark {
@override
Future<BenchMarkResult> run({
bool quick: false,
bool useCFE: false,
bool verbose: false,
}) async {
Stopwatch stopwatch = new Stopwatch()..start();
Expand All @@ -82,7 +80,7 @@ class AnalysisBenchmark extends Benchmark {
if (verbose) {
test.debugStdio();
}
await test.setUp(useCFE: useCFE);
await test.setUp();
await test.subscribeToStatusNotifications();
await test.sendAnalysisSetAnalysisRoots(getProjectRoots(quick: quick), []);
await test.analysisFinished;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class FlutterAnalyzeBenchmark extends Benchmark {
@override
Future<BenchMarkResult> run({
bool quick: false,
bool useCFE: false,
bool verbose: false,
}) async {
if (!quick) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/analysis_server/benchmark/perf/memory_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AnalysisServerMemoryUsageTest
* The server is automatically started before every test.
*/
@override
Future setUp({bool useCFE: false}) {
Future setUp() {
onAnalysisErrors.listen((AnalysisErrorsParams params) {
currentAnalysisErrors[params.file] = params.errors;
});
Expand All @@ -78,7 +78,7 @@ class AnalysisServerMemoryUsageTest
outOfTestExpect(serverConnected.isCompleted, isFalse);
serverConnected.complete();
});
return startServer(servicesPort: vmServicePort, cfe: useCFE).then((_) {
return startServer(servicesPort: vmServicePort).then((_) {
server.listenToOutput(dispatchNotification);
server.exitCode.then((_) {
skipShutdown = true;
Expand Down
10 changes: 1 addition & 9 deletions pkg/analysis_server/lib/src/analysis_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,7 @@ class AnalysisServer {
new PluginWatcher(resourceProvider, pluginManager);

defaultContextOptions.generateImplicitErrors = false;
defaultContextOptions.useFastaParser =
options.useCFE || options.useFastaParser;
defaultContextOptions.useCFE = options.useCFE;
defaultContextOptions.useFastaParser = options.useFastaParser;

{
String name = options.newAnalysisDriverLog;
Expand Down Expand Up @@ -1188,11 +1186,6 @@ class AnalysisServerOptions {
*/
CrashReportSender crashReportSender;

/**
* Whether to enable the Dart 2.0 Common Front End implementation.
*/
bool useCFE = false;

/**
* Whether to enable parsing via the Fasta parser.
*/
Expand Down Expand Up @@ -1421,7 +1414,6 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
builder.performanceLog = analysisServer._analysisPerformanceLogger;
builder.byteStore = analysisServer.byteStore;
builder.fileContentOverlay = analysisServer.fileContentOverlay;
builder.useCFE = analysisServer.options.useCFE;
return builder;
}

Expand Down
26 changes: 3 additions & 23 deletions pkg/analysis_server/lib/src/server/driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ class Driver implements ServerStarter {
*/
static const String CACHE_FOLDER = "cache";

/**
* Whether to enable the Dart 2.0 Common Front End implementation.
*/
static const String USE_CFE = "use-cfe";

/**
* Whether to enable parsing via the Fasta parser.
*/
Expand Down Expand Up @@ -312,7 +307,6 @@ class Driver implements ServerStarter {
analysisServerOptions.clientId = results[CLIENT_ID];
analysisServerOptions.clientVersion = results[CLIENT_VERSION];
analysisServerOptions.cacheFolder = results[CACHE_FOLDER];
analysisServerOptions.useCFE = results[USE_CFE];
analysisServerOptions.useFastaParser = results[USE_FASTA_PARSER];

bool disableAnalyticsForSession = results[SUPPRESS_ANALYTICS_FLAG];
Expand Down Expand Up @@ -455,16 +449,14 @@ class Driver implements ServerStarter {

() async {
// We first analyze code with an empty driver cache.
print('Analyzing${analysisServerOptions.useCFE ? ' using CFE' : ''} '
'with an empty driver cache:');
print('Analyzing with an empty driver cache:');
int exitCode = await devServer.processDirectories([trainDirectory]);
if (exitCode != 0) exit(exitCode);

print('');

// Then again with a populated cache.
print('Analyzing${analysisServerOptions.useCFE ? ' using CFE' : ''} '
'with a populated driver cache:');
print('Analyzing with a populated driver cache:');
exitCode = await devServer.processDirectories([trainDirectory]);
if (exitCode != 0) exit(exitCode);

Expand All @@ -479,17 +471,7 @@ class Driver implements ServerStarter {
// ignore any exception
}

if (!analysisServerOptions.useCFE) {
print('');

// And then run everything again with CFE to train both frontends.
List<String> args = new List<String>.from(arguments);
args.add("--use-cfe");
ServerStarter starter = new ServerStarter();
starter.start(args);
} else {
exit(exitCode);
}
exit(exitCode);
}();
} else {
_captureExceptions(instrumentationService, () {
Expand Down Expand Up @@ -600,8 +582,6 @@ class Driver implements ServerStarter {
help: "[path] path to the location where to cache data");
parser.addFlag("preview-dart-2",
help: "Enable the Dart 2.0 preview (deprecated)", hide: true);
parser.addFlag(USE_CFE,
help: "Enable the Dart 2.0 Common Front End implementation");
parser.addFlag(USE_FASTA_PARSER,
defaultsTo: true,
help: "Whether to enable parsing via the Fasta parser");
Expand Down
2 changes: 0 additions & 2 deletions pkg/analysis_server/lib/src/status/diagnostics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1305,8 +1305,6 @@ class StatusPage extends DiagnosticPageWithNav {
h3('Status');
buf.writeln(writeOption('Use fasta parser',
diagnosticsSite.socketServer.analysisServerOptions.useFastaParser));
buf.writeln(writeOption('Use common front end',
diagnosticsSite.socketServer.analysisServerOptions.useCFE));
buf.writeln(writeOption('Instrumentation enabled',
AnalysisEngine.instance.instrumentationService.isActive));
buf.writeln(writeOption('Server process ID', pid));
Expand Down
9 changes: 2 additions & 7 deletions pkg/analysis_server/test/abstract_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:analyzer/src/dart/analysis/file_state.dart';
import 'package:analyzer/src/file_system/file_system.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/engine.dart' as engine;
import 'package:analyzer/src/generated/parser.dart' as analyzer;
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/source/package_map_resolver.dart';
Expand Down Expand Up @@ -58,11 +59,6 @@ class AbstractContextTest extends Object with ResourceProviderMixin {

AnalysisDriver get driver => _driver;

/**
* Return `true` to enable the Dart 2.0 Common Front End.
*/
bool get useCFE => false;

void addFlutterPackage() {
addMetaPackageSource();
Folder libFolder = configureFlutterPackage(resourceProvider);
Expand Down Expand Up @@ -153,8 +149,7 @@ class _IsTestGroup {
new ContextRoot(resourceProvider.convertPath('/project'), [],
pathContext: resourceProvider.pathContext),
sourceFactory,
new AnalysisOptionsImpl()..useFastaParser = useCFE,
useCFE: useCFE);
new AnalysisOptionsImpl()..useFastaParser = analyzer.Parser.useFasta);
scheduler.start();
AnalysisEngine.instance.logger = PrintLogger.instance;
}
Expand Down
17 changes: 0 additions & 17 deletions pkg/analysis_server/test/analysis/get_errors_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import '../analysis_abstract.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(GetErrorsTest);
defineReflectiveTests(GetErrorsTest_UseCFE);
});
}

Expand Down Expand Up @@ -149,19 +148,3 @@ main() {
return new AnalysisGetErrorsResult.fromResponse(response).errors;
}
}

@reflectiveTest
class GetErrorsTest_UseCFE extends GetErrorsTest {
@override
bool get useCFE => true;

@failingTest
@override
test_errorInPart() => super.test_errorInPart();

@override
test_fileDoesNotExist() => super.test_fileDoesNotExist();

@override
test_removeContextAfterRequest() => super.test_removeContextAfterRequest();
}
7 changes: 0 additions & 7 deletions pkg/analysis_server/test/analysis/get_hover_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import '../analysis_abstract.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(AnalysisHoverTest);
defineReflectiveTests(AnalysisHoverTest_UseCFE);
});
}

Expand Down Expand Up @@ -613,9 +612,3 @@ main() {
expect(hover, isNull);
}
}

@reflectiveTest
class AnalysisHoverTest_UseCFE extends AnalysisHoverTest {
@override
bool get useCFE => true;
}
7 changes: 0 additions & 7 deletions pkg/analysis_server/test/analysis/get_navigation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'notification_navigation_test.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(GetNavigationTest);
defineReflectiveTests(GetNavigationTest_UseCFE);
});
}

Expand Down Expand Up @@ -247,9 +246,3 @@ main() {
regions = result.regions;
}
}

@reflectiveTest
class GetNavigationTest_UseCFE extends GetNavigationTest {
@override
bool get useCFE => true;
}
26 changes: 0 additions & 26 deletions pkg/analysis_server/test/analysis/get_signature_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import '../analysis_abstract.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(AnalysisSignatureTest);
defineReflectiveTests(AnalysisSignatureTest_UseCFE);
});
}

Expand Down Expand Up @@ -455,28 +454,3 @@ main() {
equals(RequestErrorCode.GET_SIGNATURE_UNKNOWN_FUNCTION));
}
}

@reflectiveTest
class AnalysisSignatureTest_UseCFE extends AnalysisSignatureTest {
@override
bool get useCFE => true;

@failingTest
@override
test_error_file_not_analyzed() async => super.test_error_file_not_analyzed();

@failingTest
@override
test_function_named_with_default_int() async =>
super.test_function_named_with_default_int();

@failingTest
@override
test_function_named_with_default_string() async =>
super.test_function_named_with_default_string();

@failingTest
@override
test_function_optional_with_default() async =>
super.test_function_optional_with_default();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import '../analysis_abstract.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(NewAnalysisOptionsFileNotificationTest);
defineReflectiveTests(NewAnalysisOptionsFileNotificationTest_UseCFE);
defineReflectiveTests(OldAnalysisOptionsFileNotificationTest);
defineReflectiveTests(OldAnalysisOptionsFileNotificationTest_UseCFE);
});
}

Expand Down Expand Up @@ -270,23 +268,9 @@ class NewAnalysisOptionsFileNotificationTest
String get optionsFilePath => '$projectPath/analysis_options.yaml';
}

@reflectiveTest
class NewAnalysisOptionsFileNotificationTest_UseCFE
extends NewAnalysisOptionsFileNotificationTest {
@override
bool get useCFE => true;
}

@reflectiveTest
class OldAnalysisOptionsFileNotificationTest
extends AnalysisOptionsFileNotificationTest {
@override
String get optionsFilePath => '$projectPath/.analysis_options';
}

@reflectiveTest
class OldAnalysisOptionsFileNotificationTest_UseCFE
extends OldAnalysisOptionsFileNotificationTest {
@override
bool get useCFE => true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import '../analysis_abstract.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(AnalysisNotificationAnalyzedFilesTest);
defineReflectiveTests(AnalysisNotificationAnalyzedFilesTest_UseCFE);
});
}

Expand Down Expand Up @@ -129,10 +128,3 @@ class A {}
removeGeneralAnalysisSubscription(GeneralAnalysisService.ANALYZED_FILES);
}
}

@reflectiveTest
class AnalysisNotificationAnalyzedFilesTest_UseCFE
extends AnalysisNotificationAnalyzedFilesTest {
@override
bool get useCFE => true;
}
Loading

0 comments on commit 1f52372

Please sign in to comment.