Skip to content

Commit 94bc2b6

Browse files
author
Dart CI
committed
Version 2.11.0-245.0.dev
Merge commit '37abbb2e3d146f83f4baf47dc5d83f1b6179e767' into 'dev'
2 parents 9f907e1 + 37abbb2 commit 94bc2b6

File tree

20 files changed

+273
-79
lines changed

20 files changed

+273
-79
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,11 @@ tools/xcodebuild
103103
/generated/
104104
/crash_logs/
105105
/build/config/gclient_args.gni
106+
/pkg/front_end/testcases/old_dills/
107+
/logs.json
108+
/results.json
109+
/async_lazy_debug.so
110+
/dwarf.so
111+
/dwarf_obfuscate.so
112+
/il_tmp.txt
113+

build/mac/find_sdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def main():
107107
else:
108108
sdk_dir = os.path.join(out.rstrip(), 'SDKs')
109109
sdks = [
110-
re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)
110+
re.findall('^MacOSX(1[01]\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)
111111
]
112112
sdks = [s[0] for s in sdks if s] # [['10.5'], ['10.6']] => ['10.5', '10.6']
113113
sdks = [

pkg/nnbd_migration/lib/src/front_end/migration_info.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ class MigrationInfo {
7777

7878
MigrationInfo(this.units, this.unitMap, this.pathContext, this.includedRoot);
7979

80+
/// The path of the Dart logo displayed in the toolbar.
81+
String get dartLogoPath => PreviewSite.dartLogoPath;
82+
8083
/// The path to the highlight.pack.js script, relative to [unitInfo].
8184
String get highlightJsPath => PreviewSite.highlightJsPath;
8285

8386
/// The path to the highlight.pack.js stylesheet, relative to [unitInfo].
8487
String get highlightStylePath => PreviewSite.highlightCssPath;
8588

86-
/// The path of the Dart logo displayed in the toolbar.
87-
String get dartLogoPath => PreviewSite.dartLogoPath;
88-
8989
/// The path of the Material icons font.
9090
String get materialIconsPath => PreviewSite.materialIconsPath;
9191

runtime/vm/bootstrap.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void Finish(Thread* thread) {
5151
ObjectStore* object_store = thread->isolate()->object_store();
5252
Zone* zone = thread->zone();
5353
Class& cls = Class::Handle(zone, object_store->closure_class());
54-
ClassFinalizer::LoadClassMembers(cls);
54+
cls.EnsureIsFinalized(thread);
5555

5656
// Make sure _Closure fields are not marked as unboxing candidates
5757
// as they are accessed with plain loads.
@@ -88,7 +88,7 @@ static void Finish(Thread* thread) {
8888

8989
// Eagerly compile Bool class, bool constants are used from within compiler.
9090
cls = object_store->bool_class();
91-
ClassFinalizer::LoadClassMembers(cls);
91+
cls.EnsureIsFinalized(thread);
9292
}
9393

9494
static ErrorPtr BootstrapFromKernel(Thread* thread,

runtime/vm/class_finalizer_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
namespace dart {
1111

1212
static ClassPtr CreateTestClass(const char* name) {
13-
const String& class_name =
14-
String::Handle(Symbols::New(Thread::Current(), name));
13+
Thread* thread = Thread::Current();
14+
const String& class_name = String::Handle(Symbols::New(thread, name));
1515
const Script& script = Script::Handle();
1616
const Class& cls = Class::Handle(Class::New(
1717
Library::Handle(), class_name, script, TokenPosition::kNoSource));
1818
cls.set_interfaces(Object::empty_array());
1919
cls.set_is_declaration_loaded();
20+
SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
2021
cls.SetFunctions(Object::empty_array());
2122
cls.SetFields(Object::empty_array());
2223
return cls.raw();

runtime/vm/compiler/aot/precompiler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,7 @@ void Precompiler::DropFunctions() {
17241724
}
17251725
};
17261726

1727+
SafepointWriteRwLocker ml(T, T->isolate_group()->program_lock());
17271728
auto& dispatchers_array = Array::Handle(Z);
17281729
auto& name = String::Handle(Z);
17291730
auto& desc = Array::Handle(Z);

runtime/vm/compiler/frontend/bytecode_reader.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,11 @@ void BytecodeReaderHelper::ReadFunctionDeclarations(const Class& cls) {
24722472
functions_->SetAt(function_index_++, function);
24732473
}
24742474

2475-
cls.SetFunctions(*functions_);
2475+
{
2476+
Thread* thread = Thread::Current();
2477+
SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
2478+
cls.SetFunctions(*functions_);
2479+
}
24762480

24772481
if (cls.IsTopLevel()) {
24782482
const Library& library = Library::Handle(Z, cls.library());

runtime/vm/debugger.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,8 @@ void Debugger::DeoptimizeWorld() {
19191919
// Iterate over all classes, deoptimize functions.
19201920
// TODO(hausner): Could possibly be combined with RemoveOptimizedCode()
19211921
const ClassTable& class_table = *isolate_->class_table();
1922-
Zone* zone = Thread::Current()->zone();
1922+
Thread* thread = Thread::Current();
1923+
Zone* zone = thread->zone();
19231924
CallSiteResetter resetter(zone);
19241925
Class& cls = Class::Handle(zone);
19251926
Array& functions = Array::Handle(zone);
@@ -1929,6 +1930,9 @@ void Debugger::DeoptimizeWorld() {
19291930

19301931
const intptr_t num_classes = class_table.NumCids();
19311932
const intptr_t num_tlc_classes = class_table.NumTopLevelCids();
1933+
// TODO(dartbug.com/36097): Need to stop other mutators running in same IG
1934+
// before deoptimizing the world.
1935+
SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
19321936
for (intptr_t i = 1; i < num_classes + num_tlc_classes; i++) {
19331937
const classid_t cid =
19341938
i < num_classes ? i : ClassTable::CidFromTopLevelIndex(i - num_classes);

runtime/vm/isolate.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ IsolateGroup::IsolateGroup(std::shared_ptr<IsolateGroupSource> source,
374374
NOT_IN_PRODUCT("IsolateGroup::type_canonicalization_mutex_")),
375375
type_arguments_canonicalization_mutex_(NOT_IN_PRODUCT(
376376
"IsolateGroup::type_arguments_canonicalization_mutex_")),
377+
program_lock_(new SafepointRwLock()),
377378
active_mutators_monitor_(new Monitor()),
378379
max_active_mutators_(Scavenger::MaxMutatorThreadCount()) {
379380
const bool is_vm_isolate = Dart::VmIsolateNameEquals(source_->name);

runtime/vm/isolate.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ class IsolateGroup : public IntrusiveDListEntry<IsolateGroup> {
435435
Mutex* initializer_functions_mutex() { return &initializer_functions_mutex_; }
436436
#endif // !defined(DART_PRECOMPILED_RUNTIME)
437437

438+
SafepointRwLock* program_lock() { return program_lock_.get(); }
439+
438440
static inline IsolateGroup* Current() {
439441
Thread* thread = Thread::Current();
440442
return thread == nullptr ? nullptr : thread->isolate_group();
@@ -725,6 +727,11 @@ class IsolateGroup : public IntrusiveDListEntry<IsolateGroup> {
725727
Mutex initializer_functions_mutex_;
726728
#endif // !defined(DART_PRECOMPILED_RUNTIME)
727729

730+
// Ensures synchronized access to classes functions, fields and other
731+
// program structure elements to accommodate concurrent modification done
732+
// by multiple isolates and background compiler.
733+
std::unique_ptr<SafepointRwLock> program_lock_;
734+
728735
// Allow us to ensure the number of active mutators is limited by a maximum.
729736
std::unique_ptr<Monitor> active_mutators_monitor_;
730737
intptr_t active_mutators_ = 0;

0 commit comments

Comments
 (0)