diff --git a/.travis.yml b/.travis.yml index 92f36683d6542..c0c69e95be1f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: dart dart: - - dev + # Pin to dev.16 to overcome dartbug.com/31940 + - dev/release/2.0.0-dev.16.0 sudo: false before_script: - ./travis/setup.sh diff --git a/DEPS b/DEPS index df9d21935c21d..858a04feb7f7f 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '28757928b47b192efcec082c78258102beb03f78', + 'dart_revision': '93d8c9fe2a2c22dc95ec85866af108cfab71ad06', 'dart_args_tag': '0.13.7', 'dart_async_tag': '2.0.2', @@ -59,8 +59,8 @@ vars = { 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', - 'dart_json_rpc_2_tag': '2.0.4', - 'dart_linter_tag': '0.1.41', + 'dart_json_rpc_2_tag': '2.0.6', + 'dart_linter_tag': '0.1.42', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.0.0', 'dart_matcher_tag': '0.12.1+4', @@ -75,7 +75,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.6.0', - 'dart_pub_rev': '667281eef93b4be648cceca400e954e000edba38', + 'dart_pub_rev': 'ca0d52f5d4058e7b9ef7b5091e407ff3ac05198d', 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '0.27.0', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 2b3ba441268a6..81b8be9b3021c 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -130,6 +130,9 @@ class _FrontendCompiler implements CompilerInterface { StringSink _outputStream; BinaryPrinterFactory printerFactory; + CompilerOptions _compilerOptions; + Uri _entryPoint; + IncrementalKernelGenerator _generator; String _kernelBinaryFilename; @@ -156,14 +159,11 @@ class _FrontendCompiler implements CompilerInterface { Program program; if (options['incremental']) { - _generator = generator != null - ? generator - : await IncrementalKernelGenerator.newInstance( - compilerOptions, filenameUri, - useMinimalGenerator: true); - final DeltaProgram deltaProgram = + _entryPoint = filenameUri; + _compilerOptions = compilerOptions; + _generator = generator ?? _createGenerator(); + program = await _runWithPrintRedirection(() => _generator.computeDelta()); - program = deltaProgram.newProgram; } else { if (options['link-platform']) { // TODO(aam): Remove linkedDependencies once platform is directly embedded @@ -192,10 +192,10 @@ class _FrontendCompiler implements CompilerInterface { Future recompileDelta() async { final String boundaryKey = new Uuid().generateV4(); _outputStream.writeln('result $boundaryKey'); - final DeltaProgram deltaProgram = await _generator.computeDelta(); + final Program deltaProgram = await _generator.computeDelta(); final IOSink sink = new File(_kernelBinaryFilename).openWrite(); final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink); - printer.writeProgramFile(deltaProgram.newProgram); + printer.writeProgramFile(deltaProgram); await sink.close(); _outputStream.writeln('$boundaryKey $_kernelBinaryFilename'); return null; @@ -203,12 +203,12 @@ class _FrontendCompiler implements CompilerInterface { @override void acceptLastDelta() { - _generator.acceptLastDelta(); + // TODO(aam): implement this considering new incremental compiler API. } @override void rejectLastDelta() { - _generator.rejectLastDelta(); + // TODO(aam): implement this considering new incremental compiler API. } @override @@ -218,9 +218,12 @@ class _FrontendCompiler implements CompilerInterface { @override void resetIncrementalCompiler() { - _generator.reset(); + _generator = _createGenerator(); } + IncrementalKernelGenerator _createGenerator() => + new IncrementalKernelGenerator(_compilerOptions, _entryPoint); + Uri _ensureFolderPath(String path) { String uriPath = new Uri.file(path).toString(); if (!uriPath.endsWith('/')) { @@ -268,6 +271,7 @@ Future starter( compiler.acceptLastDelta(); await compiler.recompileDelta(); compiler.acceptLastDelta(); + compiler.resetIncrementalCompiler(); await compiler.recompileDelta(); compiler.acceptLastDelta(); await compiler.recompileDelta(); @@ -311,7 +315,8 @@ Future starter( } else if (string == 'accept') { compiler.acceptLastDelta(); } else if (string == 'reject') { - compiler.rejectLastDelta(); + // TODO(aam) implement reject so it won't reset compiler. + compiler.resetIncrementalCompiler(); } else if (string == 'reset') { compiler.resetIncrementalCompiler(); } else if (string == 'quit') { diff --git a/frontend_server/test/server_test.dart b/frontend_server/test/server_test.dart index 8d489928f5b75..9f77525db6dd2 100644 --- a/frontend_server/test/server_test.dart +++ b/frontend_server/test/server_test.dart @@ -12,6 +12,7 @@ import 'package:frontend_server/server.dart'; // ignore_for_file: implementation_imports import 'package:front_end/src/api_prototype/incremental_kernel_generator.dart'; import 'package:kernel/binary/ast_to_binary.dart'; +import 'package:kernel/ast.dart' show Program; import 'package:mockito/mockito.dart'; import 'package:test/test.dart'; @@ -193,7 +194,7 @@ Future main() async { await compileCalled.first; inputStreamController.close(); }); - + test('compile one file (strong mode)', () async { final StreamController> inputStreamController = new StreamController>(); @@ -277,7 +278,7 @@ Future main() async { test('accept', () async { final StreamController> inputStreamController = - new StreamController>(); + new StreamController>(); final ReceivePort acceptCalled = new ReceivePort(); when(compiler.acceptLastDelta()).thenAnswer((Invocation invocation) { acceptCalled.sendPort.send(true); @@ -293,17 +294,17 @@ Future main() async { test('reject', () async { final StreamController> inputStreamController = - new StreamController>(); - final ReceivePort rejectCalled = new ReceivePort(); - when(compiler.rejectLastDelta()).thenAnswer((Invocation invocation) { - rejectCalled.sendPort.send(true); + new StreamController>(); + final ReceivePort resetCalled = new ReceivePort(); + when(compiler.resetIncrementalCompiler()).thenAnswer((Invocation invocation) { + resetCalled.sendPort.send(true); }); final int exitcode = await starter(args, compiler: compiler, input: inputStreamController.stream, ); expect(exitcode, equals(0)); inputStreamController.add('reject\n'.codeUnits); - await rejectCalled.first; + await resetCalled.first; inputStreamController.close(); }); @@ -386,8 +387,8 @@ Future main() async { final _MockedIncrementalKernelGenerator generator = new _MockedIncrementalKernelGenerator(); - when(generator.computeDelta()).thenReturn(new Future.value( - new DeltaProgram('', null /* program stub */) + when(generator.computeDelta()).thenReturn(new Future.value( + new Program() )); final _MockedBinaryPrinterFactory printerFactory = new _MockedBinaryPrinterFactory(); diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc index 35d3c75dc7fb2..2b5a80b370d58 100644 --- a/runtime/dart_init.cc +++ b/runtime/dart_init.cc @@ -237,6 +237,7 @@ static void ReleaseFetchedBytes(uint8_t* buffer) { } Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, + Dart_IsolateFlags* flags, char** error) { #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE // No VM-service in release mode. @@ -246,14 +247,15 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, bool is_running_from_kernel = GetKernelPlatformBinary() != nullptr; + flags->load_vmservice_library = true; Dart_Isolate isolate = is_running_from_kernel ? Dart_CreateIsolateFromKernel( - script_uri, "main", kernel_platform, nullptr /* flags */, + script_uri, "main", kernel_platform, flags, static_cast(dart_state), error) : Dart_CreateIsolate( script_uri, "main", g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, nullptr, + g_default_isolate_snapshot_instructions, flags, static_cast(dart_state), error); FXL_CHECK(isolate) << error; @@ -314,7 +316,7 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, TRACE_EVENT0("flutter", __func__); if (IsServiceIsolateURL(script_uri)) { - return ServiceIsolateCreateCallback(script_uri, error); + return ServiceIsolateCreateCallback(script_uri, flags, error); } std::string entry_uri = script_uri; diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5315d0a7be974..2320a0dab2b8c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5eac0d88d1c8ffe7fc4768fb2eefb1eb +Signature: a19a996e741c694d2226e3845d598e64 UNUSED LICENSES: