Roll Dart to 93d8c9fe2a2c22dc95ec85866af108cfab71ad06. (flutter/engine#4558)

* Roll Dart to 93d8c9fe2a2c22dc95ec85866af108cfab71ad06.

* Fix analyzer nits

* Try to pin dependency for tools/licenses to convert 2.0.1. Add verbose flag to pub get

* Pin dart to dev.16 to overcome pub issue

* Revert "Try to pin dependency for tools/licenses to convert 2.0.1. Add verbose flag to pub get"

This reverts commit d525a83f4494a511996226d328a5208d4651d46e as it is no
longer needed, was added to diagnose the problem, which turned out to be
a problem with pub in latest dart dev release.

* Fix license hash

* Reintroduce api methods and tests
This commit is contained in:
Siva Chandra
2018-01-18 12:35:09 -08:00
committed by Alexander Aprelev
parent 9cd77fd071
commit f8600043cc
5 changed files with 39 additions and 30 deletions

8
DEPS
View File

@@ -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',

View File

@@ -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

View File

@@ -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<Null> 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<int> starter(
compiler.acceptLastDelta();
await compiler.recompileDelta();
compiler.acceptLastDelta();
compiler.resetIncrementalCompiler();
await compiler.recompileDelta();
compiler.acceptLastDelta();
await compiler.recompileDelta();
@@ -311,7 +315,8 @@ Future<int> 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') {

View File

@@ -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<int> main() async {
await compileCalled.first;
inputStreamController.close();
});
test('compile one file (strong mode)', () async {
final StreamController<List<int>> inputStreamController =
new StreamController<List<int>>();
@@ -277,7 +278,7 @@ Future<int> main() async {
test('accept', () async {
final StreamController<List<int>> inputStreamController =
new StreamController<List<int>>();
new StreamController<List<int>>();
final ReceivePort acceptCalled = new ReceivePort();
when(compiler.acceptLastDelta()).thenAnswer((Invocation invocation) {
acceptCalled.sendPort.send(true);
@@ -293,17 +294,17 @@ Future<int> main() async {
test('reject', () async {
final StreamController<List<int>> inputStreamController =
new StreamController<List<int>>();
final ReceivePort rejectCalled = new ReceivePort();
when(compiler.rejectLastDelta()).thenAnswer((Invocation invocation) {
rejectCalled.sendPort.send(true);
new StreamController<List<int>>();
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<int> main() async {
final _MockedIncrementalKernelGenerator generator =
new _MockedIncrementalKernelGenerator();
when(generator.computeDelta()).thenReturn(new Future<DeltaProgram>.value(
new DeltaProgram('', null /* program stub */)
when(generator.computeDelta()).thenReturn(new Future<Program>.value(
new Program()
));
final _MockedBinaryPrinterFactory printerFactory =
new _MockedBinaryPrinterFactory();

View File

@@ -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<tonic::DartState*>(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<tonic::DartState*>(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;