OLD | NEW |
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 #if defined(DEBUG) | 207 #if defined(DEBUG) |
208 void ClassTable::Unregister(intptr_t index) { | 208 void ClassTable::Unregister(intptr_t index) { |
209 table_[index] = 0; | 209 table_[index] = 0; |
210 } | 210 } |
211 #endif | 211 #endif |
212 | 212 |
213 | 213 |
214 #if defined(DART_PRECOMPILER) | 214 #if defined(DART_PRECOMPILER) |
215 void ClassTable::Remap(intptr_t* old_to_new_cid) { | 215 void ClassTable::Remap(intptr_t* old_to_new_cid) { |
| 216 ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0); |
216 intptr_t num_cids = NumCids(); | 217 intptr_t num_cids = NumCids(); |
217 RawClass** cls_by_old_cid = new RawClass*[num_cids]; | 218 RawClass** cls_by_old_cid = new RawClass*[num_cids]; |
218 for (intptr_t i = 0; i < num_cids; i++) { | 219 for (intptr_t i = 0; i < num_cids; i++) { |
219 cls_by_old_cid[i] = table_[i]; | 220 cls_by_old_cid[i] = table_[i]; |
220 } | 221 } |
221 for (intptr_t i = 0; i < num_cids; i++) { | 222 for (intptr_t i = 0; i < num_cids; i++) { |
222 table_[old_to_new_cid[i]] = cls_by_old_cid[i]; | 223 table_[old_to_new_cid[i]] = cls_by_old_cid[i]; |
223 } | 224 } |
224 delete[] cls_by_old_cid; | 225 delete[] cls_by_old_cid; |
225 } | 226 } |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 597 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
597 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 598 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
598 ASSERT(stats != NULL); | 599 ASSERT(stats != NULL); |
599 ASSERT(size >= 0); | 600 ASSERT(size >= 0); |
600 stats->post_gc.AddNew(size); | 601 stats->post_gc.AddNew(size); |
601 } | 602 } |
602 #endif // !PRODUCT | 603 #endif // !PRODUCT |
603 | 604 |
604 | 605 |
605 } // namespace dart | 606 } // namespace dart |
OLD | NEW |