diff --git a/pkg/front_end/tool/fasta b/pkg/front_end/tool/fasta index 3eca6a0dcb4..9d655decdf5 100755 --- a/pkg/front_end/tool/fasta +++ b/pkg/front_end/tool/fasta @@ -56,7 +56,7 @@ case "${1//_/-}" in | head -1) exec "${DART_VM}" -DDFE_VERBOSE=true \ --kernel-binaries=${PATCHED_SDK_DIR} \ - --dfe="${REPO_DIR}/utils/kernel-service/kernel-service.dart" "$@" + --dfe="${REPO_DIR}/pkg/vm/bin/kernel_service.dart" "$@" ;; testing) SCRIPT="${REPO_DIR}/pkg/testing/bin/testing.dart" diff --git a/pkg/vm/LICENSE b/pkg/vm/LICENSE new file mode 100644 index 00000000000..389ce985634 --- /dev/null +++ b/pkg/vm/LICENSE @@ -0,0 +1,26 @@ +Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pkg/vm/analysis_options.yaml b/pkg/vm/analysis_options.yaml new file mode 100644 index 00000000000..27c9e253bdb --- /dev/null +++ b/pkg/vm/analysis_options.yaml @@ -0,0 +1,11 @@ +# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +analyzer: + strong-mode: true + language: + enableSuperMixins: false + exclude: + - testcases/** + - tool/** diff --git a/utils/kernel-service/kernel-service.dart b/pkg/vm/bin/kernel_service.dart similarity index 98% rename from utils/kernel-service/kernel-service.dart rename to pkg/vm/bin/kernel_service.dart index 89f6c3eaddd..b829d2eb256 100644 --- a/utils/kernel-service/kernel-service.dart +++ b/pkg/vm/bin/kernel_service.dart @@ -10,12 +10,12 @@ /// This is either invoked as the root script of the Kernel isolate when used /// as a part of /// -/// dart --dfe=utils/kernel-service/kernel-service.dart ... +/// dart --dfe=pkg/vm/bin/kernel_service.dart ... /// /// invocation or it is invoked as a standalone script to perform training for /// the app-jit snapshot /// -/// dart utils/kernel-service/kernel-service.dart --train +/// dart pkg/vm/bin/kernel_service.dart --train /// /// library runtime.tools.kernel_service; diff --git a/pkg/vm/pubspec.yaml b/pkg/vm/pubspec.yaml new file mode 100644 index 00000000000..28dfc2004ca --- /dev/null +++ b/pkg/vm/pubspec.yaml @@ -0,0 +1,10 @@ +name: vm +version: 0.1.0-alpha.1 +author: Dart Team +description: VM specific Dart code and helper scripts +homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm +environment: + sdk: ">=1.8.0 <2.0.0" +dependencies: + front_end: 0.1.0-alpha.6 + kernel: 0.3.0-alpha.3 diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc index dfc00c623ba..04c5431300b 100644 --- a/runtime/bin/main.cc +++ b/runtime/bin/main.cc @@ -334,8 +334,8 @@ static Dart_Isolate CreateAndSetupKernelIsolate(const char* main, IsolateData* isolate_data = new IsolateData(script_uri, package_root, packages_config, app_snapshot); Dart_Isolate isolate = Dart_CreateIsolate( - script_uri, main, isolate_snapshot_data, isolate_snapshot_instructions, - flags, isolate_data, error); + DART_KERNEL_ISOLATE_NAME, main, isolate_snapshot_data, + isolate_snapshot_instructions, flags, isolate_data, error); if (isolate == NULL) { delete isolate_data; return NULL; diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc index 145ea91a9bd..4588c590a18 100644 --- a/runtime/bin/run_vm_tests.cc +++ b/runtime/bin/run_vm_tests.cc @@ -154,8 +154,8 @@ static Dart_Isolate CreateIsolateAndSetup(const char* script_uri, bin::IsolateData* isolate_data = new bin::IsolateData( script_uri, package_root, packages_config, NULL /* app_snapshot */); Dart_Isolate isolate = Dart_CreateIsolate( - script_uri, main, isolate_snapshot_data, isolate_snapshot_instructions, - flags, isolate_data, error); + DART_KERNEL_ISOLATE_NAME, main, isolate_snapshot_data, + isolate_snapshot_instructions, flags, isolate_data, error); if (isolate == NULL) { *error = strdup("Failed to create isolate"); delete isolate_data; diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 5be64633f25..740124a3c82 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -1090,7 +1090,8 @@ static char* BuildIsolateName(const char* script_uri, const char* main) { } } - if (ServiceIsolate::NameEquals(script_uri)) { + if (ServiceIsolate::NameEquals(script_uri) || + (strcmp(script_uri, DART_KERNEL_ISOLATE_NAME) == 0)) { return strdup(script_uri); } diff --git a/runtime/vm/kernel_isolate.cc b/runtime/vm/kernel_isolate.cc index f33c9bc53a3..dbe30d15ab3 100644 --- a/runtime/vm/kernel_isolate.cc +++ b/runtime/vm/kernel_isolate.cc @@ -200,7 +200,7 @@ void KernelIsolate::InitCallback(Isolate* I) { ASSERT(I == T->isolate()); ASSERT(I != NULL); ASSERT(I->name() != NULL); - if (strstr(I->name(), DART_KERNEL_ISOLATE_NAME) == NULL) { + if (strcmp(I->name(), DART_KERNEL_ISOLATE_NAME) != 0) { // Not kernel isolate. return; } diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart index 9f12396a210..8de7e37cbc4 100644 --- a/tools/testing/dart/compiler_configuration.dart +++ b/tools/testing/dart/compiler_configuration.dart @@ -639,7 +639,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration { var args = []; if (useDfe) { if (!_isStrong) { - args.add('--dfe=utils/kernel-service/kernel-service.dart'); + args.add('--dfe=pkg/vm/bin/kernel_service.dart'); } // TODO(dartbug.com/30480): avoid using additional kernel binaries args.add('--kernel-binaries=' + diff --git a/utils/kernel-service/BUILD.gn b/utils/kernel-service/BUILD.gn index 02e55ca29b2..dbd42c66d31 100644 --- a/utils/kernel-service/BUILD.gn +++ b/utils/kernel-service/BUILD.gn @@ -6,11 +6,10 @@ import("../../build/dart_host_sdk_toolchain.gni") import("../application_snapshot.gni") application_snapshot("kernel-service") { - dfe_script = "kernel-service.dart" + main_dart = "../../pkg/vm/bin/kernel_service.dart" deps = [ "../../runtime/vm:kernel_platform_files($dart_host_toolchain)", ] - main_dart = dfe_script training_args = [ "--train", "file://" + rebase_path("../../pkg/compiler/lib/src/dart2js.dart"),