Skip to content

Commit

Permalink
[vm/concurrency] As preparation step to sharing JITed code, disable v…
Browse files Browse the repository at this point in the history
…arious optimizations

This is a preparation CL to enable actually sharing JIT'ed code between
isolates within the same isolate group.

We start with conservative settings, disabling various compiler
optimisations. We will lift those restrictions step-by-step.

Since this is guarded by FLAG_enable_isolate_groups it will not affect
any production code. Only individual tests which opt-in via the flag.

TEST=Existing tests opt'ing into --enable-isolate-groups.

Issue dart-lang/sdk#36097

Change-Id: I05c4151116a8516f92c76b4d57f2c7fb725168ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173970
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
  • Loading branch information
mkustermann committed Nov 26, 2020
1 parent 9fff72e commit 7837c38
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
4 changes: 4 additions & 0 deletions runtime/tests/vm/vm.status
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ dart_2/redirection_type_shuffling_test: SkipByDesign # Imports dart:mirrors
[ $nnbd == legacy ]
dart/*: SkipByDesign # Migrated tests are not supposed to run on non-NNBD bots.

[ $runtime == vm ]
dart/isolates/*: Pass, Slow # https://dartbug.com/36097: Slower while isolate groups are being gradually enabled in JIT mode.
dart_2/isolates/*: Pass, Slow # https://dartbug.com/36097: Slower while isolate groups are being gradually enabled in JIT mode.

[ $system == android ]
dart/isolates/dart_api_create_lightweight_isolate_test: SkipByDesign # On android this test does not work due to not being able to identify library uri.
dart/sdk_hash_test: SkipByDesign # The test doesn't know location of cross-platform gen_snapshot
Expand Down
2 changes: 1 addition & 1 deletion runtime/vm/flag_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ constexpr bool kDartUseBackgroundCompilation = true;
P(enable_ffi, bool, true, "Disable to make importing dart:ffi an error.") \
P(fields_may_be_reset, bool, false, \
"Don't optimize away static field initialization") \
C(force_clone_compiler_objects, false, false, bool, false, \
P(force_clone_compiler_objects, bool, false, \
"Force cloning of objects needed in compiler (ICData and Field).") \
P(getter_setter_ratio, int, 13, \
"Ratio of getter/setter usage used for double field unboxing heuristics") \
Expand Down
24 changes: 24 additions & 0 deletions runtime/vm/flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,30 @@ char* Flags::ProcessCommandLineFlags(int number_of_vm_flags,
PrintFlags();
}

// TODO(dartbug.com/36097): Support for isolate groups in JIT mode is
// in-development. We will start with very conservative settings. As we make
// more of our compiler, runtime as well as generated code re-entrant we'll
// graudally remove those restrictions.

#if !defined(DART_PRCOMPILED_RUNTIME)
if (!FLAG_precompiled_mode && FLAG_enable_isolate_groups) {
// Our compiler should not make rely on a global field being initialized at
// compile-time, since that compiled code might be re-used in another
// isolate that has not yet initialized the global field.
FLAG_fields_may_be_reset = true;

// We will start by only allowing compilation to unoptimized code.
FLAG_optimization_counter_threshold = -1;
FLAG_background_compilation = false;
FLAG_force_clone_compiler_objects = true;

// To eliminate potential flakiness, we will start by disabling field guards
// and CHA-based compilations.
FLAG_use_field_guards = false;
FLAG_use_cha_deopt = false;
}
#endif // !defined(DART_PRCOMPILED_RUNTIME)

initialized_ = true;
return NULL;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/lib/lib_vm.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# 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.

[ $runtime == vm ]
isolate/*: Pass, Slow # https://dartbug.com/36097: Slower while isolate groups are being gradually enabled in JIT mode.

[ $runtime != vm ]
isolate/native_wrapper_message_test: Skip # A VM specific test.

Expand Down
3 changes: 3 additions & 0 deletions tests/lib_2/lib_2_vm.status
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# 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.

[ $runtime == vm ]
isolate/*: Pass, Slow # https://dartbug.com/36097: Slower while isolate groups are being gradually enabled in JIT mode.

[ $runtime != vm ]
isolate/native_wrapper_message_test: Skip # A VM specific test.

Expand Down

0 comments on commit 7837c38

Please sign in to comment.