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

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

Issue 1686773002: Precompilation: drop unused types and type arguments and empty classes and libraries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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/class_table.h" 5 #include "vm/class_table.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 #include "vm/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 ASSERT(table_[index] == 0); 174 ASSERT(table_[index] == 0);
175 cls.set_id(index); 175 cls.set_id(index);
176 table_[index] = cls.raw(); 176 table_[index] = cls.raw();
177 if (index >= top_) { 177 if (index >= top_) {
178 top_ = index + 1; 178 top_ = index + 1;
179 } 179 }
180 } 180 }
181 181
182 182
183 #if defined(DEBUG)
184 void ClassTable::Unregister(intptr_t index) {
185 table_[index] = 0;
186 }
187 #endif
188
189
183 void ClassTable::VisitObjectPointers(ObjectPointerVisitor* visitor) { 190 void ClassTable::VisitObjectPointers(ObjectPointerVisitor* visitor) {
184 ASSERT(visitor != NULL); 191 ASSERT(visitor != NULL);
185 visitor->VisitPointers(reinterpret_cast<RawObject**>(&table_[0]), top_); 192 visitor->VisitPointers(reinterpret_cast<RawObject**>(&table_[0]), top_);
186 } 193 }
187 194
188 195
189 void ClassTable::Validate() { 196 void ClassTable::Validate() {
190 Class& cls = Class::Handle(); 197 Class& cls = Class::Handle();
191 for (intptr_t i = kNumPredefinedCids; i < top_; i++) { 198 for (intptr_t i = kNumPredefinedCids; i < top_; i++) {
192 // Some of the class table entries maybe NULL as we create some 199 // Some of the class table entries maybe NULL as we create some
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 549
543 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { 550 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) {
544 ClassHeapStats* stats = PreliminaryStatsAt(cid); 551 ClassHeapStats* stats = PreliminaryStatsAt(cid);
545 ASSERT(stats != NULL); 552 ASSERT(stats != NULL);
546 ASSERT(size >= 0); 553 ASSERT(size >= 0);
547 stats->post_gc.AddNew(size); 554 stats->post_gc.AddNew(size);
548 } 555 }
549 556
550 557
551 } // namespace dart 558 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_table.h ('k') | runtime/vm/object.h » ('j') | runtime/vm/precompiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698