Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
79f1fd8
Roll Dart SDK from e256855d07ba to a3b62f366529 (4 revisions) (#21809)
skia-flutter-autoroll Oct 13, 2020
bea1428
Roll Dart SDK from e655b9a3839e to b58cfe5ab24e (1 revision) (#21920)
skia-flutter-autoroll Oct 16, 2020
dd0531c
Roll Dart SDK from fc82eeed7df3 to 8be6a08153cc (1 revision) (#22005)
skia-flutter-autoroll Oct 20, 2020
b28d574
Roll Dart SDK from fe12b0536f42 to a188781c9fc8 (1 revision) (#22379)
skia-flutter-autoroll Nov 7, 2020
77005ae
Roll Skia from 95b5fb9213d7 to 68ac3b9ec3ca (17 revisions) (#22713)
skia-flutter-autoroll Nov 24, 2020
4220747
Roll Dart SDK from 2c74e62a050c to f9760fc12871 (5 revisions) (#22881)
skia-flutter-autoroll Dec 4, 2020
ffbf6ef
Roll Dart SDK from 68d1c7504f7d to f166571c7bc4 (1 revision) (#23056)
skia-flutter-autoroll Dec 14, 2020
4a5b65d
Roll Dart SDK from 970d74c42472 to fd72dbb5b82b (1 revision) (#23820)
skia-flutter-autoroll Jan 21, 2021
d975546
Trigger an engine build to re-open the tree (#26056)
cbracken May 10, 2021
5a934b8
Roll Skia from d9a7c5953df3 to 827bb729a84d (2 revisions) (#26096)
skia-flutter-autoroll May 12, 2021
684b687
Roll Dart SDK from d616108772bd to a527411e5100 (0 revision) (#26156)
skia-flutter-autoroll May 14, 2021
f3036cc
Roll Dart SDK from bb9d96ffbafa to 7250fd6379b2 (0 revision) (#26374)
skia-flutter-autoroll May 24, 2021
50c1142
Roll Dart SDK from 202c42e3395c to 2e9c4305a6aa (1 revision) (#26578)
skia-flutter-autoroll Jun 4, 2021
0154641
Roll buildroot to 275038b8be7196927b0f71770701f3c2c3744860 (#26945)
cbracken Jun 24, 2021
01333eb
[test] empty commit (#27599)
Jul 21, 2021
210a3dd
Roll Dart SDK from e1414001c93b to 686070850ee3 (1 revision) (#27620)
skia-flutter-autoroll Jul 21, 2021
5fc99a2
Empty commit to apply latest LUCI config (#27767)
Jul 28, 2021
5901e0e
Roll Dart SDK from 3b11f88c96a5 to 976f160b547f (3 revisions) (#29436)
skia-flutter-autoroll Nov 1, 2021
5c0e8bb
Empty commit to fix main tree status (#29760)
Nov 15, 2021
b7f210a
Add option to enable serial GC
a-siva Jan 21, 2022
87e0aad
Fix format.
a-siva Jan 21, 2022
0d79c2d
Added test.
a-siva Jan 21, 2022
352cbc6
Add build rule.
a-siva Jan 21, 2022
1e4b15c
Address review comments.
a-siva Jan 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ std::string Settings::ToString() const {
stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl;
stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl;
stream << "disable_dart_asserts: " << disable_dart_asserts << std::endl;
stream << "enable_serial_gc: " << enable_serial_gc << std::endl;
stream << "enable_observatory: " << enable_observatory << std::endl;
stream << "enable_observatory_publication: " << enable_observatory_publication
<< std::endl;
Expand Down
1 change: 1 addition & 0 deletions common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ struct Settings {
bool endless_trace_buffer = false;
bool enable_dart_profiling = false;
bool disable_dart_asserts = false;
bool enable_serial_gc = false;

// Whether embedder only allows secure connections.
bool may_insecurely_connect_to_all_domains = true;
Expand Down
17 changes: 17 additions & 0 deletions runtime/dart_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ static const char* kDartLanguageArgs[] = {

static const char* kDartPrecompilationArgs[] = {"--precompilation"};

static const char* kSerialGCArgs[] = {
// clang-format off
"--concurrent_mark=false",
"--concurrent_sweep=false",
"--compactor_tasks=1",
"--scavenger_tasks=0",
"--marker_tasks=0",
// clang-format on
};

FML_ALLOW_UNUSED_TYPE
static const char* kDartWriteProtectCodeArgs[] = {
"--no_write_protect_code",
Expand Down Expand Up @@ -358,6 +368,13 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
PushBackAll(&args, kDartAssertArgs, fml::size(kDartAssertArgs));
}

// On low power devices with lesser number of cores, using concurrent
// marking or sweeping causes contention for the UI thread leading to
// Jank, this option can be used to turn off all concurrent GC activities.
if (settings_.enable_serial_gc) {
PushBackAll(&args, kSerialGCArgs, fml::size(kSerialGCArgs));
}

if (settings_.start_paused) {
PushBackAll(&args, kDartStartPausedArgs, fml::size(kDartStartPausedArgs));
}
Expand Down
3 changes: 3 additions & 0 deletions shell/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
settings.trace_startup =
command_line.HasOption(FlagForSwitch(Switch::TraceStartup));

settings.enable_serial_gc =
command_line.HasOption(FlagForSwitch(Switch::EnableSerialGC));

#if !FLUTTER_RELEASE
settings.trace_skia = true;

Expand Down
6 changes: 6 additions & 0 deletions shell/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ DEF_SWITCH(DisableDartAsserts,
"disabled. This flag may be specified if the user wishes to run "
"with assertions disabled in the debug product mode (i.e. with JIT "
"or DBC).")
DEF_SWITCH(EnableSerialGC,
"enable-serial-gc",
"On low power devices with low core counts, running concurrent "
"GC tasks on threads can cause them to contend with the UI thread "
"which could potentially lead to jank. This option turns off all "
"concurrent GC activities")
DEF_SWITCH(DisallowInsecureConnections,
"disallow-insecure-connections",
"By default, dart:io allows all socket connections. If this switch "
Expand Down
1 change: 1 addition & 0 deletions testing/dart/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ tests = [
"platform_view_test.dart",
"plugin_utilities_test.dart",
"semantics_test.dart",
"serial_gc_test.dart",
"spirv_exception_test.dart",
"task_order_test.dart",
"text_test.dart",
Expand Down
17 changes: 17 additions & 0 deletions testing/dart/serial_gc_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// FlutterTesterOptions=--enable-serial-gc

import 'package:litetest/litetest.dart';

void main() {
test('Serial GC option test ', () async {
bool threw = false;
for (int i = 0; i < 100; i++) {
var a = <int>[100];
}
expect(threw, false);
});
}