[vm] Remove dead read-only heap code.
This was part of the VM isolate. TEST=ci Change-Id: I831e984025c5d4d17607e8a36222bdef70bf66b8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508240 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
committed by
dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
336ad52179
commit
e59fa2e4a2
@@ -54,7 +54,6 @@ Heap::Heap(IsolateGroup* isolate_group,
|
||||
: isolate_group_(isolate_group),
|
||||
new_space_(this, max_new_gen_semi_words),
|
||||
old_space_(this, max_old_gen_words),
|
||||
read_only_(false),
|
||||
assume_scavenge_will_fail_(false),
|
||||
gc_on_nth_allocation_(kNoForcedGarbageCollection) {
|
||||
UpdateGlobalMaxUsed();
|
||||
@@ -683,12 +682,6 @@ void Heap::UpdateGlobalMaxUsed() {
|
||||
(UsedInWords(Heap::kOld) * kWordSize));
|
||||
}
|
||||
|
||||
void Heap::WriteProtect(bool read_only) {
|
||||
read_only_ = read_only;
|
||||
new_space_.WriteProtect(read_only);
|
||||
old_space_.WriteProtect(read_only);
|
||||
}
|
||||
|
||||
void Heap::Init(IsolateGroup* isolate_group,
|
||||
intptr_t max_new_gen_words,
|
||||
intptr_t max_old_gen_words) {
|
||||
|
||||
@@ -73,7 +73,6 @@ class Heap {
|
||||
PageSpace* old_space() { return &old_space_; }
|
||||
|
||||
uword Allocate(Thread* thread, intptr_t size, Space space) {
|
||||
ASSERT(!read_only_);
|
||||
switch (space) {
|
||||
case kNew:
|
||||
// Do not attempt to allocate very large objects in new space.
|
||||
@@ -129,7 +128,6 @@ class Heap {
|
||||
|
||||
// Protect access to the heap. Note: Code pages are made
|
||||
// executable/non-executable when 'read_only' is true/false, respectively.
|
||||
void WriteProtect(bool read_only);
|
||||
void WriteProtectCode(bool read_only) {
|
||||
old_space_.WriteProtectCode(read_only);
|
||||
}
|
||||
@@ -373,9 +371,6 @@ class Heap {
|
||||
|
||||
RelaxedAtomic<Dart_PerformanceMode> mode_ = {Dart_PerformanceMode_Default};
|
||||
|
||||
// This heap is in read-only mode: No allocation is allowed.
|
||||
bool read_only_;
|
||||
|
||||
bool assume_scavenge_will_fail_;
|
||||
|
||||
static constexpr intptr_t kNoForcedGarbageCollection = -1;
|
||||
|
||||
@@ -190,21 +190,6 @@ TEST_CASE(ClassHeapStats) {
|
||||
}
|
||||
#endif // !PRODUCT
|
||||
|
||||
ISOLATE_UNIT_TEST_CASE(IterateReadOnly) {
|
||||
const String& obj = String::Handle(String::New("x", Heap::kOld));
|
||||
|
||||
// It is not safe to make the heap read-only if marking or sweeping is in
|
||||
// progress.
|
||||
GCTestHelper::WaitForGCTasks();
|
||||
|
||||
Heap* heap = IsolateGroup::Current()->heap();
|
||||
EXPECT(heap->Contains(UntaggedObject::ToAddr(obj.ptr())));
|
||||
heap->WriteProtect(true);
|
||||
EXPECT(heap->Contains(UntaggedObject::ToAddr(obj.ptr())));
|
||||
heap->WriteProtect(false);
|
||||
EXPECT(heap->Contains(UntaggedObject::ToAddr(obj.ptr())));
|
||||
}
|
||||
|
||||
ISOLATE_UNIT_TEST_CASE(CollectAllGarbage_DeadOldToNew) {
|
||||
Heap* heap = IsolateGroup::Current()->heap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user