Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7bd8eb1

Browse files
author
Dart CI
committed
Version 2.15.0-19.0.dev
Merge commit 'f4ddc8dc6b246cf915bb8777ee3e0efd04d20221' into 'dev'
2 parents d39206f + f4ddc8d commit 7bd8eb1

34 files changed

+1303
-552
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
- Added `void unawaited(Future)` top-level function to deal with the
5858
`unawaited_futures` lint.
5959

60+
#### `dart:cli`
61+
62+
- The experimental `waitFor` functionality, and the library containing only that
63+
function, are now deprecated.
64+
6065
#### `dart:core`
6166

6267
- Introduce `Enum` interface implemented by all `enum` declarations.

runtime/vm/BUILD.gn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ library_for_all_configs("libdart_vm") {
109109
sources = vm_sources + rebase_path(compiler_api_sources, ".", "./compiler/") +
110110
rebase_path(disassembler_sources, ".", "./compiler/") +
111111
rebase_path(heap_sources, ".", "./heap/")
112+
if (is_android) {
113+
# Android specific workaround for a kernel bug. This source file can't
114+
# go into vm_sources list because it will break Windows build which
115+
# uses different assembler syntax.
116+
sources += [ "thread_interrupter_android_arm.S" ]
117+
}
112118
include_dirs = [ ".." ]
113119
}
114120

runtime/vm/compiler/assembler/assembler_base.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ void AssemblerBase::Comment(const char* format, ...) {
299299
}
300300

301301
bool AssemblerBase::EmittingComments() {
302-
return FLAG_code_comments || FLAG_disassemble || FLAG_disassemble_optimized;
302+
return FLAG_code_comments || FLAG_disassemble || FLAG_disassemble_optimized ||
303+
FLAG_disassemble_stubs;
303304
}
304305

