Skip to content

Commit 1ea90aa

Browse files
author
Dart CI
committed
Version 2.12.0-111.0.dev
Merge commit 'a9d212b94aa73472824f4218a567a8e004575112' into 'dev'
2 parents d517e7b + a9d212b commit 1ea90aa

File tree

18 files changed

+374
-152
lines changed

18 files changed

+374
-152
lines changed

.dart_tool/package_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2020-11-30T16:23:50.740805",
14+
"generated": "2020-11-15T14:18:10.587065",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
@@ -101,7 +101,7 @@
101101
"name": "args",
102102
"rootUri": "../third_party/pkg/args",
103103
"packageUri": "lib/",
104-
"languageVersion": "2.12"
104+
"languageVersion": "2.3"
105105
},
106106
{
107107
"name": "async",

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ vars = {
6868
"gperftools_revision": "180bfa10d7cb38e8b3784d60943d50e8fcef0dcb",
6969

7070
# Revisions of /third_party/* dependencies.
71-
"args_rev": "139140125126661fac88c9aa5882165936d01c91",
71+
"args_tag": "1.6.0",
7272
"async_rev": "695b3ac280f107c84adf7488743abfdfaaeea68f",
7373
"bazel_worker_rev": "060c55a933d39798681a4f533b161b81dc48d77e",
7474
"benchmark_harness_rev": "ec6b646f5443faa871e126ac1ba248c94ca06257",
@@ -301,7 +301,7 @@ deps = {
301301
"@" + Var("gperftools_revision"),
302302

303303
Var("dart_root") + "/third_party/pkg/args":
304-
Var("dart_git") + "args.git" + "@" + Var("args_rev"),
304+
Var("dart_git") + "args.git" + "@" + Var("args_tag"),
305305
Var("dart_root") + "/third_party/pkg/async":
306306
Var("dart_git") + "async.git" + "@" + Var("async_rev"),
307307
Var("dart_root") + "/third_party/pkg/bazel_worker":

pkg/native_stack_traces/bin/decode.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ Future<void> main(List<String> arguments) async {
300300
if (options['help']) return print(_usages[options.command?.name]);
301301
if (options.command == null) return errorWithUsage('no command provided');
302302

303-
switch (options.command!.name) {
303+
switch (options.command.name) {
304304
case 'help':
305-
return help(options.command!);
305+
return help(options.command);
306306
case 'find':
307-
return find(options.command!);
307+
return find(options.command);
308308
case 'translate':
309-
return await translate(options.command!);
309+
return await translate(options.command);
310310
}
311311
}

runtime/lib/mirrors.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,11 @@ static InstancePtr CreateLibraryDependencyMirror(Thread* thread,
435435
const LibraryPrefix& prefix,
436436
const bool is_import,
437437
const bool is_deferred) {
438-
const Library& importee = Library::Handle(ns.target());
438+
const Library& importee = Library::Handle(ns.library());
439439
const Array& show_names = Array::Handle(ns.show_names());
440440
const Array& hide_names = Array::Handle(ns.hide_names());
441441

442-
const Library& owner = Library::Handle(ns.owner());
443-
Object& metadata = Object::Handle(owner.GetMetadata(ns));
442+
Object& metadata = Object::Handle(ns.GetMetadata());
444443
if (metadata.IsError()) {
445444
Exceptions::PropagateError(Error::Cast(metadata));
446445
UNREACHABLE();

runtime/vm/canonical_tables.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -254,38 +254,6 @@ class CanonicalTypeArgumentsTraits {
254254
typedef UnorderedHashSet<CanonicalTypeArgumentsTraits>
255255
CanonicalTypeArgumentsSet;
256256

257-
class MetadataMapTraits {
258-
public:
259-
static const char* Name() { return "MetadataMapTraits"; }
260-
static bool ReportStats() { return false; }
261-
static bool IsMatch(const Object& key, const Object& candidate) {
262-
return key.raw() == candidate.raw();
263-
}
264-
static uword Hash(const Object& key) {
265-
#if !defined(DART_PRECOMPILED_RUNTIME)
266-
if (key.IsLibrary()) {
267-
return String::Hash(Library::Cast(key).url());
268-
} else if (key.IsClass()) {
269-
return String::Hash(Class::Cast(key).Name());
270-
} else if (key.IsPatchClass()) {
271-
return Hash(Object::Handle(PatchClass::Cast(key).patched_class()));
272-
} else if (key.IsFunction()) {
273-
return CombineHashes(String::Hash(Function::Cast(key).name()),
274-
Hash(Object::Handle(Function::Cast(key).Owner())));
275-
} else if (key.IsField()) {
276-
return CombineHashes(String::Hash(Field::Cast(key).name()),
277-
Hash(Object::Handle(Field::Cast(key).Owner())));
278-
} else if (key.IsTypeParameter()) {
279-
return TypeParameter::Cast(key).Hash();
280-
} else if (key.IsNamespace()) {
281-
return Hash(Library::Handle(Namespace::Cast(key).target()));
282-
}
283-
#endif
284-
UNREACHABLE();
285-
}
286-
};
287-
typedef UnorderedHashMap<MetadataMapTraits> MetadataMap;
288-
289257
} // namespace dart
290258

291259
#endif // RUNTIME_VM_CANONICAL_TABLES_H_

runtime/vm/clustered_snapshot.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5836,12 +5836,7 @@ ZoneGrowableArray<Object*>* Serializer::Serialize(SerializationRoots* roots) {
58365836
WriteUnsigned(num_objects);
58375837
WriteUnsigned(canonical_clusters.length());
58385838
WriteUnsigned(clusters.length());
5839-
// TODO(dartbug.com/36097): Not every snapshot carries the field table.
5840-
if (current_loading_unit_id_ <= LoadingUnit::kRootId) {
5841-
WriteUnsigned(initial_field_table_->NumFieldIds());
5842-
} else {
5843-
WriteUnsigned(0);
5844-
}
5839+
WriteUnsigned(initial_field_table_->NumFieldIds());
58455840

58465841
for (SerializationCluster* cluster : canonical_clusters) {
58475842
cluster->WriteAndMeasureAlloc(this);
@@ -6577,8 +6572,8 @@ void Deserializer::Deserialize(DeserializationRoots* roots) {
65776572
refs_ = Array::New(num_objects_ + kFirstReference, Heap::kOld);
65786573
if (initial_field_table_len > 0) {
65796574
initial_field_table_->AllocateIndex(initial_field_table_len - 1);
6580-
ASSERT_EQUAL(initial_field_table_->NumFieldIds(), initial_field_table_len);
65816575
}
6576+
ASSERT_EQUAL(initial_field_table_->NumFieldIds(), initial_field_table_len);
65826577

65836578
{
65846579
NoSafepointScope no_safepoint;

runtime/vm/compiler/aot/precompiler.cc

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,9 +2117,47 @@ void Precompiler::TraceTypesFromRetainedClasses() {
21172117

21182118
void Precompiler::DropMetadata() {
21192119
Library& lib = Library::Handle(Z);
2120+
const GrowableObjectArray& null_growable_list =
2121+
GrowableObjectArray::Handle(Z);
2122+
Array& dependencies = Array::Handle(Z);
2123+
Namespace& ns = Namespace::Handle(Z);
2124+
const Field& null_field = Field::Handle(Z);
2125+
GrowableObjectArray& metadata = GrowableObjectArray::Handle(Z);
2126+
Field& metadata_field = Field::Handle(Z);
2127+
21202128
for (intptr_t i = 0; i < libraries_.Length(); i++) {
21212129
lib ^= libraries_.At(i);
2122-
lib.set_metadata(Array::null_array());
2130+
metadata ^= lib.metadata();
2131+
for (intptr_t j = 0; j < metadata.Length(); j++) {
2132+
metadata_field ^= metadata.At(j);
2133+
if (metadata_field.is_static()) {
2134+
// Although this field will become garbage after clearing the list
2135+
// below, we also need to clear its value from the field table.
2136+
// The value may be an instance of an otherwise dead class, and if
2137+
// it remains in the field table we can get an instance on the heap
2138+
// with a deleted class.
2139+
metadata_field.SetStaticValue(Object::null_instance(),
2140+
/*save_initial_value=*/true);
2141+
}
2142+
}
2143+
2144+
lib.set_metadata(null_growable_list);
2145+
2146+
dependencies = lib.imports();
2147+
for (intptr_t j = 0; j < dependencies.Length(); j++) {
2148+
ns ^= dependencies.At(j);
2149+
if (!ns.IsNull()) {
2150+
ns.set_metadata_field(null_field);
2151+
}
2152+
}
2153+
2154+
dependencies = lib.exports();
2155+
for (intptr_t j = 0; j < dependencies.Length(); j++) {
2156+
ns ^= dependencies.At(j);
2157+
if (!ns.IsNull()) {
2158+
ns.set_metadata_field(null_field);
2159+
}
2160+
}
21232161
}
21242162
}
21252163

runtime/vm/dart_api_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6007,7 +6007,7 @@ DART_EXPORT Dart_Handle Dart_GetImportsOfScheme(Dart_Handle scheme) {
60076007
for (intptr_t j = 0; j < imports.Length(); j++) {
60086008
ns ^= imports.At(j);
60096009
if (ns.IsNull()) continue;
6010-
importee = ns.target();
6010+
importee = ns.library();
60116011
importee_uri = importee.url();
60126012
if (importee_uri.StartsWith(scheme_vm)) {
60136013
result.Add(importer);

runtime/vm/isolate_reload.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ void IsolateGroupReloadContext::BuildModifiedLibrariesClosure(
961961
for (intptr_t import_idx = 0; import_idx < ports.Length(); import_idx++) {
962962
ns ^= ports.At(import_idx);
963963
if (!ns.IsNull()) {
964-
target = ns.target();
964+
target = ns.library();
965965
target_url = target.url();
966966
if (!target_url.StartsWith(Symbols::DartExtensionScheme())) {
967967
(*imported_by)[target.index()]->Add(lib.index());
@@ -974,7 +974,7 @@ void IsolateGroupReloadContext::BuildModifiedLibrariesClosure(
974974
for (intptr_t export_idx = 0; export_idx < ports.Length(); export_idx++) {
975975
ns ^= ports.At(export_idx);
976976
if (!ns.IsNull()) {
977-
target = ns.target();
977+
target = ns.library();
978978
(*imported_by)[target.index()]->Add(lib.index());
979979
}
980980
}
@@ -992,7 +992,7 @@ void IsolateGroupReloadContext::BuildModifiedLibrariesClosure(
992992
import_idx++) {
993993
ns ^= ports.At(import_idx);
994994
if (!ns.IsNull()) {
995-
target = ns.target();
995+
target = ns.library();
996996
(*imported_by)[target.index()]->Add(lib.index());
997997
}
998998
}

runtime/vm/kernel.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,28 +430,26 @@ class MetadataEvaluator : public KernelReaderHelper {
430430
DISALLOW_COPY_AND_ASSIGN(MetadataEvaluator);
431431
};
432432

433-
ObjectPtr EvaluateMetadata(const Library& library,
434-
intptr_t kernel_offset,
433+
ObjectPtr EvaluateMetadata(const Field& metadata_field,
435434
bool is_annotations_offset) {
436435
LongJumpScope jump;
437436
if (setjmp(*jump.Set()) == 0) {
438437
Thread* thread = Thread::Current();
439438
Zone* zone = thread->zone();
440439
TranslationHelper helper(thread);
441-
Script& script = Script::Handle(
442-
zone, Class::Handle(zone, library.toplevel_class()).script());
440+
Script& script = Script::Handle(zone, metadata_field.Script());
443441
helper.InitFromScript(script);
444442

445-
const Class& owner_class = Class::Handle(zone, library.toplevel_class());
443+
const Class& owner_class = Class::Handle(zone, metadata_field.Owner());
446444
ActiveClass active_class;
447445
ActiveClassScope active_class_scope(&active_class, &owner_class);
448446

449447
MetadataEvaluator metadata_evaluator(
450448
zone, &helper, script,
451-
ExternalTypedData::Handle(zone, library.kernel_data()),
452-
library.kernel_offset(), &active_class);
449+
ExternalTypedData::Handle(zone, metadata_field.KernelData()),
450+
metadata_field.KernelDataProgramOffset(), &active_class);
453451

454-
return metadata_evaluator.EvaluateMetadata(kernel_offset,
452+
return metadata_evaluator.EvaluateMetadata(metadata_field.kernel_offset(),
455453
is_annotations_offset);
456454

457455
} else {

0 commit comments

Comments
 (0)