Skip to content

Commit a199791

Browse files
aamcommit-bot@chromium.org
authored andcommitted
[vm/patch_class] Remove obsolete "patch" bit from Class object.
This bit was made redundant when parsing was moved out of vm into frontend. Change-Id: Ia0c40e2420e58caffa3ad7ed390b9189706b6acb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153385 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent b8a6e77 commit a199791

File tree

6 files changed

+5
-29
lines changed

6 files changed

+5
-29
lines changed

runtime/vm/class_finalizer.cc

+1-9
Original file line numberDiff line numberDiff line change
@@ -1151,14 +1151,6 @@ void ClassFinalizer::FinalizeClass(const Class& cls) {
11511151
}
11521152
#endif // !defined(DART_PRECOMPILED_RUNTIME)
11531153

1154-
if (cls.is_patch()) {
1155-
// The fields and functions of a patch class are copied to the
1156-
// patched class after parsing. There is nothing to finalize.
1157-
ASSERT(Array::Handle(cls.functions()).Length() == 0);
1158-
ASSERT(Array::Handle(cls.fields()).Length() == 0);
1159-
cls.set_is_finalized();
1160-
return;
1161-
}
11621154
// Ensure super class is finalized.
11631155
const Class& super = Class::Handle(cls.SuperClass());
11641156
if (!super.IsNull()) {
@@ -1426,7 +1418,7 @@ void ClassFinalizer::SortClasses() {
14261418
continue;
14271419
}
14281420
cls = table->At(cid);
1429-
if (cls.is_patch() || !cls.is_declaration_loaded()) {
1421+
if (!cls.is_declaration_loaded()) {
14301422
continue;
14311423
}
14321424
if (cls.SuperClass() == I->object_store()->object_class()) {

runtime/vm/compiler/backend/il.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ void HierarchyInfo::BuildRangesFor(ClassTable* table,
202202
if (cid == kNullCid && !exclude_null) continue;
203203
cls = table->At(cid);
204204
if (!include_abstract && cls.is_abstract()) continue;
205-
if (cls.is_patch()) continue;
206205
if (cls.IsTopLevel()) continue;
207206

208207
// We are either interested in [CidRange]es of subclasses or subtypes.
@@ -310,7 +309,7 @@ void HierarchyInfo::BuildRangesForJIT(ClassTable* table,
310309
for (; j < current_cid; ++j) {
311310
if (table->HasValidClassAt(j)) {
312311
klass = table->At(j);
313-
if (!klass.is_patch() && !klass.IsTopLevel()) {
312+
if (!klass.IsTopLevel()) {
314313
// If we care about abstract classes also, we cannot skip over any
315314
// arbitrary abstract class, only those which are subtypes.
316315
if (include_abstract) {

runtime/vm/isolate_reload.cc

-5
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,6 @@ class BecomeMapTraits {
404404
};
405405

406406
bool IsolateReloadContext::IsSameClass(const Class& a, const Class& b) {
407-
if (a.is_patch() != b.is_patch()) {
408-
// TODO(johnmccutchan): Should we just check the class kind bits?
409-
return false;
410-
}
411-
412407
// TODO(turnidge): We need to look at generic type arguments for
413408
// synthetic mixin classes. Their names are not necessarily unique
414409
// currently.

runtime/vm/object.cc

+2-7
Original file line numberDiff line numberDiff line change
@@ -4757,10 +4757,6 @@ void Class::set_is_type_finalized() const {
47574757
raw_ptr()->state_bits_));
47584758
}
47594759

4760-
void Class::set_is_patch() const {
4761-
set_state_bits(PatchBit::update(true, raw_ptr()->state_bits_));
4762-
}
4763-
47644760
void Class::set_is_synthesized_class() const {
47654761
set_state_bits(SynthesizedClassBit::update(true, raw_ptr()->state_bits_));
47664762
}
@@ -5440,10 +5436,9 @@ const char* Class::ToCString() const {
54405436
NoSafepointScope no_safepoint;
54415437
const Library& lib = Library::Handle(library());
54425438
const char* library_name = lib.IsNull() ? "" : lib.ToCString();
5443-
const char* patch_prefix = is_patch() ? "Patch " : "";
54445439
const char* class_name = String::Handle(Name()).ToCString();
5445-
return OS::SCreate(Thread::Current()->zone(), "%s %sClass: %s", library_name,
5446-
patch_prefix, class_name);
5440+
return OS::SCreate(Thread::Current()->zone(), "%s Class: %s", library_name,
5441+
class_name);
54475442
}
54485443

54495444
// Thomas Wang, Integer Hash Functions.

runtime/vm/object.h

-5
Original file line numberDiff line numberDiff line change
@@ -1359,9 +1359,6 @@ class Class : public Object {
13591359
}
13601360
void set_is_type_finalized() const;
13611361

1362-
bool is_patch() const { return PatchBit::decode(raw_ptr()->state_bits_); }
1363-
void set_is_patch() const;
1364-
13651362
bool is_synthesized_class() const {
13661363
return SynthesizedClassBit::decode(raw_ptr()->state_bits_);
13671364
}
@@ -1666,7 +1663,6 @@ class Class : public Object {
16661663
kClassLoadingPos = kClassFinalizedPos + kClassFinalizedSize, // = 4
16671664
kClassLoadingSize = 2,
16681665
kAbstractBit = kClassLoadingPos + kClassLoadingSize, // = 6
1669-
kPatchBit,
16701666
kSynthesizedClassBit,
16711667
kMixinAppAliasBit,
16721668
kMixinTypeAppliedBit,
@@ -1688,7 +1684,6 @@ class Class : public Object {
16881684
kClassLoadingPos,
16891685
kClassLoadingSize> {};
16901686
class AbstractBit : public BitField<uint32_t, bool, kAbstractBit, 1> {};
1691-
class PatchBit : public BitField<uint32_t, bool, kPatchBit, 1> {};
16921687
class SynthesizedClassBit
16931688
: public BitField<uint32_t, bool, kSynthesizedClassBit, 1> {};
16941689
class FieldsMarkedNullableBit

runtime/vm/object_service.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void Class::PrintJSONImpl(JSONStream* stream, bool ref) const {
9696
jsobj.AddProperty("const", is_const());
9797
jsobj.AddProperty("_finalized", is_finalized());
9898
jsobj.AddProperty("_implemented", is_implemented());
99-
jsobj.AddProperty("_patch", is_patch());
99+
jsobj.AddProperty("_patch", false);
100100
jsobj.AddProperty("_traceAllocations", TraceAllocation(isolate));
101101

102102
const Class& superClass = Class::Handle(SuperClass());

0 commit comments

Comments
 (0)