Skip to content

Commit 33d0a3b

Browse files
author
Dart CI
committed
Version 2.19.0-187.0.dev
Merge commit '41611a8d872fca415a0ab87bbd9fa8cdaca19d12' into 'dev'
2 parents e859710 + 41611a8 commit 33d0a3b

36 files changed

+869
-1256
lines changed

pkg/analyzer/lib/src/dart/ast/ast.dart

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4070,7 +4070,7 @@ class ExpressionFunctionBodyImpl extends FunctionBodyImpl
40704070
/// | [ConditionalExpression] cascadeSection*
40714071
/// | [ThrowExpression]
40724072
abstract class ExpressionImpl extends AstNodeImpl
4073-
implements CollectionElementImpl, Expression {
4073+
implements CollectionElementImpl, Expression, IfConditionImpl {
40744074
/// The static type of this expression, or `null` if the AST structure has not
40754075
/// been resolved.
40764076
@override
@@ -6433,6 +6433,15 @@ abstract class IdentifierImpl extends CommentReferableExpressionImpl
64336433
bool get isAssignable => true;
64346434
}
64356435

6436+
/// A condition in an `if` statement or `if` element.
6437+
///
6438+
/// ifCondition ::=
6439+
/// [Expression]
6440+
/// | [PatternVariableDeclaration]
6441+
/// | [PatternAssignment]
6442+
@experimental
6443+
abstract class IfConditionImpl extends AstNodeImpl implements IfCondition {}
6444+
64366445
class IfElementImpl extends CollectionElementImpl implements IfElement {
64376446
@override
64386447
Token ifKeyword;
@@ -6441,7 +6450,7 @@ class IfElementImpl extends CollectionElementImpl implements IfElement {
64416450
Token leftParenthesis;
64426451

64436452
/// The condition used to determine which of the branches is executed next.
6444-
ExpressionImpl _condition;
6453+
IfConditionImpl _condition;
64456454

64466455
@override
64476456
Token rightParenthesis;
@@ -6474,10 +6483,10 @@ class IfElementImpl extends CollectionElementImpl implements IfElement {
64746483
Token get beginToken => ifKeyword;
64756484

64766485
@override
6477-
ExpressionImpl get condition => _condition;
6486+
ExpressionImpl get condition => _condition as ExpressionImpl;
64786487

6479-
set condition(Expression condition) {
6480-
_condition = _becomeParentOf(condition as ExpressionImpl);
6488+
set condition(IfCondition condition) {
6489+
_condition = _becomeParentOf(condition as IfConditionImpl);
64816490
}
64826491

64836492
@override
@@ -6539,7 +6548,7 @@ class IfStatementImpl extends StatementImpl implements IfStatement {
65396548
Token leftParenthesis;
65406549

65416550
/// The condition used to determine which of the branches is executed next.
6542-
ExpressionImpl _condition;
6551+
IfConditionImpl _condition;
65436552

65446553
@override
65456554
Token rightParenthesis;
@@ -6573,10 +6582,10 @@ class IfStatementImpl extends StatementImpl implements IfStatement {
65736582
Token get beginToken => ifKeyword;
65746583

65756584
@override
6576-
ExpressionImpl get condition => _condition;
6585+
ExpressionImpl get condition => _condition as ExpressionImpl;
65776586

6578-
set condition(Expression condition) {
6579-
_condition = _becomeParentOf(condition as ExpressionImpl);
6587+
set condition(IfCondition condition) {
6588+
_condition = _becomeParentOf(condition as IfConditionImpl);
65806589
}
65816590

65826591
@override
@@ -9454,7 +9463,8 @@ class PartOfDirectiveImpl extends DirectiveImpl implements PartOfDirective {
94549463
/// When used as the condition in an `if`, the pattern is always a
94559464
/// [PatternVariable] whose type is not `null`.
94569465
@experimental
9457-
class PatternAssignmentImpl extends AstNodeImpl implements PatternAssignment {
9466+
class PatternAssignmentImpl extends AstNodeImpl
9467+
implements IfConditionImpl, PatternAssignment {
94589468
@override
94599469
final Token equals;
94609470

@@ -9536,7 +9546,7 @@ class PatternAssignmentStatementImpl extends StatementImpl
95369546
/// ( 'final' | 'var' ) [DartPattern] '=' [Expression]
95379547
@experimental
95389548
class PatternVariableDeclarationImpl extends AstNodeImpl
9539-
implements PatternVariableDeclaration {
9549+
implements IfConditionImpl, PatternVariableDeclaration {
95409550
@override
95419551
final Token equals;
95429552

runtime/platform/allocation.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
namespace dart {
1010

11+
void* calloc(size_t n, size_t size) {
12+
void* result = ::calloc(n, size);
13+
if (result == nullptr) {
14+
OUT_OF_MEMORY();
15+
}
16+
return result;
17+
}
18+
1119
void* malloc(size_t size) {
1220
void* result = ::malloc(size);
1321
if (result == nullptr) {

runtime/platform/allocation.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
namespace dart {
1212

13+
void* calloc(size_t n, size_t size);
14+
void* malloc(size_t size);
15+
void* realloc(void* ptr, size_t size);
16+
1317
// Stack allocated objects subclass from this base class. Objects of this type
1418
// cannot be allocated on either the C or object heaps. Destructors for objects
1519
// of this type will not be run unless the stack is unwound through normal
@@ -41,19 +45,11 @@ class MallocAllocated {
4145
// check malloc/new/new[] are paired with free/delete/delete[] respectively.
4246
#if !defined(USING_ADDRESS_SANITIZER)
4347
void* operator new(size_t size) {
44-
void* result = ::malloc(size);
45-
if (result == nullptr) {
46-
OUT_OF_MEMORY();
47-
}
48-
return result;
48+
return dart::malloc(size);
4949
}
5050

5151
void* operator new[](size_t size) {
52-
void* result = ::malloc(size);
53-
if (result == nullptr) {
54-
OUT_OF_MEMORY();
55-
}
56-
return result;
52+
return dart::malloc(size);
5753
}
5854

5955
void operator delete(void* pointer) { ::free(pointer); }
@@ -62,9 +58,6 @@ class MallocAllocated {
6258
#endif
6359
};
6460

65-
void* malloc(size_t size);
66-
void* realloc(void* ptr, size_t size);
67-
6861
} // namespace dart
6962

7063
#endif // RUNTIME_PLATFORM_ALLOCATION_H_

runtime/vm/app_snapshot.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static UnboxedFieldBitmap CalculateTargetUnboxedFieldsBitmap(
218218
Serializer* s,
219219
intptr_t class_id) {
220220
const auto unboxed_fields_bitmap_host =
221-
s->isolate_group()->shared_class_table()->GetUnboxedFieldsMapAt(class_id);
221+
s->isolate_group()->class_table()->GetUnboxedFieldsMapAt(class_id);
222222

223223
UnboxedFieldBitmap unboxed_fields_bitmap;
224224
if (unboxed_fields_bitmap_host.IsEmpty() ||
@@ -438,7 +438,7 @@ class ClassDeserializationCluster : public DeserializationCluster {
438438

439439
ClassTable* table = d_->isolate_group()->class_table();
440440
#if defined(DART_PRECOMPILED_RUNTIME)
441-
auto shared_class_table = d_->isolate_group()->shared_class_table();
441+
auto class_table = d_->isolate_group()->class_table();
442442
#endif
443443
for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
444444
ClassPtr cls = static_cast<ClassPtr>(d.Ref(id));
@@ -481,7 +481,7 @@ class ClassDeserializationCluster : public DeserializationCluster {
481481
#if defined(DART_PRECOMPILED_RUNTIME)
482482
if (!ClassTable::IsTopLevelCid(class_id)) {
483483
const UnboxedFieldBitmap unboxed_fields_map(d.ReadUnsigned64());
484-
shared_class_table->SetUnboxedFieldsMapAt(class_id, unboxed_fields_map);
484+
class_table->SetUnboxedFieldsMapAt(class_id, unboxed_fields_map);
485485
}
486486
#endif
487487
}
@@ -3823,7 +3823,7 @@ class InstanceSerializationCluster : public SerializationCluster {
38233823
const intptr_t next_field_offset = host_next_field_offset_in_words_
38243824
<< kCompressedWordSizeLog2;
38253825
const auto unboxed_fields_bitmap =
3826-
s->isolate_group()->shared_class_table()->GetUnboxedFieldsMapAt(cid_);
3826+
s->isolate_group()->class_table()->GetUnboxedFieldsMapAt(cid_);
38273827
intptr_t offset = Instance::NextFieldOffset();
38283828
while (offset < next_field_offset) {
38293829
// Skips unboxed fields
@@ -3861,7 +3861,7 @@ class InstanceSerializationCluster : public SerializationCluster {
38613861
const intptr_t count = objects_.length();
38623862
s->WriteUnsigned64(CalculateTargetUnboxedFieldsBitmap(s, cid_).Value());
38633863
const auto unboxed_fields_bitmap =
3864-
s->isolate_group()->shared_class_table()->GetUnboxedFieldsMapAt(cid_);
3864+
s->isolate_group()->class_table()->GetUnboxedFieldsMapAt(cid_);
38653865

38663866
for (intptr_t i = 0; i < count; i++) {
38673867
InstancePtr instance = objects_[i];

runtime/vm/class_finalizer.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,12 +1551,10 @@ void ClassFinalizer::RemapClassIds(intptr_t* old_to_new_cid) {
15511551
// The [HeapIterationScope] also safepoints all threads.
15521552
HeapIterationScope his(T);
15531553

1554-
IG->shared_class_table()->Remap(old_to_new_cid);
1555-
IG->set_remapping_cids(true);
1556-
15571554
// Update the class table. Do it before rewriting cids in headers, as
15581555
// the heap walkers load an object's size *after* calling the visitor.
15591556
IG->class_table()->Remap(old_to_new_cid);
1557+
IG->set_remapping_cids(true);
15601558

15611559
// Rewrite cids in headers and cids in Classes, Fields, Types and
15621560
// TypeParameters.

0 commit comments

Comments
 (0)