305306
void AssemblerBase::Stop(const char* message) {

runtime/vm/compiler/backend/flow_graph_compiler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,7 @@ void FlowGraphCompiler::GenerateCidRangesCheck(
23492349
// If there are no valid class ranges, the check will fail. If we are
23502350
// supposed to fall-through in the positive case, we'll explicitly jump to
23512351
// the [outside_range_lbl].
2352-
if (cid_ranges.length() == 1 && cid_ranges[0].IsIllegalRange()) {
2352+
if (cid_ranges.is_empty()) {
23532353
if (fall_through_if_inside) {
23542354
assembler->Jump(outside_range_lbl);
23552355
}

runtime/vm/compiler/backend/il.cc

Lines changed: 16 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,16 @@ DEFINE_FLAG(bool,
5454
DECLARE_FLAG(bool, inline_alloc);
5555
DECLARE_FLAG(bool, use_slow_path);
5656

57-
class SubclassFinder {
57+
class SubtypeFinder {
5858
public:
59-
SubclassFinder(Zone* zone,
60-
GrowableArray<intptr_t>* cids,
61-
bool include_abstract)
59+
SubtypeFinder(Zone* zone,
60+
GrowableArray<intptr_t>* cids,
61+
bool include_abstract)
6262
: array_handles_(zone),
6363
class_handles_(zone),
6464
cids_(cids),
6565
include_abstract_(include_abstract) {}
6666

67-
void ScanSubClasses(const Class& klass) {
68-
if (include_abstract_ || !klass.is_abstract()) {
69-
cids_->Add(klass.id());
70-
}
71-
ScopedHandle<GrowableObjectArray> array(&array_handles_);
72-
ScopedHandle<Class> subclass(&class_handles_);
73-
*array = klass.direct_subclasses();
74-
if (!array->IsNull()) {
75-
for (intptr_t i = 0; i < array->Length(); ++i) {
76-
*subclass ^= array->At(i);
77-
ScanSubClasses(*subclass);
78-
}
79-
}
80-
}
81-
8267
void ScanImplementorClasses(const Class& klass) {
8368
// An implementor of [klass] is
8469
// * the [klass] itself.
@@ -134,36 +119,9 @@ const CidRangeVector& HierarchyInfo::SubtypeRangesForClass(
134119
CidRangeVector& ranges = (*cid_ranges)[klass.id()];
135120
if (ranges.length() == 0) {
136121
if (!FLAG_precompiled_mode) {
137-
BuildRangesForJIT(table, &ranges, klass, /*use_subtype_test=*/true,
138-
include_abstract, exclude_null);
139-
} else {
140-
BuildRangesFor(table, &ranges, klass, /*use_subtype_test=*/true,
141-
include_abstract, exclude_null);
142-
}
143-
}
144-
return ranges;
145-
}
146-
147-
const CidRangeVector& HierarchyInfo::SubclassRangesForClass(
148-
const Class& klass) {
149-
ClassTable* table = thread()->isolate_group()->class_table();
150-
const intptr_t cid_count = table->NumCids();
151-
if (cid_subclass_ranges_ == nullptr) {
152-
cid_subclass_ranges_.reset(new CidRangeVector[cid_count]);
153-
}
154-
155-
CidRangeVector& ranges = cid_subclass_ranges_[klass.id()];
156-
if (ranges.length() == 0) {
157-
if (!FLAG_precompiled_mode) {
158-
BuildRangesForJIT(table, &ranges, klass,
159-
/*use_subtype_test=*/true,
160-
/*include_abstract=*/false,
161-
/*exclude_null=*/false);
122+
BuildRangesForJIT(table, &ranges, klass, include_abstract, exclude_null);
162123
} else {
163-
BuildRangesFor(table, &ranges, klass,
164-
/*use_subtype_test=*/false,
165-
/*include_abstract=*/false,
166-
/*exclude_null=*/false);
124+
BuildRangesFor(table, &ranges, klass, include_abstract, exclude_null);
167125
}
168126
}
169127
return ranges;
@@ -175,18 +133,12 @@ const CidRangeVector& HierarchyInfo::SubclassRangesForClass(
175133
void HierarchyInfo::BuildRangesFor(ClassTable* table,
176134
CidRangeVector* ranges,
177135
const Class& klass,
178-
bool use_subtype_test,
179136
bool include_abstract,
180137
bool exclude_null) {
181138
Zone* zone = thread()->zone();
182-
ClassTable* class_table = thread()->isolate_group()->class_table();
183-
184-
// Only really used if `use_subtype_test == true`.
185139
const Type& dst_type = Type::Handle(zone, Type::RawCast(klass.RareType()));
186140
AbstractType& cls_type = AbstractType::Handle(zone);
187-
188141
Class& cls = Class::Handle(zone);
189-
AbstractType& super_type = AbstractType::Handle(zone);
190142
const intptr_t cid_count = table->NumCids();
191143

192144
// Iterate over all cids to find the ones to be included in the ranges.
@@ -210,24 +162,14 @@ void HierarchyInfo::BuildRangesFor(ClassTable* table,
210162
if (!include_abstract && cls.is_abstract()) continue;
211163
if (cls.IsTopLevel()) continue;
212164

213-
// We are either interested in [CidRange]es of subclasses or subtypes.
165+
// We are interested in [CidRange]es of subtypes.
214166
bool test_succeeded = false;
215167
if (cid == kNullCid) {
216168
ASSERT(exclude_null);
217169
test_succeeded = false;
218-
} else if (use_subtype_test) {
170+
} else {
219171
cls_type = cls.RareType();
220172
test_succeeded = cls_type.IsSubtypeOf(dst_type, Heap::kNew);
221-
} else {
222-
while (!cls.IsObjectClass()) {
223-
if (cls.ptr() == klass.ptr()) {
224-
test_succeeded = true;
225-
break;
226-
}
227-
super_type = cls.super_type();
228-
const intptr_t type_class_id = super_type.type_class_id();
229-
cls = class_table->At(type_class_id);
230-
}
231173
}
232174

233175
if (test_succeeded) {
@@ -245,41 +187,31 @@ void HierarchyInfo::BuildRangesFor(ClassTable* table,
245187
}
246188
}
247189

248-
// Construct last range (either close open one, or add invalid).
190+
// Construct last range if there is a open one.
249191
if (start != -1) {
250192
ASSERT(start <= end);
251193
CidRange range(start, end);
252194
ranges->Add(range);
253-
} else if (ranges->length() == 0) {
254-
CidRange range;
255-
ASSERT(range.IsIllegalRange());
256-
ranges->Add(range);
257195
}
258196
}
259197

260198
void HierarchyInfo::BuildRangesForJIT(ClassTable* table,
261199
CidRangeVector* ranges,
262200
const Class& dst_klass,
263-
bool use_subtype_test,
264201
bool include_abstract,
265202
bool exclude_null) {
266203
if (dst_klass.InVMIsolateHeap()) {
267-
BuildRangesFor(table, ranges, dst_klass, use_subtype_test, include_abstract,
268-
exclude_null);
204+
BuildRangesFor(table, ranges, dst_klass, include_abstract, exclude_null);
269205
return;
270206
}
271207

272208
Zone* zone = thread()->zone();
273209
GrowableArray<intptr_t> cids;
274-
SubclassFinder finder(zone, &cids, include_abstract);
210+
SubtypeFinder finder(zone, &cids, include_abstract);
275211
{
276212
SafepointReadRwLocker ml(thread(),
277213
thread()->isolate_group()->program_lock());
278-
if (use_subtype_test) {
279-
finder.ScanImplementorClasses(dst_klass);
280-
} else {
281-
finder.ScanSubClasses(dst_klass);
282-
}
214+
finder.ScanImplementorClasses(dst_klass);
283215
}
284216

285217
// Sort all collected cids.
@@ -429,17 +361,6 @@ bool HierarchyInfo::CanUseGenericSubtypeRangeCheckFor(
429361
ASSERT(type_class.NumTypeParameters() > 0 &&
430362
type.arguments() != TypeArguments::null());
431363

432-
// If the type class is implemented the different implementations might have
433-
// their type argument vector stored at different offsets and we can therefore
434-
// not perform our optimized [CidRange]-based implementation.
435-
//
436-
// TODO(kustermann): If the class is implemented but all implementations
437-
// store the instantator type argument vector at the same offset we can
438-
// still do it!
439-
if (type_class.is_implemented()) {
440-
return false;
441-
}
442-
443364
const TypeArguments& ta =
444365
TypeArguments::Handle(zone, Type::Cast(type).arguments());
445366
ASSERT(ta.Length() == num_type_arguments);
@@ -477,11 +398,10 @@ bool HierarchyInfo::InstanceOfHasClassRange(const AbstractType& type,
477398
/*exclude_null=*/true);
478399
if (ranges.length() == 1) {
479400
const CidRangeValue& range = ranges[0];
480-
if (!range.IsIllegalRange()) {
481-
*lower_limit = range.cid_start;
482-
*upper_limit = range.cid_end;
483-
return true;
484-
}
401+
ASSERT(!range.IsIllegalRange());
402+
*lower_limit = range.cid_start;
403+
*upper_limit = range.cid_end;
404+
return true;
485405
}
486406
}
487407
return false;

runtime/vm/compiler/backend/il.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef RUNTIME_VM_COMPILER_BACKEND_IL_H_
66
#define RUNTIME_VM_COMPILER_BACKEND_IL_H_
77

8+
#include "vm/hash_map.h"
89
#if defined(DART_PRECOMPILED_RUNTIME)
910
#error "AOT runtime should not use compiler sources (including header files)"
1011
#endif // defined(DART_PRECOMPILED_RUNTIME)
@@ -247,17 +248,19 @@ class HierarchyInfo : public ThreadStackResource {
247248
cid_subtype_ranges_nullable_(),
248249
cid_subtype_ranges_abstract_nullable_(),
249250
cid_subtype_ranges_nonnullable_(),
250-
cid_subtype_ranges_abstract_nonnullable_(),
251-
cid_subclass_ranges_() {
251+
cid_subtype_ranges_abstract_nonnullable_() {
252252
thread->set_hierarchy_info(this);
253253
}
254254

255255
~HierarchyInfo() { thread()->set_hierarchy_info(NULL); }
256256

257+
// Returned from FindBestTAVOffset and SplitOnConsistentTypeArguments
258+
// to denote a failure to find a compatible concrete, finalized class.
259+
static const intptr_t kNoCompatibleTAVOffset = 0;
260+
257261
const CidRangeVector& SubtypeRangesForClass(const Class& klass,
258262
bool include_abstract,
259263
bool exclude_null);
260-
const CidRangeVector& SubclassRangesForClass(const Class& klass);
261264

262265
bool InstanceOfHasClassRange(const AbstractType& type,
263266
intptr_t* lower_limit,
@@ -284,13 +287,11 @@ class HierarchyInfo : public ThreadStackResource {
284287
private:
285288
// Does not use any hierarchy information available in the system but computes
286289
// it via O(n) class table traversal. The boolean parameters denote:
287-
// use_subtype_test : if set, IsSubtypeOf() is used to compute inclusion
288290
// include_abstract : if set, include abstract types (don't care otherwise)
289291
// exclude_null : if set, exclude null types (don't care otherwise)
290292
void BuildRangesFor(ClassTable* table,
291293
CidRangeVector* ranges,
292294
const Class& klass,
293-
bool use_subtype_test,
294295
bool include_abstract,
295296
bool exclude_null);
296297

@@ -299,15 +300,13 @@ class HierarchyInfo : public ThreadStackResource {
299300
void BuildRangesForJIT(ClassTable* table,
300301
CidRangeVector* ranges,
301302
const Class& klass,
302-
bool use_subtype_test,
303303
bool include_abstract,
304304
bool exclude_null);
305305

306306
std::unique_ptr<CidRangeVector[]> cid_subtype_ranges_nullable_;
307307
std::unique_ptr<CidRangeVector[]> cid_subtype_ranges_abstract_nullable_;
308308
std::unique_ptr<CidRangeVector[]> cid_subtype_ranges_nonnullable_;
309309
std::unique_ptr<CidRangeVector[]> cid_subtype_ranges_abstract_nonnullable_;
310-
std::unique_ptr<CidRangeVector[]> cid_subclass_ranges_;
311310
};
312311

313312
// An embedded container with N elements of type T. Used (with partial

runtime/vm/compiler/backend/type_propagator.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ void FlowGraphTypePropagator::VisitCheckClass(CheckClassInstr* check) {
256256
CompileType result = CompileType::None();
257257
for (intptr_t i = 0, n = cids.length(); i < n; i++) {
258258
CidRange* cid_range = cids.At(i);
259-
if (cid_range->IsIllegalRange()) {
260-
return;
261-
}
259+
ASSERT(!cid_range->IsIllegalRange());
262260
for (intptr_t cid = cid_range->cid_start; cid <= cid_range->cid_end;
263261
cid++) {
264262
CompileType tp = CompileType::FromCid(cid);

runtime/vm/compiler/compiler_sources.gni

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ compiler_sources = [
146146
"stub_code_compiler_arm64.cc",
147147
"stub_code_compiler_ia32.cc",
148148
"stub_code_compiler_x64.cc",
149-
"type_testing_stubs_arm.cc",
150-
"type_testing_stubs_arm64.cc",
151-
"type_testing_stubs_x64.cc",
152149
"write_barrier_elimination.cc",
153150
"write_barrier_elimination.h",
154151
]

runtime/vm/compiler/type_testing_stubs_arm.cc

Lines changed: 0 additions & 29 deletions
This file was deleted.

runtime/vm/compiler/type_testing_stubs_arm64.cc

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)