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

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

Issue 2112043002: Land Ivan's change of 'Remove support for verified memory handling' (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review comments. Created 4 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/verified_memory.cc ('k') | runtime/vm/vm_sources.gypi » ('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/verifier.h" 5 #include "vm/verifier.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/freelist.h" 10 #include "vm/freelist.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 } 42 }
43 } 43 }
44 allocated_set_->Add(raw_obj); 44 allocated_set_->Add(raw_obj);
45 raw_obj->Validate(isolate_); 45 raw_obj->Validate(isolate_);
46 } 46 }
47 47
48 48
49 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { 49 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) {
50 for (RawObject** current = first; current <= last; current++) { 50 for (RawObject** current = first; current <= last; current++) {
51 VerifiedMemory::Verify(reinterpret_cast<uword>(current), kWordSize);
52 RawObject* raw_obj = *current; 51 RawObject* raw_obj = *current;
53 if (raw_obj->IsHeapObject()) { 52 if (raw_obj->IsHeapObject()) {
54 if (!allocated_set_->Contains(raw_obj)) { 53 if (!allocated_set_->Contains(raw_obj)) {
55 uword raw_addr = RawObject::ToAddr(raw_obj); 54 uword raw_addr = RawObject::ToAddr(raw_obj);
56 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr); 55 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr);
57 } 56 }
58 } 57 }
59 } 58 }
60 } 59 }
61 60
(...skipping 15 matching lines...) Expand all
77 // Visit all strongly reachable objects. 76 // Visit all strongly reachable objects.
78 isolate->IterateObjectPointers(&visitor, 77 isolate->IterateObjectPointers(&visitor,
79 StackFrameIterator::kValidateFrames); 78 StackFrameIterator::kValidateFrames);
80 VerifyWeakPointersVisitor weak_visitor(&visitor); 79 VerifyWeakPointersVisitor weak_visitor(&visitor);
81 // Visit weak handles and prologue weak handles. 80 // Visit weak handles and prologue weak handles.
82 isolate->VisitWeakPersistentHandles(&weak_visitor); 81 isolate->VisitWeakPersistentHandles(&weak_visitor);
83 delete allocated_set; 82 delete allocated_set;
84 } 83 }
85 84
86 } // namespace dart 85 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/verified_memory.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698