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

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

Issue 2699853002: Sort class IDs before training AppJIT snapshots (Closed)
Patch Set: Add DeleteAllCode Created 3 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
« no previous file with comments | « runtime/vm/class_table.h ('k') | runtime/vm/dart_api_impl.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/class_table.h" 5 #include "vm/class_table.h"
6 6
7 #include "vm/atomic.h" 7 #include "vm/atomic.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/freelist.h" 9 #include "vm/freelist.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 210
211 #if defined(DEBUG) 211 #if defined(DEBUG)
212 void ClassTable::Unregister(intptr_t index) { 212 void ClassTable::Unregister(intptr_t index) {
213 table_[index] = 0; 213 table_[index] = 0;
214 } 214 }
215 #endif 215 #endif
216 216
217 217
218 #if defined(DART_PRECOMPILER)
219 void ClassTable::Remap(intptr_t* old_to_new_cid) { 218 void ClassTable::Remap(intptr_t* old_to_new_cid) {
220 ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0); 219 ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0);
221 intptr_t num_cids = NumCids(); 220 intptr_t num_cids = NumCids();
222 RawClass** cls_by_old_cid = new RawClass*[num_cids]; 221 RawClass** cls_by_old_cid = new RawClass*[num_cids];
223 for (intptr_t i = 0; i < num_cids; i++) { 222 for (intptr_t i = 0; i < num_cids; i++) {
224 cls_by_old_cid[i] = table_[i]; 223 cls_by_old_cid[i] = table_[i];
225 } 224 }
226 for (intptr_t i = 0; i < num_cids; i++) { 225 for (intptr_t i = 0; i < num_cids; i++) {
227 table_[old_to_new_cid[i]] = cls_by_old_cid[i]; 226 table_[old_to_new_cid[i]] = cls_by_old_cid[i];
228 } 227 }
229 delete[] cls_by_old_cid; 228 delete[] cls_by_old_cid;
230 } 229 }
231 #endif
232 230
233 231
234 void ClassTable::VisitObjectPointers(ObjectPointerVisitor* visitor) { 232 void ClassTable::VisitObjectPointers(ObjectPointerVisitor* visitor) {
235 ASSERT(visitor != NULL); 233 ASSERT(visitor != NULL);
236 visitor->VisitPointers(reinterpret_cast<RawObject**>(&table_[0]), top_); 234 visitor->VisitPointers(reinterpret_cast<RawObject**>(&table_[0]), top_);
237 } 235 }
238 236
239 237
240 void ClassTable::Validate() { 238 void ClassTable::Validate() {
241 Class& cls = Class::Handle(); 239 Class& cls = Class::Handle();
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { 589 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) {
592 ClassHeapStats* stats = PreliminaryStatsAt(cid); 590 ClassHeapStats* stats = PreliminaryStatsAt(cid);
593 ASSERT(stats != NULL); 591 ASSERT(stats != NULL);
594 ASSERT(size >= 0); 592 ASSERT(size >= 0);
595 stats->post_gc.AddNew(size); 593 stats->post_gc.AddNew(size);
596 } 594 }
597 #endif // !PRODUCT 595 #endif // !PRODUCT
598 596
599 597
600 } // namespace dart 598 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_table.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698