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

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

Issue 2497673004: Rehash canonical constants table for each class that can be affected by the 'become' operation (Closed)
Patch Set: Created 4 years, 1 month 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
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 #if defined(DEBUG) 86 #if defined(DEBUG)
87 VerifyCanonicalVisitor::VerifyCanonicalVisitor(Thread* thread) 87 VerifyCanonicalVisitor::VerifyCanonicalVisitor(Thread* thread)
88 : thread_(thread), instanceHandle_(Instance::Handle(thread->zone())) {} 88 : thread_(thread), instanceHandle_(Instance::Handle(thread->zone())) {}
89 89
90 90
91 void VerifyCanonicalVisitor::VisitObject(RawObject* obj) { 91 void VerifyCanonicalVisitor::VisitObject(RawObject* obj) {
92 if (obj->GetClassId() >= kInstanceCid) { 92 if (obj->GetClassId() >= kInstanceCid) {
93 if (obj->IsCanonical()) { 93 if (obj->IsCanonical()) {
94 instanceHandle_ ^= obj; 94 instanceHandle_ ^= obj;
95 ASSERT(instanceHandle_.CheckIsCanonical(thread_)); 95 const bool is_canonical = instanceHandle_.CheckIsCanonical(thread_);
96 if (!is_canonical) {
97 OS::PrintErr("Instance `%s` is not canonical!\n",
98 instanceHandle_.ToCString());
99 }
100 ASSERT(is_canonical);
96 } 101 }
97 } 102 }
98 } 103 }
99 #endif // defined(DEBUG) 104 #endif // defined(DEBUG)
100 105
101 } // namespace dart 106 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698