Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Side by Side Diff: runtime/vm/object.cc

Issue 1212943010: Safer interface for heap iteration. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix release mode. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 // pre-allocated in the vm isolate also. 869 // pre-allocated in the vm isolate also.
870 cls = isolate->object_store()->array_class(); 870 cls = isolate->object_store()->array_class();
871 cls.set_name(Symbols::_List()); 871 cls.set_name(Symbols::_List());
872 cls = isolate->object_store()->one_byte_string_class(); 872 cls = isolate->object_store()->one_byte_string_class();
873 cls.set_name(Symbols::OneByteString()); 873 cls.set_name(Symbols::OneByteString());
874 874
875 // Make the VM isolate read-only after setting all objects as marked. 875 // Make the VM isolate read-only after setting all objects as marked.
876 PremarkingVisitor premarker(isolate); 876 PremarkingVisitor premarker(isolate);
877 isolate->heap()->WriteProtect(false); 877 isolate->heap()->WriteProtect(false);
878 ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0); 878 ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
879 isolate->heap()->old_space()->VisitObjects(&premarker); 879 isolate->heap()->IterateOldObjects(&premarker);
880 isolate->heap()->WriteProtect(true); 880 isolate->heap()->WriteProtect(true);
881 } 881 }
882 882
883 883
884 void Object::InitVmIsolateSnapshotObjectTable(intptr_t len) { 884 void Object::InitVmIsolateSnapshotObjectTable(intptr_t len) {
885 ASSERT(Isolate::Current() == Dart::vm_isolate()); 885 ASSERT(Isolate::Current() == Dart::vm_isolate());
886 *vm_isolate_snapshot_object_table_ = Array::New(len, Heap::kOld); 886 *vm_isolate_snapshot_object_table_ = Array::New(len, Heap::kOld);
887 } 887 }
888 888
889 889
(...skipping 20284 matching lines...) Expand 10 before | Expand all | Expand 10 after
21174 return tag_label.ToCString(); 21174 return tag_label.ToCString();
21175 } 21175 }
21176 21176
21177 21177
21178 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21178 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21179 Instance::PrintJSONImpl(stream, ref); 21179 Instance::PrintJSONImpl(stream, ref);
21180 } 21180 }
21181 21181
21182 21182
21183 } // namespace dart 21183 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698