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 19 matching lines...) Expand all Loading... |
30 calloc(capacity_, sizeof(RawClass*))); // NOLINT | 30 calloc(capacity_, sizeof(RawClass*))); // NOLINT |
31 } else { | 31 } else { |
32 // Duplicate the class table from the VM isolate. | 32 // Duplicate the class table from the VM isolate. |
33 ClassTable* vm_class_table = Dart::vm_isolate()->class_table(); | 33 ClassTable* vm_class_table = Dart::vm_isolate()->class_table(); |
34 capacity_ = vm_class_table->capacity_; | 34 capacity_ = vm_class_table->capacity_; |
35 table_ = reinterpret_cast<RawClass**>( | 35 table_ = reinterpret_cast<RawClass**>( |
36 calloc(capacity_, sizeof(RawClass*))); // NOLINT | 36 calloc(capacity_, sizeof(RawClass*))); // NOLINT |
37 for (intptr_t i = kObjectCid; i < kInstanceCid; i++) { | 37 for (intptr_t i = kObjectCid; i < kInstanceCid; i++) { |
38 table_[i] = vm_class_table->At(i); | 38 table_[i] = vm_class_table->At(i); |
39 } | 39 } |
| 40 table_[kTypeArgumentsCid] = vm_class_table->At(kTypeArgumentsCid); |
40 table_[kFreeListElement] = vm_class_table->At(kFreeListElement); | 41 table_[kFreeListElement] = vm_class_table->At(kFreeListElement); |
41 table_[kForwardingCorpse] = vm_class_table->At(kForwardingCorpse); | 42 table_[kForwardingCorpse] = vm_class_table->At(kForwardingCorpse); |
42 table_[kDynamicCid] = vm_class_table->At(kDynamicCid); | 43 table_[kDynamicCid] = vm_class_table->At(kDynamicCid); |
43 table_[kVoidCid] = vm_class_table->At(kVoidCid); | 44 table_[kVoidCid] = vm_class_table->At(kVoidCid); |
44 | 45 |
45 #ifndef PRODUCT | 46 #ifndef PRODUCT |
46 class_heap_stats_table_ = reinterpret_cast<ClassHeapStats*>( | 47 class_heap_stats_table_ = reinterpret_cast<ClassHeapStats*>( |
47 calloc(capacity_, sizeof(ClassHeapStats))); // NOLINT | 48 calloc(capacity_, sizeof(ClassHeapStats))); // NOLINT |
48 for (intptr_t i = 0; i < capacity_; i++) { | 49 for (intptr_t i = 0; i < capacity_; i++) { |
49 class_heap_stats_table_[i].Initialize(); | 50 class_heap_stats_table_[i].Initialize(); |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 | 548 |
548 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 549 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
549 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 550 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
550 ASSERT(stats != NULL); | 551 ASSERT(stats != NULL); |
551 ASSERT(size >= 0); | 552 ASSERT(size >= 0); |
552 stats->post_gc.AddNew(size); | 553 stats->post_gc.AddNew(size); |
553 } | 554 } |
554 #endif // !PRODUCT | 555 #endif // !PRODUCT |
555 | 556 |
556 } // namespace dart | 557 } // namespace dart |
OLD | NEW |