From 754e5f404c7a78510e2b8c52a265f4dc786cf786 Mon Sep 17 00:00:00 2001 From: Samir Jindel Date: Mon, 11 Feb 2019 18:16:21 +0000 Subject: [PATCH] Revert "[vm/extensions] Fix Loader::ReloadNativeExtensions(...)." This reverts commit 4118d3c793734e3f5ca500b7aeedf9e4c70d4f62. Crashes on hot reload/rollback bots. Original change's description: > [vm/extensions] Fix Loader::ReloadNativeExtensions(...). > > This method was not doing anything since the switch to Dart 2 > because extensions no longer were added as imports to the libraries > which loaded them. > > This is a commandeer of https://dart-review.googlesource.com/c/sdk/+/90240 with a bug fix. > > Change-Id: Idfe2ec16ae714b5a31ed53332da6704248949915 > Reviewed-on: https://dart-review.googlesource.com/c/92180 > Commit-Queue: Samir Jindel > Reviewed-by: Ryan Macnak TBR=rmacnak@google.com,sjindel@google.com Change-Id: If8c8d6cf8ee2cb0a354601f94c609d3d7b5ddf03 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/92640 Reviewed-by: Samir Jindel --- runtime/vm/kernel_loader.cc | 9 --------- .../sample_extension/sample_asynchronous_extension.dart | 2 +- samples/samples.status | 9 ++++++--- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc index 2e024aa1a27..690c63203d0 100644 --- a/runtime/vm/kernel_loader.cc +++ b/runtime/vm/kernel_loader.cc @@ -614,15 +614,6 @@ void KernelLoader::LoadNativeExtensionLibraries( if (result.IsError()) { H.ReportError(Error::Cast(result), "library handler failed"); } - - // Create a dummy library and add it as an import to the current library. - // This allows later to discover and reload this native extension, e.g. - // when running from an app-jit snapshot. - // See Loader::ReloadNativeExtensions(...) which relies on - // Dart_GetImportsOfScheme('dart-ext'). - const auto& native_library = Library::Handle(Library::New(uri_path)); - library.AddImport(Namespace::Handle(Namespace::New( - native_library, Array::null_array(), Array::null_array()))); } } potential_extension_libraries_ = GrowableObjectArray::null(); diff --git a/samples/sample_extension/sample_asynchronous_extension.dart b/samples/sample_extension/sample_asynchronous_extension.dart index 6b813696d6d..69af1e555e2 100644 --- a/samples/sample_extension/sample_asynchronous_extension.dart +++ b/samples/sample_extension/sample_asynchronous_extension.dart @@ -13,7 +13,7 @@ class RandomArray { static SendPort _port; Future> randomArray(int seed, int length) { - var completer = new Completer>(); + var completer = new Completer(); var replyPort = new RawReceivePort(); var args = new List(3); args[0] = seed; diff --git a/samples/samples.status b/samples/samples.status index 9ec1b23e404..3af1d7e4bdc 100644 --- a/samples/samples.status +++ b/samples/samples.status @@ -8,6 +8,9 @@ sample_extension/test/*: Skip # Issue 14705 [ $builder_tag == optimization_counter_threshold ] sample_extension/test/sample_extension_app_snapshot_test: SkipByDesign # This test is too slow for testing with low optimization counter threshold. +[ $compiler == app_jit ] +sample_extension/test/sample_extension_app_snapshot_test: RuntimeError + [ $compiler == precompiler ] sample_extension/test/*: Skip # These tests attempt to spawn another script using the precompiled runtime. @@ -23,9 +26,9 @@ sample_extension/test/sample_extension_app_snapshot_test: Pass, RuntimeError # I [ !$preview_dart_2 && ($runtime == dart_precompiled || $runtime == vm) ] *: SkipByDesign # Deprecating all Dart1 modes of execution -[ $compiler == app_jitk || $compiler == dartkb || $compiler == dartkp ] -sample_extension/test/sample_extension_app_snapshot_test: SkipByDesign -sample_extension/test/sample_extension_test: SkipByDesign +[ $compiler == app_jitk || $compiler == dartk || $compiler == dartkb || $compiler == dartkp ] +sample_extension/test/sample_extension_app_snapshot_test: RuntimeError +sample_extension/test/sample_extension_test: RuntimeError # Skip tests that use dart:io [ $runtime == d8 || $browser ]